// MODEL //============================================================================================ $profile = new Profile($dbo); $follow = new FollowUps($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 = 'profile'; $lastAppointment = \Ventus\Utilities\Functions::getLastAppointment($_GET['student_num'], SERVICE_ID_ACCESS); $allAppointments = \Ventus\Utilities\Functions::getAllAppointments($_GET['student_num'], SERVICE_ID_ACCESS); $all_student_activity = $profile->listAllActivity($_GET['student_num']); $all_employees = \Ventus\Utilities\Functions::listEmployees(SERVICE_ID_ACCESS); $followupcount = $follow->fetchFollowUpsCountStudent($_GET['student_num']); $poccount = $profile->countUnlockedPOC($_GET['student_num']); $l10n->addResource(__DIR__ . '/l10n/profile.json'); $l10n->localizeArray($allAppointments, 'label'); $l10n->localizeArray($all_student_activity, 'otherDetail'); $l10n->localizeArray($studentProfile, 'faculty'); $l10n->localizeArray($studentProfile, 'program'); if ($lastAppointment) { $l10n->localizeArray($lastAppointment[0], 'label'); } $viewFile = 'views/profile.php'; } } elseif ($_GET['page'] === "activate-profile") {
// Model //============================================================================================ $profile = new Profile($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; $thisPage = 'profile'; if (!empty($studentProfile)) { $intake_form_personal_info = $profile->getMostRecentPersonalInformation($_GET['student_num']); $lastAppointment = \Ventus\Utilities\Functions::getLastAppointment($_GET['student_num'], SERVICE_ID_COUNSELLING); $allAppointments = \Ventus\Utilities\Functions::getAllAppointments($_GET['student_num'], SERVICE_ID_COUNSELLING); $l10n->addResource(__DIR__ . '/l10n/profile.json'); $l10n->localizeArray($allAppointments, 'label'); $l10n->localizeArray($studentProfile, 'faculty'); $l10n->localizeArray($studentProfile, 'program'); if ($lastAppointment) { $l10n->localizeArray($lastAppointment[0], 'label'); } $viewFile = 'views/profile.php'; } } elseif ($_GET['page'] === "activate-profile") { $profile->activateStudentProfile($_GET['student_num']); $loggers['audit']->info("Counselling profile activated for student {$_GET['student_num']}"); if (ctype_digit($_GET['student_num'])) { header('Location:profile.php?student_num=' . $_GET['student_num']); } else {