require( "calendar-functions.php"); $config = new config; $database = new database; if (ereg( "MSIE ([0-9]+)",$_SERVER['HTTP_USER_AGENT'],$version)) { $ver=(int)$version[1]; } if (ereg( "Mozilla.([0-9]+)",$_SERVER['HTTP_USER_AGENT'],$version)) { $ver=(int)$version[1]; } if (empty($year)) $year=date("Y"); if (empty($month)) $month=date("m"); commonHeader( "Calendar for $month/$year"); ?> /* Reset some variables */ $date=28; $day=01; $off=0; /* Figure out how many days are in this month */ while (checkdate($month,$date,$year)): $date++; endwhile; /* Figure out what month it is, convert the number to words, and then create a table with days of the week headers */ echo "
Sunday | \n"; echo "Monday | \n"; echo "Tuesday | \n"; echo "Wednesday | \n"; echo "Thursday | \n"; echo "Friday | \n"; echo "Saturday | \n
---|---|---|---|---|---|---|
\n"; $off++; } if ($ver >= 4 ) { echo " | $day \n"; $sql = "SELECT Event,Event_ID from SkihouseContents WHERE Month='$month' AND Day='$day' and Year='$year' ORDER BY Start_Period,Start_Time"; $database->setQuery($sql); $row = $database->loadObjectList(); for($i = 0;$i \n"; $Ev=""; $EID=""; } echo " | \n";
} else {
echo "\n$day \n"; $sql = "SELECT Event,Event_ID from SkihouseContents WHERE Month='$month' AND Day='$day' and Year='$year' ORDER BY Start_Period,Start_Time"; $database->setQuery($sql); $row = $database->loadObjectList(); for($i = 0;$i \n"; $Ev=""; $EID=""; } echo " | \n";
}
/* Increment the day and the cells to go before the end of the row and end the
row when appropriate */
$day++;
$off++;
if ($off>7) {
echo "||||