コード例 #1
0
ファイル: accommodations.php プロジェクト: hughnguy/php
 $poccount = $profile->countUnlockedPOC($_GET['student_num']);
 $current_semester = \Ventus\Utilities\Functions::fetchSemester();
 $current_semester = $current_semester['now_short'];
 $current_courses = $courses->fetchAllStudentCoursesForSemester($_GET['student_num'], $current_semester);
 //Get a list of all courses for this students and verify whether they belong in the past, present or future
 $student_courses = $courses->fetchAllStudentCourses($_GET['student_num']);
 foreach ($student_courses as $key => $sc) {
     $student_courses[$key]['session_status'] = $model->fetchSessionStatus($sc['session']);
     //If we are dealing with past courses, and if the student didn't exception for a past course,
     //it doesnt need to show up in this list
     if ($student_courses[$key]['session_status'] === -1 && !$model->checkIfExceptionExistsForStudentCourse($_GET['student_num'], $sc['code'], $sc['section'], $sc['session'])) {
         unset($student_courses[$key]);
     }
 }
 //Get all the accommodations for a student regardless of whether it is expired
 $all_accommodations = $model->getAllAccommodations($_GET['student_num']);
 $all_course_specific_accommodations = $model->getAllNonTemplateAccommodations($_GET['student_num']);
 $all_accommodations = array_merge($all_accommodations, $all_course_specific_accommodations);
 //The accommodations we want are either only template accommodations or template + course specific accommodations
 $active_accommodations = $model->getAccommodations($_GET['student_num']);
 if (!empty($_GET['mode']) && $_GET['mode'] !== "template") {
     $course_details = explode('-', $_GET['mode']);
     $course_details[1] = $course_details[1] === "null" ? null : $course_details[1];
     $read_only = $model->fetchSessionStatus($course_details[2]);
     $active_accommodations_non_template = $model->getNonTemplateAccommodations($_GET['student_num'], $course_details);
     //Combine course specific accs with template accs
     $active_accommodations = array_merge($active_accommodations, $active_accommodations_non_template);
     //Then remove the course specific exclusions
     $items_to_exclude = array();
     foreach ($active_accommodations_non_template as $aa) {
         if ($aa['exception_type'] === "exclusion") {