コード例 #1
0
ファイル: courses.php プロジェクト: hughnguy/php
if (!isset($_GET['page'])) {
    $render = true;
    if (!empty($studentProfile)) {
        $thisPage = 'courses';
        $followupcount = $follow->fetchFollowUpsCountStudent($_GET['student_num']);
        $poccount = $profile->countUnlockedPOC($_GET['student_num']);
        $current_semester = \Ventus\Utilities\Functions::fetchSemester();
        $current_semester = $current_semester['now_short'];
        $current_courses = $model->fetchAllStudentCoursesForSemester($_GET['student_num'], $current_semester);
        //Used in the menu
        $current_courses_view = $model->fetchAllStudentCoursesForSemester($_GET['student_num'], $current_semester);
        $current_session = substr($current_semester, -1);
        $current_year = substr($current_semester, 0, 4);
        $cam_details = $model->fetchCamDetails($_GET['student_num']);
        //Fetch all the courses the student was ever registered to
        $all_student_courses = $model->fetchAllStudentCourses($_GET['student_num']);
        $current_courses_view = array();
        $past_courses = array();
        $future_courses = array();
        //For each course, move it in to a dedicated array based on whether it is being held now, in the past or in the future
        foreach ($all_student_courses as $asc) {
            $course_session = substr($asc['session'], -1);
            $course_year = substr($asc['session'], 0, 4);
            //If the sessions match, things are easy
            if ($asc['session'] === $current_semester) {
                $current_courses_view[] = $asc;
            } else {
                if ((int) $course_year > (int) $current_year) {
                    $future_courses[] = $asc;
                } else {
                    if ((int) $course_year < (int) $current_year) {
コード例 #2
0
ファイル: accommodations.php プロジェクト: hughnguy/php
if (isset($_GET['student_num']) && ctype_digit($_GET['student_num'])) {
    $studentProfile = $profile->getProfile($_GET['student_num']);
}
//============================================================================================
// Load the content
//============================================================================================
if (!isset($_GET['page'])) {
    $render = true;
    if (!empty($studentProfile)) {
        $thisPage = 'acc';
        $followupcount = $follow->fetchFollowUpsCountStudent($_GET['student_num']);
        $poccount = $profile->countUnlockedPOC($_GET['student_num']);
        $semester = \Ventus\Utilities\Functions::fetchSemester();
        $current_courses = $courses->fetchAllStudentCoursesForSemester($_GET['student_num'], $semester['now_short']);
        //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]);
            }
        }
        //Find out the current semester
        $current_semester = \Ventus\Utilities\Functions::fetchSemester();
        $current_semester = $current_semester['now_short'];
        //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);