$l10n->setLanguage($SESSION->corr_lang); \Locale::setDefault($SESSION->corr_lang); } $l10n->addResource(FS_L10N . '/header-external.json'); //============================================================================================ // Load the page requested by the user //============================================================================================ if (!isset($_GET['page'])) { if (isset($_POST['cid']) && $_POST['cid'] !== "") { //Security step: double check that the user has permission for this course $has_permission = $model->checkCourseAllowed($SESSION->user_id, $_POST['cid']); if ($has_permission) { $course_details = $model->fetchCourseDetails($_POST['cid']); $prof_details = $model->fetchProfessorDetails($course_details[0]['code'], $course_details[0]['section'], $course_details[0]['session'], $course_details[0]['teaching_method']); $semester = \Ventus\Utilities\Functions::convertCodeToString($course_details[0]['session'], $l10n); $num_students = $model->fetchCountStudents(array("Exam"), $course_details[0]['code'], $course_details[0]['section'], $course_details[0]['session']); $num_requests = $model->fetchCountProfessorRequests($course_details[0]['code'], $course_details[0]['section'], $course_details[0]['session'], $course_details[0]['teaching_method']); $data_students = \Ventus\Utilities\Functions::fetchDataStudents(array("Exam"), $course_details[0]['code'], $course_details[0]['section'], $course_details[0]['session']); $data_requests = $model->fetchDataProfessorRequests($course_details[0]['code'], $course_details[0]['section'], $course_details[0]['session'], $course_details[0]['teaching_method']); $l10n->addResource(__DIR__ . '/l10n/header.json'); $l10n->addResource(__DIR__ . '/l10n/list-students-exams.json'); require_once FS_PHP . '/header-external.php'; require_once 'views/list-students-exams.php'; 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;
if (!isset($_GET['sem'])) { $selected_semester = $semester['now_short']; } else { $selected_semester = $_GET['sem']; } $course_list = $model->fetchAllCourses($SESSION->user_id, $selected_semester); $count_exams_due_48_hours = 0; $count_courses_missing_requests = 0; $count_files_no_control_sheet = 0; $count_all_access_service_students = 0; $count_courses_having_access_service_students = 0; $long_string = ""; if (!empty($course_list)) { $noe_teach_methods = unserialize(PROFESSOR_POSSIBLE_NOE_TEACH_METHODS); 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;