END; if($month < 12){ $month = $month + 1; $year = $year; } elseif($month == 12){ $month = 1; $year = $year + 1; } $i++; } print <<
My Reservations | My Account | Change Password | Sign Out END; } else { print <<Sign In END; } print <<

$Semester Semester - $Title Reservation

END; list ($semester, $syear) = split (' ', $Semester); $query = "SELECT StartDate, EndDate, Memo from SR_semester WHERE Year = '$syear' AND Semester = '$semester'"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); $row = mysql_fetch_row($result); $startdate = $row[0]; $enddate = $row[1]; list ($startyear, $startmonth, $startday) = split ('-', $startdate); list ($endyear, $endmonth, $endday) = split ('-', $enddate); print <<Open from $startmonth/$startday/$startyear to $endmonth/$endday/$endyear

$row[2] END; $openwd = array ('0' => 0, '1' => 0, '2' => 0, '3' => 0, '4' => 0, '5' => 0, '6' => 0); $query = "SELECT Weekday, OpenTime, CloseTime from SR_opentime WHERE Year = '$syear' AND Semester = '$semester' and OpenTime <> '00:00:00' order by Weekday"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); $row = mysql_fetch_row($result); $wday1 = $row[0]; $openwd[$wday1] = 1; list ($openhour, $openminute, $opensec) = split (':', $row[1]); list ($closehour, $closeminute, $closesec) = split (':', $row[2]); static $day_headings = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'); static $shortweekday = array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); while ($row = mysql_fetch_row($result)){$wday2 = $row[0]; $openwd[$wday2] = 1;} print <<Change room selection =>
$description"; ?>
END; $j = 0; while ($j < $weekday) { $j++; print << END; } $firstday = mktime (0,0,0, $startmonth, $startday, $startyear); $lastday = mktime (0,0,0, $endmonth, $endday, $endyear); $today = mktime (0,0,0, date("m"), date("d"), date("Y")); $tdy = date("d")+0; if ($semester == "Fall" or $Semester == "Spring") {$twoweeks = mktime (0,0,0, $startmonth, $startday+14, $startyear);} else {$twoweeks = $firstday;} $p4dayslater = mktime (0,0,0, date("m"), date("d")+4, date("Y")); $p18dayslater = mktime (0,0,0, date("m"), date("d")+18, date("Y")); $r = 0; // must creste 6 rows for a month $day = 1; while ($day <= $maxdays) { $day_of_month = mktime (0,0,0, $month, $day, $year); $date_info = getdate($day_of_month); $weekday = $date_info['wday']; if ($day_of_month == $today) {//1 print <<$day END; }//1 else if ($day_of_month < $twoweeks or $day_of_month > $lastday) {//1 print <<$day END; }//1 else if ($day_of_month > $p18dayslater and $Tag == '0') {//1 print <<$day END; }//1 else if ($day_of_month < $p4dayslater) {//1 print <<$day END; }//1 else if ($openwd[$weekday]== 0) {//1 print <<$day END; }//1 else {//1 $thisdate = sprintf ("%d-%02d-%02d", $year, $month, $day); $query = "SELECT CloseDate from SR_closedate WHERE CloseDate = '$thisdate'"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); if (mysql_num_rows($result) >= 1) {//2 print <<$day END; }//2 else {//2 print <<$day END; }//2 }//1 if ($weekday == 6 and $day < $maxdays) { print << END; $r++; // } $day++; } $j = 0; while ($j < 6-$weekday) { $j++; print << END; } while ($r < 5) // if less than 5 rows, add blank rows { print << END; $r++; } print <<
$monthtext $year
S M T W T F S
 

Legend: 13 - Not Available $tdy - Today 23 - Available

