Esempio n. 1
0
    $noe_confirmed_dropped_students = $model->fetchConfirmedDroppedStudents($_POST);
    foreach ($noe_confirmed_dropped_students as $ds) {
        $noe_students_array[] = array('student_num' => $ds['student_num'], 'last_name' => $ds['last_name'], 'first_name' => $ds['first_name'], 'email' => $ds['email'], 'startDate' => date("Y-m-d", strtotime($ds['startDate'])), 'endDate' => date("Y-m-d", strtotime($ds['endDate'])), 'status' => "droppedConfirmed:" . $ds['request_id']);
    }
    $noe_denied_dropped_students = $model->fetchDeniedDroppedStudents($_POST);
    foreach ($noe_denied_dropped_students as $ds) {
        $date = date("Y-m-d", strtotime($ds['exam_date']));
        $noe_students_array[] = array('student_num' => $ds['student_num'], 'last_name' => $ds['last_name'], 'first_name' => $ds['first_name'], 'email' => $ds['email'], 'startDate' => $date, 'endDate' => $date, 'status' => "droppedDenied");
    }
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($noe_students_array);
    exit;
} elseif ($_GET['page'] === "export") {
    $l10n->addResource(FS_L10N . '/filenames.json');
    $l10n->addResource(__DIR__ . '/l10n/list-exams.json');
    $result = $model->fetchNoticeDetailsForExport($SESSION->user_id, $_GET['start'], $_GET['end']);
    foreach ($result as &$r) {
        $r["column2"] = $l10n->__($r["column2"]);
        //The exam type is stored in English in the database
        $r["column5"] = $l10n->__($r["column5"]);
        //The alternate status is stored in English in the database
        for ($i = 0; $i < sizeof($r); $i++) {
            $r[$l10n->__("csvColumn" . $i)] = $r["column" . $i];
            unset($r["column" . $i]);
        }
    }
    $csv = new \Ventus\Utilities\CSV($result);
    $csv->generate($l10n->__('file.faculty_exam_list'));
} else {
    header('Location: https://' . URL_PHP . '/error-external.php?eid=F087');
    exit;
Esempio n. 2
0
    } catch (\InvalidArgumentException $e) {
        $loggers['audit']->warning("Error occurred with exam file upload: " . $e->getMessage());
    }
    if (\Ventus\Utilities\Functions::checkIfStringIsDate($_GET['start']) && \Ventus\Utilities\Functions::checkIfStringIsDate($_GET['end']) && ctype_digit($_POST['request_id'])) {
        header("Location: notice-of-examination.php?start={$_GET['start']}&end={$_GET['end']}&mode={$_GET['mode']}&focus={$_POST['request_id']}");
    } else {
        header('Location: notice-of-examination.php');
    }
    die;
} elseif ($_GET['page'] === "delete-file") {
    $examFiles->deleteFile($_POST['file_id']);
    $loggers['audit']->info("Exam file {$_POST['file_id']} deleted");
} elseif ($_GET['page'] === "export") {
    $l10n->addResource(FS_L10N . '/filenames.json');
    require_once 'l10n/notice-of-examination.php';
    $result = $noes->fetchNoticeDetailsForExport($_GET['start'], $_GET['end']);
    foreach ($result as &$r) {
        $r["column2"] = $l10n->__($r["column2"]);
        //The exam type is stored in English in the database
        $r["column5"] = $l10n->__($r["column5"]);
        //The alternate status is stored in English in the database
        for ($i = 0; $i < sizeof($r); $i++) {
            $r[$l10n->__("csvColumn" . $i)] = $r["column" . $i];
            unset($r["column" . $i]);
        }
    }
    $csv = new \Ventus\Utilities\CSV($result);
    $csv->generate($l10n->__('file.exams_noe_csv_export'));
}
/**
 * View rendering