Ejemplo n.º 1
0
         exit;
     } else {
         header('Location: profile.php');
         exit;
     }
 } else {
     if ($_GET['page'] === "view-attachment") {
         $file = $model->fetchDisabilityFile($_GET['file_id'], $SESSION->student_num);
         header("Content-type: " . $file[0]['type'] . "");
         header("Content-Disposition:attachment; filename=" . str_replace(',', '', $file[0]['name']) . "");
         print $file[0]['content'];
     } else {
         if ($_GET['page'] === "acknowledge-cam") {
             if ($_GET['source'] !== "specialist") {
                 if ($_GET['student_type'] === "undergraduate") {
                     $model->updateEmailPermissionStatus($SESSION->student_num);
                 }
                 $student_num = $SESSION->student_num;
                 $student_email = $SESSION->access_username;
             } else {
                 $student_num = $_POST['student_num'];
                 $student_email = trim($_POST['access_username']);
             }
             $semester = \Ventus\Utilities\Functions::fetchSemester();
             $semester = $semester['now_short'];
             //Fetch all courses for the current semester
             $courses_this_semester = $model->fetchStudentCoursesForSemesterForCam($student_num, $semester);
             if (!empty($courses_this_semester)) {
                 foreach ($courses_this_semester as $cts) {
                     $letter_details = array('acc_mode' => "{$cts['code']}-" . (empty($cts['section']) ? 'null' : $cts['section']) . "-{$cts['session']}", 'mode' => 'letter', 'template_id' => CAM_LETTER_ID_FRENCH, 'emp_id' => CAM_LETTER_GENERATOR_EMPLOYEE_ID, 'student_num' => $student_num, 'access_username' => $student_email, 'year_of_study' => $_POST['year_of_study']);
                     if ($_GET['student_type'] === "undergraduate" || $_GET['source'] === "specialist") {