$loggers['audit']->info("Exam date updated for NOE {$_POST['request_id']}"); } elseif ($_GET['page'] === "fetch-control-sheet") { header('Content-Type: application/json; charset=utf-8'); echo json_encode($controlSheets->fetchControlSheet($_POST['request_id'])); exit; } elseif ($_GET['page'] === "add-control-sheet") { $controlSheets->addUpdateControlSheet($_POST['request_id'], $_POST); $loggers['audit']->info("Control sheet added/updated for NOE {$_POST['request_id']}"); } elseif ($_GET['page'] === "view-file") { $file = $examFiles->fetchFile($_GET["file-id"]); header("Content-Length: {$file['size']}"); header("Content-Type: {$file['type']}"); header("Content-Disposition:attachment; filename=" . str_replace(',', '', $file['name']) . ""); print $file['content']; } elseif ($_GET['page'] === "fetch-files") { $files = $examFiles->fetchFiles($_POST["request_id"]); foreach ($files as $key => $f) { $files[$key]['file_exists'] = true; if ($files[$key]['cron_logged'] === "1") { $files[$key]['file_exists'] = false; } unset($files[$key]['content']); $studentsForFile = $examFiles->fetchStudentsForFile($files[$key]['id']); $files[$key]['students_for_file'] = implode(', ', $studentsForFile); } header('Content-Type: application/json; charset=utf-8'); echo json_encode($files); exit; } elseif ($_GET['page'] === "fetch-students") { //Fetch the students belonging to a course and then eliminate those that have opted out $noe_students = \Ventus\Utilities\Functions::fetchDataStudents(array("Exam"), $_GET['course_code'], $_GET['course_section'], $_GET['session'], $_GET['request_id']);