diff -u -r karmapools.orig/view.pool.php karmapools/view.pool.php --- karmapools.orig/view.pool.php 2004-09-11 11:48:21.996697000 -0500 +++ karmapools/view.pool.php 2004-09-11 12:56:25.683882584 -0500 @@ -26,6 +26,22 @@ $cur_date = date('Y-m-d 01:00:00'); $cur_ts = strtotime($cur_date); $pool_desc = stripslashes($info_ar['pool_desc']); + +$first_day = date('l',$start_ts); +$first_mon = date('F',$start_ts); +$first_year = date('Y',$start_ts); +$last_year = $first_year; +$last_month = $first_mon; +$day_header = array("Monday","Tuesday","Wednesday","Thursday","Friday", + "Saturday","Sunday"); +// fix the calendar so that Monday is the first day +$pad_cells = 0; +for($j=0; $j < count($day_header); $j++) { + if ("$day_header[$j]" == "$first_day") { + $pad_cells = $j; + break; + } + } pageHeader(true,$title); tableOpen(true,array('width'=>'100%')); ?> @@ -41,19 +57,26 @@ "; +$html .= ""; +$html .= "$first_mon $first_year\n"; +$html .= "\n"; +foreach($day_header as $day) { + $html.= " $day\n"; + } +$html .= "\n"; +if ($pad_cells > 0) { + $td = " N/A\n"; + $html .= "\n"; + $html .= str_repeat($td,$pad_cells); + $col_ctr = $pad_cells; } +echo $html; -$col_ctr = 0; for($j=$start_ts; $j <= $end_ts; $j += (60*60*24)) { $col_ctr++; $cur_year = date('Y',$j);