Exemple #1
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
//============================================================================================
$profile = new Profile($dbo);
$follow = new FollowUps($dbo);
$courses = new Courses($dbo);
$model = new \Ventus\Student\ExamRequests($dbo);
$dashboard = new \Ventus\Student\Dashboard($dbo);
$student_profile = new \Ventus\Student\StudentProfile($dbo);
if (isset($_GET['student_num']) && ctype_digit($_GET['student_num'])) {
    $studentProfile = $profile->getProfile($_GET['student_num']);
}
//============================================================================================
// Load the content
//============================================================================================
if (!isset($_GET['page'])) {
    $render = true;
    if (!empty($studentProfile)) {
        $thisPage = 'exams';
        $followupcount = $follow->fetchFollowUpsCountStudent($_GET['student_num']);
        $poccount = $profile->countUnlockedPOC($_GET['student_num']);
        $semester = \Ventus\Utilities\Functions::fetchSemester();
        $current_courses = $courses->fetchAllStudentCoursesForSemester($_GET['student_num'], $semester['now_short']);
        //Exams within a certain range have separate deadlines
namespace Ventus\Professor;

//The line that lets you run things from command line
parse_str(implode('&', array_slice($argv, 1)), $_GET);
//============================================================================================
// Config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('professor');
//============================================================================================
// Load the Model
//============================================================================================
$model = new EmailsToProfessors($dbo);
$professor = new RequestForm($dbo);
$student_profile = new \Ventus\Student\StudentProfile($dbo);
$letters = new \Ventus\Specialist\EmailLetterGenerator();
//============================================================================================
// Load the page requested by the user
//============================================================================================
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();