예제 #1
0
namespace Ventus\Faculty;

//============================================================================================
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('faculty', true);
if (!isset($SESSION->email)) {
    header('location: index.php?next=' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    die;
}
//============================================================================================
// Load the Model and L10N
//============================================================================================
$noes = new NOE($dbo);
$model = new Faculty();
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $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['rid'])) {
        $request_details = $model->fetchExamRequestDetails($_POST['rid']);
        $request_details[0]['session_long'] = \Ventus\Utilities\Functions::convertCodeToString($request_details[0]['session'], $l10n);
        //If the time this page is being loaded is less than 2 business days before the exam then the details cannot be edited
        $request_editable = false;
예제 #2
0
namespace Ventus\Faculty;

//============================================================================================
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('faculty', true);
if (!isset($SESSION->email)) {
    header('location: index.php?next=' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    die;
}
//============================================================================================
// Load the Model and L10N
//============================================================================================
$noes = new NOE($dbo);
$model = new Faculty();
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $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']);
예제 #3
0
파일: list-exams.php 프로젝트: hughnguy/php
namespace Ventus\Faculty;

//============================================================================================
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('faculty', true);
if (!isset($SESSION->email)) {
    header('location: index.php?next=' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    die;
}
//============================================================================================
// Load the Model and L10N
//============================================================================================
$model = new NOE($dbo);
$faculty = new Faculty();
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $l10n->setLanguage($SESSION->corr_lang);
    \Locale::setDefault($SESSION->corr_lang);
}
$this_page = "list-exams";
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    $default_date_range = unserialize(EXAMS_AND_PROCTOR_DEFAULT_DATE_FILTER_RANGE);
    if (!empty($_GET['start']) && !empty($_GET['end'])) {
        $startDate = \DateTime::createFromFormat('Y-m-d', urldecode($_GET['start']));
        $endDate = \DateTime::createFromFormat('Y-m-d', urldecode($_GET['end']));
예제 #4
0
if (!isset($_GET['page'])) {
    $render = true;
    $thisPage = "unconfirmed-noe";
    $default_date_range = unserialize(EXAMS_AND_PROCTOR_DEFAULT_DATE_FILTER_RANGE);
    if (empty($_GET['start']) || empty($_GET['end'])) {
        $startDate = date("Y-m-d", strtotime($default_date_range['start']));
        $endDate = date("Y-m-d", strtotime($default_date_range['end']));
    } else {
        $startDate = urldecode($_GET['start']);
        $endDate = urldecode($_GET['end']);
    }
    $notices = $model->fetchUnconfirmedNotices($startDate, $endDate);
    $l10n->addResource(__DIR__ . '/l10n/unconfirmed-noe.json');
    $viewFile = 'views/unconfirmed-noe.php';
} elseif ($_GET['page'] === "trigger-confirmation-email") {
    $noe = new NOE($dbo);
    $emails_to_profs = new \Ventus\Professor\EmailsToProfessors($dbo);
    $unconfirmed_request = $model->fetchUnconfirmedNotice($_POST['eid']);
    if (empty($unconfirmed_request)) {
        $loggers['audit']->warning("Attempted to send re-confirmation notice to professor for invalid NOE {$_POST['eid']}");
        echo 'fail:request-not-found';
        exit;
    }
    $course_exists = $noe->checkCourseExistence($unconfirmed_request['course_code'], $unconfirmed_request['course_section'], $unconfirmed_request['session'], $unconfirmed_request['teach_method']);
    if (!$course_exists) {
        $loggers['audit']->warning("Attempted to send re-confirmation notice to professor for invalid course on NOE {$_POST['eid']}");
        echo 'fail:course-not-found';
        exit;
    }
    $unconfirmed_request['prof_name'] = $course_exists;
    $emails_to_profs->resendEmailConfirmation($unconfirmed_request);
예제 #5
0
namespace Ventus\Faculty;

//============================================================================================
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('faculty', true);
if (!isset($SESSION->email)) {
    header('location: index.php?next=' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    die;
}
//============================================================================================
// Load the Model and L10N
//============================================================================================
$noes = new NOE($dbo);
$model = new Faculty();
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $l10n->setLanguage($SESSION->corr_lang);
    \Locale::setDefault($SESSION->corr_lang);
}
$this_page = "list-courses";
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    $semester = \Ventus\Utilities\Functions::fetchSemester();
    if (!isset($_GET['sem'])) {
        $selected_semester = $semester['now_short'];
    } else {
예제 #6
0
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('internal', true);
if (!isset($SESSION->lang)) {
    $SESSION->lang = DEFAULT_LANGUAGE;
}
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Model
//============================================================================================
$follow = new \Ventus\Specialist\FollowUps($dbo);
$faculty = new \Ventus\Faculty\Faculty();
$controlSheets = new ControlSheets($dbo);
$examFiles = new ExamFiles($dbo);
$noes = new NOE($dbo);
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    $render = true;
    $thisPage = "notice-exam";
    $default_date_range = unserialize(EXAMS_AND_PROCTOR_DEFAULT_DATE_FILTER_RANGE);
    if (!empty($_GET['start']) && !empty($_GET['end'])) {
        $startDate = \DateTime::createFromFormat('Y-m-d', urldecode($_GET['start']));
        $endDate = \DateTime::createFromFormat('Y-m-d', urldecode($_GET['end']));
    }
    if (!$startDate) {
        $startDate = new \DateTime($default_date_range['start']);
    }
    if (!$endDate) {