Ejemplo n.º 1
0
//============================================================================================
if ($_GET['page'] === "trigger-first-email") {
    $model->firstEmail($_GET['session']);
    $loggers['audit']->info("FIRST email sent to professors");
} elseif ($_GET['page'] === "send-reminders") {
    $exams = $model->fetchAutoImportedNOE($_GET['session']);
    foreach ($exams as $e) {
        $professor->reminderToAccessServiceStudents($e['cid']);
        $loggers['audit']->info("Exam confirmation reminders sent to students for NOE (confirmation ID: {$e['cid']})");
    }
} elseif ($_GET['page'] === "retrigger-confirmation-email") {
    $unconfirmed_requests = $model->fetchUnconfirmedNotices();
    print_r($unconfirmed_requests);
    echo '<br><br>';
    foreach ($unconfirmed_requests as $u) {
        $course_exists = $professor->checkCourseExistence($u['course_code'], $u['course_section'], $u['session'], $u['teach_method']);
        if ($course_exists !== null) {
            $u['prof_name'] = $course_exists;
            print_r($u);
            echo '<br><br>';
            $model->resendEmailConfirmation($u);
            $loggers['audit']->info("Confirmation email resent to requestor for NOE (confirmation ID: {$u['confirmation_key']})");
        }
    }
} elseif ($_GET['page'] === "send-cam-to-profs") {
    $semester = \Ventus\Utilities\Functions::fetchSemester();
    $semester = $semester['now_short'];
    $students = $model->fetchStudentsWhoseProfessorsNeedCam();
    foreach ($students as $s) {
        //Fetch all courses for the current semester
        $courses_this_semester = $student_profile->fetchStudentCoursesForSemesterForCam($s['student_num'], $semester);
Ejemplo n.º 2
0
} elseif (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->lang)) {
    $l10n->setLanguage($SESSION->lang);
}
\Locale::setDefault($l10n->getLanguage());
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    $l10n->addResource(__DIR__ . '/l10n/header-external.json');
    $l10n->addResource(__DIR__ . '/l10n/request-form.json');
    require_once FS_PHP . '/header-external.php';
    require_once 'views/request-form.php';
    require_once FS_PHP . '/footer-external.php';
} elseif ($_GET['page'] === "add") {
    $course_exists = $model->checkCourseExistence($_POST['course_code'], $_POST['course_section'], $_POST['session'], $_POST['teach_method']);
    if ($course_exists !== null) {
        //Assert that the NOE is not in a blocked date range
        $blackout = unserialize(PROFESSOR_NOE_SUBMISSION_BLACKOUT);
        if (!empty($blackout['start']) && !empty($blackout['end'])) {
            if (strtotime($_POST['exam_date']) >= strtotime($blackout['start']) && strtotime($_POST['exam_date']) <= strtotime($blackout['end'])) {
                echo "invalid-dates";
                die;
            }
        }
        echo "success";
        $_POST['prof_name'] = $course_exists;
        $insert_id = $model->addRequest($_POST);
        $loggers['audit']->info("NOE {$insert_id} added");
        $model->sendEmailConfirmation($_POST, $insert_id);
    } else {