='".$year."-".$month."-1' and meetingdate<='".$year."-".$month."-".$lastdayofcurrentmonth."') and reschedule='0000-00-00' and canceled != 1) "; $sqlParam2 = " UNION "; $sqlParam3 = "(select reschedule as meetingdate from meetings where (reschedule>='".$year."-".$month."-1' and reschedule<='".$year."-".$month."-".$lastdayofcurrentmonth."') and canceled != 1) "; $sqlParam4 = " order by meetingdate desc"; $sql = $sqlParam1.$sqlParam2.$sqlParam3.$sqlParam4; $db = mysql_connect('localhost', 'dsrsdc', '53Dstrct'); mysql_select_db("dsrsdc",$db); $result = mysql_query($sql); while ($myrow = mysql_fetch_array($result)){ $aux = explode ("-", $myrow['meetingdate']); $tmpDay = date('j',mktime(0,0,0,$aux[1],$aux[2],$aux[0])); if ($tmpDay == $day){ $days[$tmpDay]=array('calpop.php?year='.$year.'&month='.$month.'&day='.$tmpDay.'&border='.$border,'linked-day-sel'); }else{ $days[$tmpDay]=array('calpop.php?year='.$year.'&month='.$month.'&day='.$tmpDay.'&border='.$border,'linked-day'); } //echo $tmpDay.'
'; } #echo 'CurMonth'.$curmonth.'
'; #echo 'PreMonth'.datediff("m",$prevmonth,$curmonth,true).'
'; #echo 'NxtMonth'.datediff("m",$curmonth,$nextmonth,true).'
'; if (datediff("m",$prevmonth,$curmonth,true) > 8){ $pn = array(''=>'', '»'=>'calpop.php?year='.date('Y', $nextmonth).'&month='.date('n', $nextmonth).'&day=0&border='.$border); }elseif (datediff("m",$curmonth,$nextmonth,true) > 2){ $pn = array('«'=>'calpop.php?year='.date('Y', $prevmonth).'&month='.date('n', $prevmonth).'&day=0&border='.$border, ''=>''); }else{ $pn = array('«'=>'calpop.php?year='.date('Y', $prevmonth).'&month='.date('n', $prevmonth).'&day=0&border='.$border, '»'=>'calpop.php?year='.date('Y', $nextmonth).'&month='.date('n', $nextmonth).'&day=0&border='.$border); } function generate_calendar($selDay, $year, $month, $days = array(), $day_name_length = 3, $month_href = NULL, $first_day = 0, $pn = array()){ $first_of_month = gmmktime(0,0,0,$month,1,$year); #remember that mktime will automatically correct if invalid dates are entered # for instance, mktime(0,0,0,12,32,1997) will be the date for Jan 1, 1998 # this provides a built in "rounding" feature to generate_calendar() $day_names = array(); #generate all the day names according to the current locale for($n=0,$t=(3+$first_day)*86400; $n<7; $n++,$t+=86400) #January 4, 1970 was a Sunday $day_names[$n] = ucfirst(gmstrftime('%A',$t)); #%A means full textual day name list($month, $year, $month_name, $weekday) = explode(',',gmstrftime('%m,%Y,%B,%w',$first_of_month)); $weekday = ($weekday + 7 - $first_day) % 7; #adjust for $first_day $title = htmlentities(ucfirst($month_name)).' '.$year; #note that some locales don't capitalize month and day names #Begin calendar. Uses a real . See http://diveintomark.org/archives/2002/07/03 @list($p, $pl) = each($pn); @list($n, $nl) = each($pn); #previous and next links, if applicable if($p) $p = ''.($pl ? ''.$p.'' : $p).' '; if($n) $n = ' '.($nl ? ''.$n.'' : $n).''; $calendar = ''."\n". '\n"; if($day_name_length){ #if the day names should be shown ($day_name_length > 0) #if day_name_length is >3, the full name of the day will be printed foreach($day_names as $d) $calendar .= ''; $calendar .= "\n"; } if($weekday > 0) $calendar .= ''; #initial 'empty' days for($day=1,$days_in_month=gmdate('t',$first_of_month); $day<=$days_in_month; $day++,$weekday++){ if($weekday == 7){ $weekday = 0; #start a new week $calendar .= "\n"; } if(isset($days[$day]) and is_array($days[$day])){ @list($link, $classes, $content) = $days[$day]; if(is_null($content)) $content = $day; if ($classes == "linked-day"){ $calendar .= '' : '>'). ($link ? ''.$content.'' : $content).''; }else{ $calendar .= '' : '>'). ($link ? ''.$content.'' : $content).''; } } else $calendar .= ""; } if($weekday != 7) $calendar .= ''; #remaining "empty" days return $calendar."\n
'.$p.($month_href ? ''.$title.'' : $title).$n."
'.htmlentities($day_name_length < 4 ? substr($d,0,$day_name_length) : $d).'
 
