diff options
author | Chad Little <clittle@users.sourceforge.net> | 2002-09-18 00:34:07 +0000 |
---|---|---|
committer | Chad Little <clittle@users.sourceforge.net> | 2002-09-18 00:34:07 +0000 |
commit | e63fd2840f0cf719fa872273d95470f1342b8558 (patch) | |
tree | 666892116021334e624e07ab5f4630f2552de850 /week.php | |
parent | 9525ea3700597fd2366ca4ad426925ab14674cb0 (diff) | |
download | phpicalendar-e63fd2840f0cf719fa872273d95470f1342b8558.tar.gz phpicalendar-e63fd2840f0cf719fa872273d95470f1342b8558.tar.bz2 phpicalendar-e63fd2840f0cf719fa872273d95470f1342b8558.zip |
0.3 release
Diffstat (limited to 'week.php')
-rw-r--r-- | week.php | 164 |
1 files changed, 36 insertions, 128 deletions
@@ -195,10 +195,10 @@ $prev_week = date("Ymd", $prev_week2); <? $event_length = 0; + $k = 0; foreach ($day_array as $key) { - $thisdate = strtotime ("$sunday"); - $thisday = date("Ymd", $thisdate); + $count = 0; $k = 0; $cal_time = $key; $key = strtotime ("$key"); @@ -209,144 +209,52 @@ $prev_week = date("Ymd", $prev_week2); 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"; - - // Sunday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Monday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Tuesday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Wednesday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Thursday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Friday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Saturday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); + $thisdate = strtotime ("$sunday"); $thisday = date("Ymd", $thisdate); + do { + if ($master_array["$thisday"]["$cal_time"]) { + $event_text = $master_array["$thisday"]["$cal_time"][$k]["event_text"]; + 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=\"day.php?getdate=$thisday\">$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) - $thisdate = strtotime ("$sunday"); - $thisday = date("Ymd", $thisdate); + 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"; - - // Sunday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Monday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Tuesday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Wednesday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Thursday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Friday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); - $thisday = date("Ymd", $thisdate); - - // Saturday - if ($master_array[("$thisday")]["$cal_time"]) { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> <a class=\"psf\" href=\"day.php?getdate=$thisday\">Event</a></td>\n"; - } else { - echo "<td colspan=\"2\" bgcolor=\"#ffffff\"> </td>\n"; - } - $thisdate = ($thisdate + (25 * 60 * 60)); + $thisdate = strtotime ("$sunday"); $thisday = date("Ymd", $thisdate); + do { + if ($master_array["$thisday"]["$cal_time"]) { + $event_text = $master_array["$thisday"]["$cal_time"][$k]["event_text"]; + 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=\"day.php?getdate=$thisday\">$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"; } |