Esempio n. 1
0
 $noe_teach_methods = unserialize(PROFESSOR_POSSIBLE_NOE_TEACH_METHODS);
 foreach ($notices as $c) {
     $students_confirmed_at_as = $model->fetchCountStudentsConfirmedAtAS($c['exam_request_id'], $c['course_code'], $c['course_section'], $c['session']);
     //If the user has asked for rows that only has AS students, then there should be more than zero AS students for the NOE
     //Or the user wants to regular unfiltered view
     if (empty($_GET['mode']) || $_GET['mode'] === "as_only" && $students_confirmed_at_as > 0) {
         $quick_stat_1_changed = false;
         $quick_stat_2_changed = false;
         $quick_stat_3_changed = false;
         //If requests do exist, get each of these requests
         if (!(FACULTY_ALERTS_SHOW_ONLY_FOR_NOE_TEACH_METHODS && !in_array($c['teaching_method'], $noe_teach_methods))) {
             //Quick stat 1: For each request, check if the exam is 48 hours to 72 hours away
             $exam_range_to_consider = unserialize(FACULTY_ALERTS_CONSIDER_EXAM_RANGE_DAYS_BEFORE_EXAM);
             if (time() > \Ventus\Utilities\Functions::findNextBusinessDay(strtotime(date('Y-m-d ', strtotime($c['date'])) . FACULTY_EXAM_MODIFICATIONS_BLOCK_AFTER_TIME), -1 * $exam_range_to_consider['days_before_exam_start']) && time() < \Ventus\Utilities\Functions::findNextBusinessDay(strtotime(date('Y-m-d ', strtotime($c['date'])) . FACULTY_EXAM_MODIFICATIONS_BLOCK_AFTER_TIME), -1 * $exam_range_to_consider['days_before_exam_end'])) {
                 //If it is, check if that request already has an exam file uploaded
                 if (!$model->checkIfFileExistsForNOE($c['exam_request_id']) && !$model->checkIfDocumentReceived($c['exam_request_id'])) {
                     $quick_stat_1_changed = true;
                     $count_exams_due_48_hours++;
                 }
             }
             //Quick stat 2: For each NOE, check if it has no files AND no indication of paper copy being received
             if (!$model->checkIfDocumentReceived($c['exam_request_id']) && !$model->checkIfFileExistsForNOE($c['exam_request_id'])) {
                 $quick_stat_2_changed = true;
                 $count_exams_no_files++;
             }
             //Quick stat 3: For each NOE, check if it has a control sheet
             if (!$model->checkIfNoeHasControlSheet($c['exam_request_id']) && $students_confirmed_at_as > 0) {
                 $quick_stat_3_changed = true;
                 $count_exams_no_control_sheet++;
             }
         }
Esempio n. 2
0
            require_once FS_PHP . '/footer-external.php';
        } else {
            $loggers['audit']->warning("Unauthorized attempt to access page (class ID: {$_POST['cid']})");
            header('location: https://' . URL_PHP . '/error-external.php?eid=F094');
        }
    } else {
        header('Location: list-courses.php');
        exit;
    }
} elseif ($_GET['page'] === "fetch-request-details") {
    $l10n->addResource(__DIR__ . '/l10n/list-students-exams.json');
    $request_details = $model->fetchExamRequestDetails($_POST['request_id']);
    $request_details[0]['exam_type'] = ucfirst($l10n->__($request_details[0]['exam_type']));
    if ($request_details[0]['exam_alternate_special'] !== 'none') {
        $request_details[0]['exam_alternate_special'] = $l10n->__($request_details[0]['exam_alternate_special']);
    }
    $request_details[0]['inserted_on'] = $l10nDate->format($request_details[0]['inserted_on'], 'date_time');
    $request_details[0]['exam_date'] = $l10nDate->format($request_details[0]['exam_date'], 'day_date_time');
    //If paper copy has not been received AND no file has been uploaded for this request...
    if (empty($request_details[0]['file_id']) && !$noes->checkIfDocumentReceived($_POST['request_id'])) {
        $request_details[0]['file_or_paper_copy_received'] = 0;
    } else {
        $request_details[0]['file_or_paper_copy_received'] = 1;
    }
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($request_details);
    exit;
} else {
    header('Location: https://' . URL_PHP . '/error-external.php?eid=F004');
    exit;
}
Esempio n. 3
0
 foreach ($course_list as $c) {
     $num_students = $model->fetchCountStudents(array('Exam'), $c['code'], $c['section'], $selected_semester);
     $count_professor_requests = $model->fetchCountProfessorRequests($c['code'], $c['section'], $selected_semester, $c['teaching_method']);
     //Processing for quick stat 1 and quick stat 3
     $quick_stat_1_changed = false;
     $quick_stat_3_changed = false;
     if ($count_professor_requests > 0) {
         //If requests do exist, get each of these requests
         $course_requests = $model->fetchDataProfessorRequests($c['code'], $c['section'], $selected_semester, $c['teaching_method']);
         if (!(FACULTY_ALERTS_SHOW_ONLY_FOR_NOE_TEACH_METHODS && !in_array($c['teaching_method'], $noe_teach_methods))) {
             foreach ($course_requests as $cr) {
                 //Quick stat 1: For each request, check if the exam is 48 hours to 72 hours away
                 $exam_range_to_consider = unserialize(FACULTY_ALERTS_CONSIDER_EXAM_RANGE_DAYS_BEFORE_EXAM);
                 if (time() > \Ventus\Utilities\Functions::findNextBusinessDay(strtotime(date('Y-m-d ', strtotime($cr['exam_date'])) . FACULTY_EXAM_MODIFICATIONS_BLOCK_AFTER_TIME), -1 * $exam_range_to_consider['days_before_exam_start']) && time() < \Ventus\Utilities\Functions::findNextBusinessDay(strtotime(date('Y-m-d ', strtotime($cr['exam_date'])) . FACULTY_EXAM_MODIFICATIONS_BLOCK_AFTER_TIME), -1 * $exam_range_to_consider['days_before_exam_end'])) {
                     //If it is, check if that request already has an exam file uploaded
                     if (!$noes->checkIfFileExistsForNOE($cr['exam_request_id']) && !$noes->checkIfDocumentReceived($cr['exam_request_id']) && $model->fetchCountStudentsConfirmedAtAS($cr['exam_request_id']) > 0 && (int) $num_students > 0) {
                         $quick_stat_1_changed = true;
                         $count_exams_due_48_hours++;
                     }
                 }
                 //Quick stat 3: For each request that is in the future, check if a file exists but a control sheet doesnt
                 if (time() < strtotime($cr['exam_date']) && $noes->checkIfFileExistsForNOE($cr['exam_request_id']) && !$noes->checkIfNoeHasControlSheet($cr['exam_request_id'])) {
                     $quick_stat_3_changed = true;
                     $count_files_no_control_sheet++;
                 }
             }
         }
     }
     //Processing for quick stat 2: Get all courses that have students in them but are missing exam requests
     $quick_stat_2_changed = false;
     if ($count_professor_requests <= 0 && $num_students > 0) {