0){ $m=$prm+$chm; }else{ $m= date("m"); } $no_of_days = date('t',mktime(0,0,0,$m,1,$y)); // This is to calculate number of days in a month $mn=date('F',mktime(0,0,0,$m,1,$y)); // Month is calculated to display at the top of the calendar $mql = date('m',mktime(0,0,0,$m,1,$y)); $yn=date('Y',mktime(0,0,0,$m,1,$y)); // Year is calculated to display at the top of the calendar $j= date('w',mktime(0,0,0,$m,1,$y)); // This will calculate the week day of the first day of the month for($k=1; $k<=$j; $k++){ // Adjustment of date starting $adj .="
« $mn $yn »\n
\n | \n
\n
||||||
Sunday | \nMonday | \nTuesday | \nWednesday | \nThursday | \nFriday | \nSaturday | \n
$i "; // This will display the date inside the calendar cell
if ($date_data[$i][2] == 1) {
// Enter the "Closed" Text
$calendar .= "Closed";
} elseif ($date_data[$i][0] == "") {
// No data for this day; leave blank
$calendar .= ""; } else { $listing = str_replace(" am", "am", $date_data[$i][0]); $listing = str_replace(" pm", "pm", $listing); $listing2 = str_replace(" am", "am", $date_data[$i][1]); $listing2 = str_replace(" pm", "pm", $listing2); // Make sure there's a listing for this day (actually, just a closing hour) if ($listing2 != "") { $calendar.= $listing . " - " . $listing2; // Library's open } } $calendar.= " | \n";
$adj="";
$j++;
if($j==7){$calendar.= "||||||
"; print_r($date_data); print ""; */ ?>