Hallo,
Ik heb een werkende agendascript, maar deze werkt alleen in IE. Wanneer men google chrome, safari of ff willen gebruiken, dan is de datum niet beschikbaar die men wil kiezen.
Wie o wie kan er even naar kijken. Dit kan eventueel tegen een kleine vergoeding, want er is namelijk wel spoed bij.
Ik zal een stuk van het script posten, misschien zit daar wel de fout. Voor een link kun je mij mailen.
Alvast bedankt.
PHP Code:
<?php
session_start();
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
$debug = 1;
$filename = "person.txt";
$filename2 = "weeks.txt";
require_once('calendar/classes/tc_calendar.php');
?>
<html>
<head>
<title>Portfolio gesprekken </title>
<script language="javascript" src="calendar/calendar.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<center>
</br>
<center><img src="calendar/wpimages/wp6ffc6d91_05.jpg" width="440" height="202" border="0" id="pic_1" name="pic_1" title="" alt=""></div></center>
<?php
function getFileContents() {
GLOBAL $filename;
$file = fopen($filename, "r");
while(!feof($file)) {
//read file line by line into a new array element
$str1 = fgets($file, 4096);
$str = $str.$str1;
}
fclose ($file);
return $str;
}
function getWeeks() {
GLOBAL $filename2;
$file = fopen($filename2, "r");
while(!feof($file)) {
//read file line by line into a new array element
$str1 = fgets($file, 4096);
$str = $str.$str1;
}
fclose ($file);
return $str;
}
function getStrArray($str)
{
$strarr = explode(';', $str);
$count = sizeof($strarr);
// echo "size of strarr: ".sizeof($strarr)."<br>";
// print_r($strarr);
// echo "<br>";
for($i=0;$i<$count;$i++)
{
if ($strarr[$i] == "")
continue;
$temp = explode(':', $strarr[$i]);
// echo $strarr[$i]."<br>";
// print_r($temp);
// echo "<br>count: ".sizeof($temp)."<br>";
for ($j=0;$j<count($temp);$j++)
{
// if ($j==0)
// $p = $temp[$j];
// else
$lines[$i][$j] = $temp[$j];
}
}
return $lines;
}
$contents = getFileContents();
//print_r($contents);
//echo "<hr>";
$lines = getStrArray($contents);
//print_r($lines);
//echo "<hr>";
$arrsize = sizeof($lines);
if (isset($_GET["resel"]))
{
$myCalendar = new tc_calendar("date2");
$myCalendar->setIcon("calendar/images/iconCalendar.gif");
$myCalendar->setDate(date('d'), date('m'), date('Y'));
$myCalendar->setPath("calendar/");
$myCalendar->setYearInterval(1970, 2020);
$myCalendar->dateAllow('2008-05-13', '2015-03-01', false);
$myCalendar->startMonday(true);
$myCalendar->autoSubmit(true, "", "calvalue.php");
$persname = $_SESSION['person'];
for ($i = 0;$i < $arrsize;$i++)
{
if ($lines[$i][0] == $persname)
{
for ($j=1;$j<sizeof($lines[$i]);$j++)
{
if (trim($lines[$i][$j]) == "Sun")
$sun = 1;
elseif (trim($lines[$i][$j]) == "Mon")
$mon = 1;
elseif (trim($lines[$i][$j]) == "Tue")
$tue = 1;
elseif (trim($lines[$i][$j]) == "Wed")
$wed = 1;
elseif (trim($lines[$i][$j]) == "Thu")
$thu = 1;
elseif (trim($lines[$i][$j]) == "Fri")
$fri = 1;
elseif (trim($lines[$i][$j]) == "Sat")
$sat = 1;
}
}
}
$weekday = array();
if ($mon)
$weekday[] = 1;
if ($tue)
$weekday[] = 2;
if ($wed)
$weekday[] = 3;
if ($thu)
$weekday[] = 4;
if ($fri)
$weekday[] = 5;
if ($sat)
$weekday[] = 6;
if ($sun)
$weekday[] = 7;
//print_r($weekday);
$myCalendar->showWeeks(true);
echo "<h1>$persname</h1>";
$contents = getWeeks();
$lines = getStrArray($contents);
$weeks = array();
for($i=0;$i<sizeof($lines);$i++)
{
if($lines[$i][0] == $persname)
$weeks = $lines[$i];
}
//print_r($weeks);
$enbdates = array();
$curryear = date('Y');
for($i=1;$i<sizeof($weeks);$i++)
{
if ($weeks[$i] != "")
{
$weeknm = "W".trim($weeks[$i]);
for($j=0;$j<sizeof($weekday);$j++)
{
$tmpwk = $curryear.$weeknm.trim($weekday[$j]);
$enbdates[] = date("Y-m-d", strtotime($tmpwk));
}
}
}
//print_r($wkarr);
$myCalendar->setSpecificDate($enbdates,1);
$myCalendar->writeScript();
}
elseif (isset($_POST["combo1"]))
{
?>
<form name="form1" method="post" action="">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td valign="top">
<?php
$frmdate = date("Y-m-d");
$enddate_t = mktime(0, 0, 0, date("m") , date("d")+14, date("Y"));
$enddate = date("Y-m-d",$enddate_t);
//$enddate = $frmdate
//echo $frmdate." ".$enddate."<br>";
$myCalendar = new tc_calendar("date2");
$myCalendar->setIcon("calendar/images/iconCalendar.gif");
$myCalendar->setDate(date('d'), date('m'), date('Y'));
$myCalendar->setPath("calendar/");
$myCalendar->setYearInterval(1970, 2020);
$myCalendar->dateAllow('2008-05-13', '2015-03-01', false);
// $myCalendar->dateAllow($frmdate, $enddate, false);
$myCalendar->startMonday(true);
$myCalendar->autoSubmit(true, "", "calvalue.php");
// $myCalendar->autoSubmit(true, "form1","calvalue.php");
// $myCalendar->disabledDay("Sat");
// $myCalendar->disabledDay("sun");
//echo date("Y-m-d", strtotime("2012W141"));
//$ddates = array ('2012-03-12', '2012-03-13');
//print_r($ddates);
//$myCalendar->setSpecificDate($ddates,1);
//echo "selected value: ".$_POST["person"]."<br>";
$persname = $_POST["person"];
$_SESSION['person'] = $persname;
for ($i = 0;$i < $arrsize;$i++)
{
if ($lines[$i][0] == $persname)
{
for ($j=1;$j<sizeof($lines[$i]);$j++)
{
if (trim($lines[$i][$j]) == "Sun")
$sun = 1;
elseif (trim($lines[$i][$j]) == "Mon")
$mon = 1;
elseif (trim($lines[$i][$j]) == "Tue")
$tue = 1;
elseif (trim($lines[$i][$j]) == "Wed")
$wed = 1;
elseif (trim($lines[$i][$j]) == "Thu")
$thu = 1;
elseif (trim($lines[$i][$j]) == "Fri")
$fri = 1;
elseif (trim($lines[$i][$j]) == "Sat")
$sat = 1;
}
}
}
$weekday = array();
if ($mon)
$weekday[] = 1;
if ($tue)
$weekday[] = 2;
if ($wed)
$weekday[] = 3;
if ($thu)
$weekday[] = 4;
if ($fri)
$weekday[] = 5;
if ($sat)
$weekday[] = 6;
if ($sun)
$weekday[] = 7;
//print_r($weekday);
$myCalendar->showWeeks(true);
echo "<h1>$persname</h1>";
$contents = getWeeks();
$lines = getStrArray($contents);
$weeks = array();
for($i=0;$i<sizeof($lines);$i++)
{
if($lines[$i][0] == $persname)
$weeks = $lines[$i];
}
//print_r($weeks);
$enbdates = array();
$curryear = date('Y');
for($i=1;$i<sizeof($weeks);$i++)
{
if ($weeks[$i] != "")
{
$weeknm = "W".trim($weeks[$i]);
for($j=0;$j<sizeof($weekday);$j++)
{
$tmpwk = $curryear.$weeknm.trim($weekday[$j]);
$enbdates[] = date("Y-m-d", strtotime($tmpwk));
}
}
}
//print_r($wkarr);
$myCalendar->setSpecificDate($enbdates,1);
$myCalendar->writeScript();
?>
</td>
</tr>
</table>
</form>
<?php
}
else
{
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<select name="person"></br>
<option value="0" selected>Selecteer een groep</option></br></br>
<?php
for ($i = 0;$i < $arrsize;$i++)
{
// echo "Person Name: ".$lines[$i][0]."<br>";
// echo "Days: ".$lines[$i][1]." , ".$lines[$i][2]."<br>";
?>
<option name="<?php echo $i;?>" value="<?php echo $lines[$i][0];?>"><?php echo $lines[$i][0]?></option>
<?php
}
?>
</select>
</br></br>
<div><input type="submit" name="combo1" value="Volgende"></br></div>
</form>
<?php
} //end of main if form submitted
?>
</body>
</html>
- probleem met script werkt alleen in IE en geen andere browsers
-
21-06-2012, 23:18 #1
- Berichten
- 316
- Lid sinds
- 16 Jaar
probleem met script werkt alleen in IE en geen andere browsers
-
In de schijnwerper
Museum Keuze | 580 musea | DR 29 (ideaal voor linkbuilding)Website te koopSocial ads specialist gezocht voor WordPress lead sites (met kennis van UTM tags)Freelance / WerkProfessionele tekstschrijver (actie: 2,5 cent per woord)Freelance / WerkLinkbuilden tegen een laag tarief?Freelance / Werk
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic