Exemple #1
0
$profile = new \Ventus\Specialist\Profile($dbo);
$ir = new IncidentReport($dbo);
$follow = new \Ventus\Specialist\FollowUps($dbo);
$courses = new \Ventus\Specialist\Courses($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 = 'incident';
        $semester = \Ventus\Utilities\Functions::fetchSemester();
        $current_courses = $courses->fetchAllStudentCoursesForSemester($_GET['student_num'], $semester['now_short']);
        $followupcount = $follow->fetchFollowUpsCountStudent($_GET['student_num']);
        $poccount = $profile->countUnlockedPOC($_GET['student_num']);
        $incident_reports = $ir->listIncidentReports($_GET['student_num']);
        foreach ($incident_reports as &$p) {
            $p["files"] = $ir->fetchAllIncidentReportFiles($p["incident_report_id"]);
        }
        unset($p);
        $l10n->addResource(__DIR__ . '/l10n/incident-report.json');
        $viewFile = 'views/incident-report.php';
    }
} elseif ($_GET['page'] === "create") {
    $allowedFileTypes = unserialize(FILE_TYPES_ALLOWED_FOR_NOTES_DISABILITIES);
    $last_inserted = $ir->createIncidentReport($_POST);
    $loggers['audit']->info("Incident report created for student {$_POST['student_num']}");
    for ($i = 0, $numFiles = sizeof($_FILES["incident_report_attachment"]["name"]) - 1; $i < $numFiles; $i++) {
Exemple #2
0
$courses = new \Ventus\Specialist\Courses($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 = 'acc';
        $followupcount = $follow->fetchFollowUpsCountStudent($_GET['student_num']);
        $poccount = $profile->countUnlockedPOC($_GET['student_num']);
        $current_semester = \Ventus\Utilities\Functions::fetchSemester();
        $current_semester = $current_semester['now_short'];
        $current_courses = $courses->fetchAllStudentCoursesForSemester($_GET['student_num'], $current_semester);
        //Get a list of all courses for this students and verify whether they belong in the past, present or future
        $student_courses = $courses->fetchAllStudentCourses($_GET['student_num']);
        foreach ($student_courses as $key => $sc) {
            $student_courses[$key]['session_status'] = $model->fetchSessionStatus($sc['session']);
            //If we are dealing with past courses, and if the student didn't exception for a past course,
            //it doesnt need to show up in this list
            if ($student_courses[$key]['session_status'] === -1 && !$model->checkIfExceptionExistsForStudentCourse($_GET['student_num'], $sc['code'], $sc['section'], $sc['session'])) {
                unset($student_courses[$key]);
            }
        }
        //Get all the accommodations for a student regardless of whether it is expired
        $all_accommodations = $model->getAllAccommodations($_GET['student_num']);
        $all_course_specific_accommodations = $model->getAllNonTemplateAccommodations($_GET['student_num']);
        $all_accommodations = array_merge($all_accommodations, $all_course_specific_accommodations);
        //The accommodations we want are either only template accommodations or template + course specific accommodations