/* This calendar is not very pretty as-is, but it is functional and fast.
Formatting to suit your needs should be fairly simple.
The latest version of this calendar is formatted much more niceley. It
also includes a full-featured "Community Calendar" which is linked to a
MySQL database for reporting upcoming events.
/* Set some variables */
$date=01;
$day=01;
$off=0;
/* The month and year variables can (should) be passed from a preceding
web page rather than hard coded */
$month = '05';
$year = '1999';
/* Figure out how many days are in this month */
while (checkdate($month,$date,$year)):
$date++;
endwhile;
/* Create a table with days of the week headers */
echo "
";
echo "
Sunday
";
echo "
Monday
";
echo "
Tuesday
";
echo "
Wednesday
";
echo "
Thursday
";
echo "
Friday
";
echo "
Saturday
";
/* Start the table data and make sure the number of days does not exceed
the total for the month - $date will always be one more than the total
number of days in the momth */
echo "
";
while ($day<$date):
/* Figure what day of the week the first falls on and set the number of
preceding and trailing cells accordingly */
if ($day == '01' and date('l', mktime(0,0,0,$month,$day,$year)) == 'Sunday') {
echo "
0 komentar:
Posting Komentar