diff --git a/inc/class.schedule.php b/inc/class.schedule.php --- a/inc/class.schedule.php +++ b/inc/class.schedule.php @@ -297,6 +297,25 @@ class Schedule if($this->nPermutations > 0) { + /* + * Figure out if we have to deal with Saturday and then deal + * with it. + */ + $max_day_plusone = 5; + $have_saturday = FALSE; + foreach ($this->courses as $course) + { + for ($si = 0; $si < $course->getnsections(); $si ++) + foreach ($course->getSection($si)->getMeetings() as $meeting) + if ($meeting->getDay(5)) + { + $max_day_plusone = 6; + $have_saturday = TRUE; + break; + } + if ($have_saturday) + break; + } echo '

Enter these codes into your school\'s online course registration system to register for classes:

'; echo '
' . "\n" . @@ -348,18 +367,21 @@ class Schedule . " Tuesday\n" . " Wednesday\n" . " Thursday\n" - . " Friday\n" - . " \n"; + . " Friday\n"; + if ($have_saturday) + echo " Saturday\n"; + echo " \n"; $last_meeting = array(); - $rowspan = array(0, 0, 0, 0, 0); + $rowspan = array(0, 0, 0, 0, 0, 0); for($r = 0; $r < (count($time)-1); $r++) { echo " \n" . " " . $this->prettyTime($time[$r]) . "\n"; - for($dayLoop = 0; $dayLoop < 5; $dayLoop++) + /* currently, 0-5 = monday-saturday */ + for($dayLoop = 0; $dayLoop < $max_day_plusone; $dayLoop++) { /* Makes sure there is not a class already in progress */ if($rowspan[$dayLoop] <= 0)