$day 
\n"; } function dispMeetings($year, $month, $day){ if ($day!=0){ $sqlParam1 = "(select meetingscategories.id as id2, meetingscategories.bgcolor, meetingscategories.title as title, agenda, agency, location, meetingdate from meetings INNER JOIN meetingscategories on meetings.category = meetingscategories.id where meetingdate='".$year."-".$month."-".$day."' and reschedule='0000-00-00' and canceled != 1) "; $sqlParam2 = " UNION "; $sqlParam3 = "(select meetingscategories.id as id2, meetingscategories.bgcolor, meetingscategories.title as title, agenda, agency, location, reschedule as meetingdate from meetings INNER JOIN meetingscategories on meetings.category = meetingscategories.id where reschedule='".$year."-".$month."-".$day."' and canceled != 1) "; $sqlParam4 = " order by title asc"; $sql = $sqlParam1.$sqlParam2.$sqlParam3.$sqlParam4; //$sql = $sqlParam1; //echo $sql.'
'; $db = mysql_connect('localhost', 'dsrsdc', '53Dstrct'); mysql_select_db("dsrsdc",$db); $result = mysql_query($sql); $number = mysql_numrows($result); if ($number > 0){ print ' '; while ($myrow = mysql_fetch_array($result)){ $category = $myrow["title"]; $id2 = $myrow["id2"]; if($id2 == "18"){ $category = "† Board Meeting"; } $agenda = $myrow["agenda"]; $location = $myrow["location"]; $bgcolor = $myrow["bgcolor"]; $agency = $myrow["agency"]; print ''; if(strlen($agency) > 1 && !(is_null($agency)) && $agency!= "null"){ print ''; } else{ print ''; } if (strlen($agenda) > 1){ print ' '; }else{ print ' '; } if (strlen($location) > 1){ print ' '; }else{ print ' '; } print ' '; } } print '
'.date("F j, Y", mktime(0, 0, 0, $month, $day, $year)).' Meetings
'.$agency.''.$category.'  Minutes   
'; } } function dispLastBar($day){ print '
- Roll over dates with boxes to view
meeting(s) or event(s) scheduled
on that date.
- Click on the boxed date to access
agendas and minutes
- †  Indicates DSRSD Financing
Authority or Corp. Meeting.
 
'; } function blackBorderCSS($border){ if ($border>0){ print ' .caltable {border: '.$border.'px black solid;}'; } } function datediff($interval, $datefrom, $dateto, $using_timestamps = false) { /* $interval can be: yyyy - Number of full years q - Number of full quarters m - Number of full months y - Difference between day numbers (eg 1st Jan 2004 is "1", the first day. 2nd Feb 2003 is "33". The datediff is "-32".) d - Number of full days w - Number of full weekdays ww - Number of full weeks h - Number of full hours n - Number of full minutes s - Number of full seconds (default) */ if (!$using_timestamps) { $datefrom = strtotime($datefrom, 0); $dateto = strtotime($dateto, 0); } $difference = $dateto - $datefrom; // Difference in seconds switch($interval) { case 'yyyy': // Number of full years $years_difference = floor($difference / 31536000); if (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom), date("j", $datefrom), date("Y", $datefrom)+$years_difference) > $dateto) { $years_difference--; } if (mktime(date("H", $dateto), date("i", $dateto), date("s", $dateto), date("n", $dateto), date("j", $dateto), date("Y", $dateto)-($years_difference+1)) > $datefrom) { $years_difference++; } $datediff = $years_difference; break; case "q": // Number of full quarters $quarters_difference = floor($difference / 8035200); while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($quarters_difference*3), date("j", $dateto), date("Y", $datefrom)) < $dateto) { $months_difference++; } $quarters_difference--; $datediff = $quarters_difference; break; case "m": // Number of full months $months_difference = floor($difference / 2678400); while (mktime(date("H", $datefrom), date("i", $datefrom), date("s", $datefrom), date("n", $datefrom)+($months_difference), date("j", $dateto), date("Y", $datefrom)) < $dateto) { $months_difference++; } $months_difference--; $datediff = $months_difference; break; case 'y': // Difference between day numbers $datediff = date("z", $dateto) - date("z", $datefrom); break; case "d": // Number of full days $datediff = floor($difference / 86400); break; case "w": // Number of full weekdays $days_difference = floor($difference / 86400); $weeks_difference = floor($days_difference / 7); // Complete weeks $first_day = date("w", $datefrom); $days_remainder = floor($days_difference % 7); $odd_days = $first_day + $days_remainder; // Do we have a Saturday or Sunday in the remainder? if ($odd_days > 7) { // Sunday $days_remainder--; } if ($odd_days > 6) { // Saturday $days_remainder--; } $datediff = ($weeks_difference * 5) + $days_remainder; break; case "ww": // Number of full weeks $datediff = floor($difference / 604800); break; case "h": // Number of full hours $datediff = floor($difference / 3600); break; case "n": // Number of full minutes $datediff = floor($difference / 60); break; default: // Number of full seconds (default) $datediff = $difference; break; } return $datediff; } ?>