. */ include_once 'inc' . DIRECTORY_SEPARATOR . 'class.schedule.php'; include_once 'inc' . DIRECTORY_SEPARATOR . 'class.course.inc'; include_once 'inc' . DIRECTORY_SEPARATOR . 'class.section.php'; include_once 'inc' . DIRECTORY_SEPARATOR . 'class.page.php'; require_once('inc' . DIRECTORY_SEPARATOR . 'schedule_store.inc'); $scripts = array('jQuery', 'jQueryUI', 'jValidate','qTip','schedInput'); $inputPage = page::page_create('Scheduler', $scripts, FALSE); $schedule_store = FALSE; $sch = FALSE; $school = $inputPage->get_school(); if (isset($_REQUEST['s'])) { $schedule_store = schedule_store_init(); $schedule_id = (int)$_REQUEST['s']; $sch = schedule_store_retrieve($schedule_store, $schedule_id); } $my_hc = 'var slate_permutate_example_course_id = \'' . str_replace('\'', '\\\'', school_example_course_id($inputPage->get_school())) . '\'; jQuery(document).ready( function() { var class_last = 0; '; if ($sch) { $nclasses = $sch->nclasses_get(); for ($class_key = 0; $class_key < $nclasses; $class_key ++) { $my_hc .= input_class_js($sch->class_get($class_key), ' '); } } else { $default_courses = school_default_courses($school); foreach ($default_courses as $default_class) $my_hc .= input_class_js($default_class, ' '); $my_hc .= ' class_last = add_class(); '; } if ($qtips_always || !isset($_SESSION['saw_qtips'])) { $my_hc .= ' addTips();' . PHP_EOL; $_SESSION['saw_qtips'] = TRUE; } $my_hc .= ' }); '; $inputPage->headcode_add('scheduleInput', $inputPage->script_wrap($my_hc), TRUE); $inputPage->head(); /* * Force a student to choose a school or declare he's a generic * student before displaying the input form. To do this, we need * another variable in $_SESSION: $_SESSION['school_chosen']. */ if ($school && (!empty($_REQUEST['school']) || $school['id'] != 'default')) $_SESSION['school_chosen'] = TRUE; if (!empty($_REQUEST['selectschool']) || $school['id'] == 'default' && !isset($_SESSION['school_chosen'])) { $next_page = 'input.php'; if (isset($_GET['s'])) $next_page .= '?s=' . (int)$_GET['s']; ?>
Choose the school you attend from the list below. If you cannot find your school, you may proceed using the generic settings.
showSchools($next_page); $inputPage->foot(); exit; } if (!empty($_REQUEST['selectsemester'])) { ?>Choose the semester for which you wish you make a schedule from the list below. If any semester is missing, please let us know.
showSemesters(); $inputPage->foot(); exit; } $inputPage->showSavedScheds($_SESSION); ?>Welcome to SlatePermutateaddressStudent(', ', '', FALSE); ?>! get_school())): ?> To get started, enter in some a course identifier (e.g., get_school()); ?>) and click the autosuggestion to automatically load available sections for each class. To get started, enter a course number and add some sections to it. Then specify each section's letter/number and what times it meets, add more courses, and click “Find a Schedule”.
Advanced */ ?> showSchoolInstructions(); $inputPage->foot(); function input_class_js(Course $class, $whitespace = ' ') { $js = $whitespace . 'class_last = add_class_n(\'' . htmlentities($class->getName(), ENT_QUOTES) . "');\n"; $nsections = $class->getnsections(); for ($section_key = $nsections - 1; $section_key >= 0; $section_key --) { $section = $class->getSection($section_key); $meetings = $section->getMeetings(); foreach ($meetings as $meeting) { $js .= $whitespace . 'add_section_n(class_last, \'' . htmlentities($section->getLetter(), ENT_QUOTES) . '\', \'' . htmlentities($section->getSynonym(), ENT_QUOTES) . '\', \'' . $meeting->getStartTime() . '\', \'' . $meeting->getEndTime() . '\', ' . json_encode(array('m' => $meeting->getDay(0), 't' => $meeting->getDay(1), 'w' => $meeting->getDay(2), 'h' => $meeting->getDay(3), 'f' => $meeting->getDay(4), 's' => $meeting->getDay(5))) . ', \'' . htmlentities($section->getProf(), ENT_QUOTES) . '\', \'' . htmlentities($meeting->getLocation(), ENT_QUOTES) . '\',\'' . htmlentities($meeting->type_get(), ENT_QUOTES) . "');\n"; } } return $js; }