END; if ($Tag == '1') { print << END; } if ($L=='1') { print <<review/modify/cancel my reservations. END; } else { print <<For Oral Assessment/Pairing, please click here. END; } else if ($Room == 'LLC263' and $Tag == '1') { print <<For regular reservation, please click here. END; } print <<
END; if ($Date <> '') { list ($selectyear, $selectmonth, $selectday) = split ('-', $Date); $selectdate = mktime (0,0,0, $selectmonth, $selectday, $selectyear); $date_info = getdate($selectdate); $weekday = $date_info['wday']; $query = "SELECT OpenTime, CloseTime from SR_opentime WHERE Year = '$syear' AND Semester = '$semester' and Weekday = '$weekday'"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); $row = mysql_fetch_row($result); list ($openhour, $openminute, $opensec) = split (':', $row[0]); list ($closehour, $closeminute, $closesec) = split (':', $row[1]); print << $selectmonth/$selectday $day_headings[$weekday] END; for ($i=(integer)$openhour; $i<=$closehour; $i++) { print <<$i END; } //if ($closeminute=='30') //{ //print <<  //END; //} print << Open time: $openhour:$openminute - $closehour:$closeminute END; //if ($openminute=='30') //{ //print <<  //END; //} (integer)$j=($closehour-$openhour)*12 + ($closeminute - $openminute)/5; for ($i=0;$i<$j;$i++) { $timeslot[$i] = '0'; } $query = "SELECT StartTime, EndTime, Status from SR_reservation WHERE RoomNo = '$Room' and Date = '$Date' and (Status='1' or Status='2')"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); while ($row = mysql_fetch_row($result)) { // print "$row[0],$row[1],$row[2],"; list ($starthour, $startminute, $startsec) = split (':', $row[0]); list ($endhour, $endminute, $endsec) = split (':', $row[1]); if ($starthour>$openhour or ($starthour=$openhour and $startminute>=$openminute)) { (integer)$m=($starthour-$openhour)*12 + ($startminute - $openminute)/5; (integer)$n=($endhour-$starthour)*12 + ($endminute - $startminute)/5; } else { $m=0; (integer)$n=($endhour-$openhour)*12 + ($endminute - $openminute)/5; } // print "$m,$n"; for ($i=$m;$i<$m+$n;$i++) { $timeslot[$i] = $row[2]; } } /* for ($i=0;$i<$j;$i++) { print $timeslot[$i]; } */ if ($openminute=='30') { print <<            END; } for ($i=0;$i<$j;$i++) { if ($timeslot[$i] == '1' or $timeslot[$i] == '2') { print <<  END; } else { print <<  END; } } print <<
  Avaliable   Reserved
END; if ($L=='1') { $query = "SELECT ClassID, CourseID, Days, BeginTime, EndTime from SR_course WHERE InstructorID = '$ID' and Year = '$syear' and Semester='$semester'"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); $n_rows = mysql_num_rows($result); if ($n_rows==0) { print <<

Sorry, you do not have any active classes in this semester.

END; } else { print <<
Selected Date:
Start Time:
End Time:
Course Number:
Number of Students:
I will use: END; $query = "SELECT Task from SR_task WHERE RoomNo = '$Room' and Status='1' order by Place"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); $n_rows = mysql_num_rows($result); $i = 0; while ($row = mysql_fetch_row($result) and $i<=$n_rows) { $i++; if (($row[0]=='Oral Assessment' or $row[0]=='Random Pairing' or $row[0]=='Telephoning') and $Tag=='1') { print <<$row[0]
END; } else { print <<$row[0]
END; } }//while print <<
Brief Lesson Plan:
END; } } } else { $query = "SELECT Title, Date, StartTime, SR_reservation.EndTime, CourseID, FirstName, LastName, SR_reservation.ClassID, SR_reservation.RoomNo, Home, Cell, Extension, Email, SR_reservation.StudentNum, Tasks, SpecialNeeds, CourseTitle, Days, SR_course.BeginTime, SR_course.EndTime, SR_reservation.InstructorID, SR_reservation.Memo from SR_reservation, SR_instructor, SR_course, SR_room WHERE Date >= '$startdate' and Date <= '$enddate' and "; $query .= "SR_reservation.InstructorID='$ID' AND "; $query .= "SR_reservation.RoomNo='$Room' and "; $query .= "(SR_reservation.Status='1' or SR_reservation.Status='2') and SR_reservation.RoomNo=SR_room.RoomNo and SR_reservation.ClassID=SR_course.ClassID and SR_reservation.InstructorID=SR_instructor.InstructorID order by Date, StartTime"; $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); $total = mysql_num_rows($result); print <<$Semester Reservation List: $total

END; while ($row = mysql_fetch_row($result)) { list ($year, $month, $day) = split ('-', $row[1]); list ($sh, $sm, $ss) = split (':', $row[2]); list ($eh, $em, $es) = split (':', $row[3]); $HTMLtasks = str_replace("\n","
",$row[14]); $HTMLneeds = str_replace("\n","
",$row[15]); $HTMLmemo = str_replace("\n","
",$row[21]); print << END; if ( mktime(0,0,0, $month, $day, $year) > $today) { print << END; } print <<
END; } } ?>
Date:
$month/$day/$year
Room:
$row[0] - $row[8]
Start:
$sh:$sm
End:
$eh:$em
Class:
$row[7] - $row[4] -- $row[16]   $row[17]   From $row[18] to $row[19]
Instructor:
$row[5] $row[6]
Number of Students:
$row[13]
Mt. SAC Email:
$row[12]
Extension:
$row[11]
Home Phone:
$row[9]
Cell Phone:
$row[10]
Tasks:
$HTMLtasks
Brief Lesson Plan:
$HTMLneeds
Memo:
$HTMLmemo
Cancel this reservation Edit this reservation


dired link