Please select the month and year you want the schedule for.

Select Year: Month:

'31', '02' => '28', '03' => '31', '04' => '30', '05' => '31', '06' => '30', '07' => '31', '08' => '31', '09' => '30', '10' => '31', '11' => '30', '12' => '31' ); mysql_pconnect("www.acf.bnl.gov","oncall","mtdiawot") or die("Unable to connect to SQL server"); mysql_select_db("rcf") or die("Unable to select database"); # Ognian assumes start time and end time is on same day and splits date and time $query = sprintf("select t1.day as day,t1.startt as stime,t1.endt as etime, t2.name as name,t2.officeno as office,t2.beeperno as pager,t2.homeno as hphone from testschedule as t1, monitor_staff as t2 where t1.personid = t2.personid and t1.day like '%d-%02d-%%' order by t1.day, t1.startt",$p_year,$p_month); $results = mysql_query($query) or die("DB select failed"); while ($record = mysql_fetch_array($results)) { $n = sscanf($record['day'],"%4d-%2d-%2d",&$s_year, &$s_month,&$s_day); $n = sscanf($record['stime'],"%2d:%2d:%s",&$s_hour,&$s_min,&$s_rest); $rdow = `date -d "$s_day $month[$s_month] $s_year" +%w`; $dow = rtrim($rdow); $d_index = sprintf("%02d-%d-%02d:%02d",$s_day,$dow,$s_hour,$s_min); $n = sscanf($record['etime'],"%2d:%2d:%s",&$e_hour,&$e_min,&$e_rest); # Break up name if (preg_match("/PHENIX/",$record['name'])) { $first_name = 'Oncall'; $lname = 'PHENIX'; } elseif (preg_match("/STAR/",$record['name'])) { $first_name = 'Oncall'; $lname = 'STAR'; } elseif (preg_match("/None/",$record['name'])) { $first_name = 'Oncall'; $lname = 'None'; } else { $words = explode(" ",$record['name']); $first_name = $words[0]; $lname = end($words); } $shifts[$d_index] = sprintf("%02d:%02d-%02d:%02d %s", $s_hour,$s_min,$e_hour,$e_min, $lname); if (empty($fnames[$record['name']])) { $fnames[$record['name']] = $first_name; $offices[$record['name']] = $record['office']; $pagers[$record['name']] = $record['pager']; $hphones[$record['name']] = $record['hphone']; } } ksort($shifts); ksort($fnames); # values for next and prev if ($p_month == 1) { $nx_year = $p_year; $nx_month = 2; $pr_year = $p_year - 1; $pr_month = 12; } elseif ($p_month == 12) { $nx_year = $p_year + 1; $nx_month = 1; $pr_year = $p_year; $pr_month = 11; } else { $nx_year = $p_year; $nx_month = $p_month + 1; $pr_year = $p_year; $pr_month = $p_month - 1; } ?>

Prev   Next
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
  $value) { $n = sscanf($key,"%02d-%d-%02d:%02d",&$d_day,&$d_dow,&$d_hour,&$d_min); if ($d_day > $dom) { # nothing on this day so end put blank entries until get to $d_day while ($dom < $d_day) { ?>

$value) { ?>
Name Extension Pager Number