\n";
global $previous_month;
global $this_month;
global $next_month;
$previous_month = getDate(mktime(0, 0, 0, $month - 1, 1, $year));
$this_month = getDate(mktime(0, 0, 0, $month, 1, $year));
$next_month = getDate(mktime(0, 0, 0, $month + 1, 1, $year));
$first_week_day = $this_month["wday"];
$days_in_this_month = round(($next_month[0] - $this_month[0]) / (60 * 60 * 24));
$schedule_html .= "\n";
$schedule_html .= "" .
"< | \n";
$schedule_html .= "" .
"" . $month_name . " " . $year . " | \n";
$schedule_html .= "" .
"> | \n";
$schedule_html .= "\n";
//Fill the first week of the month with the appropriate number of blanks.
for($week_day = 0; $week_day < $first_week_day; $week_day++)
{
$schedule_html .= " | ";
}
$week_day = $first_week_day;
for($day_counter = 1; $day_counter <= $days_in_this_month; $day_counter++)
{
$week_day %= 7;
if($week_day == 0)
$schedule_html .= " \n";
//Do something different for the current day.
if($day == $day_counter)
$schedule_html .= "" . $day_counter . " | \n";
else
$schedule_html .= " " .
"" .
$day_counter . " | \n";
$week_day++;
}
$schedule_html .= " \n";
$schedule_html .= " \n";
$schedule_html .= "
\n";
//Login.
global $isLogged;
$schedule_html .= "\n";
$schedule_html .= " | \n";
$schedule_html .= "\n";
if($isLogged == true)
{
$schedule_html .= "\n";
$schedule_html .= " |
\n";
$schedule_html .= "