diff options
author | jwangen <jwangen> | 2002-09-29 09:12:14 +0000 |
---|---|---|
committer | jwangen <jwangen> | 2002-09-29 09:12:14 +0000 |
commit | 1fbd3ea870c2a5f41fa68fc611241bc46efb9c9a (patch) | |
tree | 52766032be7b397d102da5008dd8995f56c03f3d /week.php | |
parent | 17097c077bff00e844befa28080496d5365b519a (diff) | |
download | phpicalendar-1fbd3ea870c2a5f41fa68fc611241bc46efb9c9a.tar.gz phpicalendar-1fbd3ea870c2a5f41fa68fc611241bc46efb9c9a.tar.bz2 phpicalendar-1fbd3ea870c2a5f41fa68fc611241bc46efb9c9a.zip |
New week.php. Born from the new day.php. Still needs work but it's
working in it's current form.
ical_parser now loads 3 months worth of recurring data into the array.
week-old is the old week.php, in case we need to go back to the older
version or cross check it with the new one.
Diffstat (limited to 'week.php')
-rw-r--r-- | week.php | 274 |
1 files changed, 273 insertions, 1 deletions
@@ -1 +1,273 @@ -<?php
$current_view = "week";
include("ical_parser.php");
ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_week = $day_array2[2];
$this_year = $day_array2[1];
$sunday = sundayOfWeek($this_year, $this_month, $this_day);
$sunday_date = strtotime("$sunday");
$saturday = ($sunday_date + (6 * 25 * 60 * 60));
$start_week = strftime($dateFormat_week, strtotime("$sunday"));
$end_week = strftime($dateFormat_week, $saturday);
$unix_time = strtotime ("$getdate");
$today_today = date ("Ymd");
$next_week = date("Ymd", strtotime("+1 week", $unix_time));
$prev_week = date("Ymd", strtotime("-1 week", $unix_time));
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<title><?php echo "$calendar_name"; ?></title>
<link rel="stylesheet" type="text/css" href="styles/default.css">
<?php include "functions/event.js"; ?>
</head>
<body bgcolor="#FFFFFF">
<center>
<table width="700" border="0" cellspacing="0" cellpadding="0" class="V12">
<tr>
<td align="left" width="100"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$today_today\">$today_lang</a>"; ?></td>
<td align="center" width="500"><?php echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$getdate\">$day_lang</a> | <a class=\"psf\" href=\"week.php?cal=$cal&getdate=$today_today\">$this_week_lang</a> | <a class=\"psf\" href=\"month.php?cal=$cal&getdate=$getdate\">$month_lang</a>"; ?></td>
<td align="right" width="100"><!--[[a class="psf" href="preferences.php"]]Preferences[[/a]]--></td>
</tr>
<tr>
<td colspan="3"><img src="images/spacer.gif" height="10" width="1"></td>
</tr>
</table>
<table width="700" border="0" cellspacing="1" cellpadding="2" class="calborder">
<tr>
<td>
<table width="700" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle">
<table border="0" cellspacing="0" cellpadding="0" bgcolor="#a1a5a9" class="G10B">
<tr>
<td align="center" valign="top">
<table border="0" cellspacing="1" cellpadding="0">
<tr>
<td colspan="3" bgcolor="white" nowrap>
<table width="100%" border="0" cellspacing="4" cellpadding="0">
<tr>
<td colspan="3">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="G10B" align="left" valign="top" width="5%" nowrap><?php echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$prev_week\">$last_week_lang</a>"; ?></td>
<td class="H20" align="center" valign="middle" width="90%" nowrap><?php echo "$start_week - $end_week"; ?></td>
<td class="G10B" align="right" valign="top" width="5%" nowrap><?php echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$next_week\">$next_week_lang</a>"; ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="middle"><?php include('./functions/list_icals.php'); ?></td>
<td align="right" valign="middle" class="G10B"><?php echo "<a class=\"psf\" href=\"$fullpath$cal.ics\">$subscribe_lang</a> | <a class=\"psf\" href=\"$filename\">$download_lang</a>"; ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center" valign="top">
<table border="0" cellspacing="1" cellpadding="0" class="G10B">
<tr height="12">
<td colspan="2" height="11" width="60" nowrap bgcolor="#f5f5f5">
</td>
<?php
$thisdate = strtotime ("$sunday");
$i = 0;
do {
$thisday = date("Ymd", $thisdate);
$thisday2 = strftime($dateFormat_week_list, $thisdate);
echo "<td height=\"12\" width=\"101\" colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#f5f5f5\" class=\"V9\">\n";
echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$thisday\">$thisday2</a>\n";
echo "</td>\n";
$thisdate = ($thisdate + (25 * 60 * 60));
$i++;
} while ($i != 7);
?>
</tr>
<tr>
<td colspan="2" width="60" valign="top" align="center" bgcolor="#f5f5f5">
<img src="images/spacer.gif" width="1" height="1">
</td>
<?php
$thisdate = strtotime ("$sunday");
$i = 0;
do {
$thisday = date("Ymd", $thisdate);
if ($master_array[("$thisday")]["-1"]) {
echo "<td colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#ffffff\">\n";
foreach ($master_array[("$thisday")]["-1"] as $allDay_event) {
$event_text2 = addslashes($allDay_event["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
if (strlen($allDay_event["event_text"]) > 14) {
$event_text = substr($allDay_event["event_text"], 0, 11);
$event_text = $event_text . "...";
} else {
$event_text = $allDay_event["event_text"];
}
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr height=\"20\">\n";
echo "<td height=\"20\" valign=\"middle\" align=\"center\" class=\"eventbg\">\n";
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
echo "<tr>\n";
echo "<td valign=\"top\" align=\"center\">\n";
echo "<a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font class=\"eventfont\"><i>$event_text</i></font></a>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr height=\"1\">\n";
echo "<td height=\"1\">\n";
echo "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\"> \n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
}
echo "</td>\n";
} else {
echo "<td colspan=\"2\" valign=\"top\" align=\"center\" bgcolor=\"#ffffff\">\n";
echo "<img src=\"images/spacer.gif\" width=\"1\" height=\"1\">\n";
echo "</td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$i++;
} while ($i != 7);
?>
</tr>
<tr>
<td width="60" bgcolor="#a1a5a9" nowrap>
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="1" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
<td width="45" nowrap bgcolor="#a1a5a9">
<img src="images/spacer.gif" width="1" height="1">
</td>
</tr>
<?php
$event_length = 0;
$k = 0;
foreach ($day_array as $key) {
$count = 0;
$k = 0;
$cal_time = $key;
$key = strtotime ("$key");
if ($time_format == "24") {
$key = date ("G:i", $key);
} else {
$key = date ("g:i A", $key);
}
// The first <TR> (on the hour)
if (ereg("^([0-9]{1,2}):00", $key)) {
echo "<tr height=\"30\">\n";
echo "<td rowspan=\"2\" align=\"center\" valign=\"top\" bgcolor=\"#f5f5f5\" width=\"60\">$key</td>\n";
echo "<td height=\"30\" width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
$thisdate = strtotime ("$sunday");
$thisday = date("Ymd", $thisdate);
do {
if ($master_array["$thisday"]["$cal_time"]) {
$event_text = $master_array["$thisday"]["$cal_time"][$k]["event_text"];
$event_text2 = addslashes($master_array["$thisday"]["$cal_time"][$k]["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
$description = addslashes($master_array["$thisday"]["$cal_time"][$k]["description"]);
$description = str_replace("\"", """, $description);
$event_start = $master_array["$thisday"]["$cal_time"][$k]["event_start"];
$event_end = $master_array["$thisday"]["$cal_time"][$k]["event_end"];
$event_start = strtotime ("$event_start");
$event_end = strtotime ("$event_end");
if ($time_format == "24") {
$event_start = date ("G:i", $event_start);
$event_end = date ("G:i", $event_end);
} else {
$event_start = date ("g:i a", $event_start);
$event_end = date ("g:i a", $event_end);
}
if (strlen($event_text) > 14) {
$event_text = substr("$event_text", 0, 11);
$event_text = $event_text . "...";
}
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\">$event_text</a></td>\n";
} else {
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$thisday = date("Ymd", $thisdate);
$count++;
} while ($count != 7);
// End Week
echo "</tr>\n";
$count = 0;
}
// The second <TR> (on the half hour)
if (ereg("([0-9]{1,2}):30", $key)) {
echo "<tr height=\"30\">\n";
echo "<td height=\"30\" width=\"1\"><img src=\"images/spacer.gif\" width=\"1\" height=\"1\"></td>\n";
$thisdate = strtotime ("$sunday");
$thisday = date("Ymd", $thisdate);
do {
if ($master_array["$thisday"]["$cal_time"]) {
$event_start = $master_array["$thisday"]["$cal_time"][$k]["event_start"];
$event_end = $master_array["$thisday"]["$cal_time"][$k]["event_end"];
$event_start = date ($timeFormat, strtotime ("$event_start"));
$event_end = date ($timeFormat, strtotime ("$event_end"));
$event_text = $master_array["$thisday"]["$cal_time"][$k]["event_text"];
$event_text2 = addslashes($master_array["$thisday"]["$cal_time"][$k]["event_text"]);
$event_text2 = str_replace("\"", """, $event_text2);
$description = addslashes($master_array["$thisday"]["$cal_time"][$k]["description"]);
$description = str_replace("\"", """, $description);
if (strlen($event_text) > 14) {
$event_text = substr("$event_text", 0, 11);
$event_text = $event_text . "...";
}
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\">$event_text</a></td>\n";
} else {
echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n";
}
$thisdate = ($thisdate + (25 * 60 * 60));
$thisday = date("Ymd", $thisdate);
$count++;
} while ($count != 7);
echo "</tr>\n";
}
}
?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<?php echo "<font class=\"V9\">$powered_by_lang <a class=\"psf\" href=\"http://sourceforge.net/projects/phpicalendar/\">PHP iCalendar $version_lang</a></font>"; ?>
</center>
</body>
</html>
\ No newline at end of file +<?php + +$current_view = "week"; +include("./ical_parser.php"); + +//if ($use_sessions == "yes") { +// session_start(); +// if (is_array($aArray)) $master_array = $aArray; +// echo "using sessions"; +//} + +$starttime = "0500"; +$weekstart = 1; +// dpr 20020926: moved variable gridLength to config.inc.php +//$gridLength = 30; +$unix_time = strtotime($getdate); +$today_today = date ("Ymd"); +$next_week = date("Ymd", strtotime("+1 week", $unix_time)); +$prev_week = date("Ymd", strtotime("-1 week", $unix_time)); + +$start_week_time = strtotime(dateOfWeek($getdate, substr($week_start_day, 0, 2))); +$end_week_time = $start_week_time + (6 * 25 * 60 * 60); + +$start_week = strftime($dateFormat_week, $start_week_time); +$end_week = strftime($dateFormat_week, $end_week_time); + +$display_date = "$start_week - $end_week"; + + +// For the side months +ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); +$this_day = $day_array2[3]; +$this_month = $day_array2[2]; +$this_year = $day_array2[1]; + +$date = strtotime($getdate); +$month1 = date("m", DateAdd ("m", "-1", $date)); +$month2 = date("m", $date); +$month3 = date("m", DateAdd ("m", "+1", $date)); +$year1 = date("Y", DateAdd ("m", "-1", $date)); +$year2 = date("Y", $date); +$year3 = date("Y", DateAdd ("m", "+1", $date)); +$first_sunday1 = sundayOfWeek($year1, $month1, "1"); +$first_sunday2 = sundayOfWeek($year2, $month2, "1"); +$first_sunday3 = sundayOfWeek($year3, $month3, "1"); +$display_month1 = strftime ($dateFormat_month, strtotime("-1 month", $date)); +$display_month2 = strftime ($dateFormat_month, $date); +$display_month3 = strftime ($dateFormat_month, strtotime("+1 month", $date)); +$parse_month = date ("Ym", $date); +$thisday2 = strftime($dateFormat_week_list, $date); + +$dayborder = 0; + +$nbrGridCols = 1; +if ($master_array[($getdate)]) { + foreach($master_array[($getdate)] as $ovlKey => $ovlValue) { + if ($ovlKey != "-1") { + foreach($ovlValue as $ovl2Value) { + $nbrGridCols = kgv($nbrGridCols, ($ovl2Value["event_overlap"] + 1)); + } + } + } +} +?> + +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> +<html> +<head> + <meta http-equiv="content-type" content="text/html;charset=UTF-8"> + <title><?php echo "$calendar_name"; ?></title> + <link rel="stylesheet" type="text/css" href="styles/<?php echo "$style_sheet"; ?>"> + <?php include "functions/event.js"; ?> +</head> +<body bgcolor="#FFFFFF"> +<center> +<table border="0" width="720" cellspacing="0" cellpadding="0"> + <tr> + <td width="540" valign="top"> +<table width="540" border="0" cellspacing="0" cellpadding="0" class="calborder"> + <tr> + <td align="center" valign="middle"> + <table width="100%" border="0" cellspacing="0" cellpadding="0" class="G10B"> + <tr> + <td width="75" background="images/time_bg.gif"><?php echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$prev_week\"><img src=\"images/left_day.gif\" alt=\"\" width=\"28\" height=\"28\" border=\"0\" align=\"left\"></a>"; ?></td> + <td class="H20" align="center" bgcolor="#DDDDDD" background="images/time_bg.gif"><?php echo "$display_date"; ?></td> + <td width="75" background="images/time_bg.gif"><?php echo "<a class=\"psf\" href=\"week.php?cal=$cal&getdate=$next_week\"><img src=\"images/right_day.gif\" alt=\"\" width=\"28\" height=\"28\" border=\"0\" align=\"right\"></a>"; ?></td> + </tr> + <tr> + <td align="center" valign="top" colspan="3"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td width="60"><img src="images/spacer.gif" width="60" height="1" alt=""></td> + <td width="1"></td> + </tr> + <?php + + // print out the day names here + echo "<tr height=\"12\">"; + $thisdate = $start_week_time; + $i = 0; + echo "<td bgcolor=\"#f5f5f5\" colspan=\"2\"></td>"; + do { + $thisday = date("Ymd", $thisdate); + $thisday2 = strftime($dateFormat_week_list, $thisdate); + echo "<td height=\"12\" width=\"101\" colspan=\"" . $nbrGridCols . "\" valign=\"top\" align=\"center\" bgcolor=\"#f5f5f5\" class=\"V9\">\n"; + echo "<a class=\"psf\" href=\"day.php?cal=$cal&getdate=$thisday\">$thisday2</a>\n"; + echo "</td>\n"; + $thisdate = ($thisdate + (25 * 60 * 60)); + $i++; + } while ($i < 7); + echo "</tr>"; + + // The all day events returned here. + $thisdate = $start_week_time; + $i = 0; + echo "<tr>\n"; + echo "<td bgcolor=\"#f5f5f5\" colspan=\"2\"></td>"; + // echo "<td height=\"11\" width=\"60\" nowrap bgcolor=\"#f5f5f5\"> </td>"; + do { + $thisday = date("Ymd", $thisdate); + if ($master_array[($thisday)]["-1"]) { + echo "<td height=\"24\">\n"; + echo "<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">\n"; + foreach($master_array[($thisday)]["-1"] as $allday) { + $all_day_text = $allday["event_text"]; + $description = $allday["description"]; + echo "<tr>\n"; + echo "<td colspan=\"" . $nbrGridCols . "\" valign=\"top\" align=\"center\" bgcolor=\"#6699CC\"><a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font color=\"#ffffff\"><i>$all_day_text</i></font></a></td>\n"; + echo "</tr>\n"; + } + echo "</table>\n"; + echo "</td>\n"; + } + $thisdate = ($thisdate + (25 * 60 * 60)); + $i++; + } while ($i < 7); + echo "</tr>\n"; + + // $master_array[($getdate)]["$day_time"] + $border = 0; + + foreach ($day_array as $key) { + $cal_time = $key; + $key = strtotime ("$key"); + $key = date ($timeFormat, $key); + + + if (ereg("([0-9]{1,2}):00", $key)) { + echo "<tr height=\"" . $gridLength . "\">\n"; + echo "<td rowspan=\"" . (60 / $gridLength) . "\" align=\"center\" valign=\"top\" background=\"images/time_bg.gif\" width=\"60\" class=\"timeborder\">$key</td>\n"; + echo "<td width=\"1\" height=\"" . $gridLength . "\"></td>\n"; + } else { + + echo "<tr height=\"" . $gridLength . "\">\n"; + echo "<td width=\"1\" height=\"" . $gridLength . "\"></td>\n"; + } + + // initialize $thisdate again + $thisdate = $start_week_time; + + // loop this part 7 times, one for each day + for ($week_loop=0; $week_loop<7; $week_loop++) { + $event_length=array(); + $thisday = date("Ymd", $thisdate); + // check for eventstart + if (sizeof($master_array[($thisday)]["$cal_time"]) > 0) { + foreach ($master_array[($thisday)]["$cal_time"] as $eventKey => $loopevent) { + $drawEvent = drawEventTimes ($loopevent["event_start"], $loopevent["event_end"]); + $j = 0; + while ($event_length[$j]) { + if ($event_length[$j]["state"] == "ended") { + $event_length[$j] = array ("length" => ($drawEvent["draw_length"] / $gridLength), "key" => $eventKey, "overlap" => $loopevent["event_overlap"],"state" => "begin"); + break; + } + $j++; + } + if ($j == sizeof($event_length)) { + array_push ($event_length, array ("length" => ($drawEvent["draw_length"] / $gridLength), "key" => $eventKey, "overlap" => $loopevent["event_overlap"],"state" => "begin")); + } + } + } + if (sizeof($event_length) == 0) { + if ($dayborder == 0) { + $class = " class=\"dayborder\""; + $dayborder++; + } else { + $class = ""; + $dayborder = 0; + } + echo "<td bgcolor=\"#ffffff\" colspan=\"" . $nbrGridCols . "\" $class> </td>\n"; + + } else { + $emptyWidth = $nbrGridCols; + for ($i=0;$i<sizeof($event_length);$i++) { + + //echo $master_array[($thisday)]["$cal_time"][($event_length[$i]["key"])]["event_text"] . " ind: " . $i . " / anz: " . $event_length[$i]["overlap"] . " = " . eventWidth($i,$event_length[$i]["overlap"]) . "<br />"; + $drawWidth = $nbrGridCols / ($event_length[$i]["overlap"] + 1); + $emptyWidth = $emptyWidth - $drawWidth; + switch ($event_length[$i]["state"]) { + case "begin": + $event_length[$i]["state"] = "started"; + $event_text = $master_array[($thisday)]["$cal_time"][($event_length[$i]["key"])]["event_text"]; + $event_text2 = addslashes($master_array[($thisday)]["$cal_time"][($event_length[$i]["key"])]["event_text"]); + $event_text2 = str_replace("\"", """, $event_text2); + $event_start = $master_array[($thisday)]["$cal_time"][($event_length[$i]["key"])]["event_start"]; + $event_end = $master_array[($thisday)]["$cal_time"][($event_length[$i]["key"])]["event_end"]; + $description = addslashes($master_array[($thisday)]["$cal_time"][($event_length[$i]["key"])]["description"]); + $description = str_replace("\"", """, $description); + $event_start = strtotime ("$event_start"); + $event_start = date ($timeFormat, $event_start); + $event_end = strtotime ("$event_end"); + $event_end = date ($timeFormat, $event_end); + echo "<td rowspan=\"" . $event_length[$i]["length"] . "\" colspan=\"" . $drawWidth . "\" align=\"left\" valign=\"top\" class=\"eventbg2\">\n"; + echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">\n"; + echo "<tr>\n"; + echo "<td class=\"eventborder\"><font class=\"eventfont\"><b>$event_start</b></font></td>\n"; + echo "</tr>\n"; + echo "<tr>\n"; + echo "<td>\n"; + echo "<table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"0\">\n"; + echo "<tr>\n"; + echo "<td class=\"eventbg\"><a class=\"psf\" href=\"javascript:openEventInfo('$event_text2', '$calendar_name', '$event_start', '$event_end', '$description')\"><font class=\"eventfont\">$event_text</font></a></td>\n"; + echo "</tr>\n"; + echo "</table>\n"; + echo "</td>\n"; + echo "</tr>\n"; + echo "</table>\n"; + echo "</td>\n"; + break; + case "started": + break; + case "ended": + echo "<td bgcolor=\"#ffffff\" colspan=\"" . $drawWidth . "\"> </td>\n"; + break; + } + $event_length[$i]["length"]--; + if ($event_length[$i]["length"] == 0) { + $event_length[$i]["state"] = "ended"; + } + } + //fill emtpy space on the right + if ($emptyWidth > 0) { + echo "<td bgcolor=\"#ffffff\" colspan=\"" . $emptyWidth . "\"> </td>\n"; + } + while ($event_length[(sizeof($event_length) - 1)]["state"] == "ended") { + array_pop($event_length); + } + + } + $thisdate = ($thisdate + (25 * 60 * 60)); + } + echo "</tr>\n"; + } + + ?> + </table> + </td> + </tr> + </table> + </td> + </tr> +</table> +</td> + <td width="20"><img src="images/spacer.gif" width="20" height="1" alt=""></td> + <td width="160" valign="top"><?php include('./sidebar.php'); ?><center> + <?php echo "<font class=\"V9\"><br>$powered_by_lang <a class=\"psf\" href=\"http://sourceforge.net/projects/phpicalendar/\">PHP iCalendar $version_lang</a></font>"; ?></center></td> + </tr> +</table> +</center> +</body> +</html> + |