Example #1
0
    header("Content-Type: {$file['type']}");
    header("Content-Disposition:attachment; filename=" . str_replace(',', '', $file['name']));
    echo $file['attachment'];
    exit;
} elseif ($_GET['page'] === "get-incident-report-attachment") {
    $file = $ir->fetchIncidentReportFile($_GET['file_id']);
    header("Content-Type: " . $file[0]['type']);
    header("Content-Disposition:attachment; filename=" . str_replace(',', '', $file[0]['name']) . "");
    echo $file[0]['attachment'];
} elseif ($_GET['page'] === "batch-print") {
    $all_points_of_contact = $poc->listPointsOfContact($_GET['student_num'], $_GET['pocs']);
    foreach ($all_points_of_contact as $p) {
        echo '<div>' . $p['point_of_contact'] . '</div><hr>';
    }
} elseif ($_GET['page'] === "delete") {
    $poc->deletePointOfContact($_GET['poc_id']);
    $loggers['audit']->info("Specialist point of contact {$_GET['poc_id']} deleted");
    if (ctype_digit($_GET['student_num'])) {
        header('Location: point-of-contact.php?student_num=' . $_GET['student_num']);
        exit;
    }
    header('Location: point-of-contact.php');
    exit;
} elseif ($_GET['page'] === "delete-incident-report") {
    $ir->deleteIncidentReport($_GET['ir_id']);
    $loggers['audit']->info("Incident report {$_GET['ir_id']} deleted");
    if (ctype_digit($_GET['student_num'])) {
        header('Location: point-of-contact.php?student_num=' . $_GET['student_num']);
        exit;
    }
    header('Location: point-of-contact.php');