Exemple #1
0
} elseif ($_GET['page'] === "activate-profile") {
    $profile->activateStudentProfile($_GET['student_num']);
    $loggers['audit']->info("Counselling profile activated for student {$_GET['student_num']}");
    header('location:profile.php?student_num=' . $_GET['student_num']);
    die;
} elseif ($_GET['page'] === "deactivate-profile") {
    $profile->deactivateStudentProfile($_GET['student_num']);
    $loggers['audit']->info("Counselling profile deactivated for student {$_GET['student_num']}");
    if (ctype_digit($_GET['student_num'])) {
        header('Location: profile.php?student_num=' . $_GET['student_num']);
    } else {
        header('Location: profile.php');
    }
    die;
} elseif ($_GET['page'] === "update-file-number") {
    $profile->updateFileNumber($_POST['student_num'], $_POST['counselling_file_number']);
    $loggers['audit']->info("Legacy file number updated for student {$_GET['student_num']}");
} elseif ($_GET['page'] === "update-personal-info") {
    $questionnaire_id = $profile->getMostRecentPersonalInformation($_POST['student_num']);
    $questionnaire_id = $questionnaire_id[0]['questionnaire_id'];
    $profile->updateMostRecentPersonalInformation($questionnaire_id, $_POST);
    $loggers['audit']->info("Personal information updated for student {$_POST['student_num']}");
} elseif ($_GET['page'] === "update-primary-phone") {
    $profile->updatePrimaryPhone($_POST['student_num'], $_POST['primary_phone']);
    $loggers['audit']->info("Phone number updated for student {$_POST['student_num']}");
} elseif ($_GET['page'] === "activate-email-notices") {
    $profile->activateEmailNotices($_GET['student_num']);
    if (ctype_digit($_GET['student_num'])) {
        header('Location:profile.php?student_num=' . $_GET['student_num']);
    } else {
        header('Location:profile.php');