Exemple #1
0
        $poc->createPointOfContactFile($file, $content);
        $loggers['audit']->info("File added to specialist point of contact {$_POST['point_of_contact_id']}");
    }
    $poc->updatePointOfContactTopics($_POST['point_of_contact_id'], $_POST['point_of_contact_topics']);
    $poc->lockPointOfContact($_POST['point_of_contact_id']);
    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'] === "autosave") {
    $poc->updatePointOfContact($_POST);
    $poc->updatePointOfContactTopics($_POST['point_of_contact_id'], $_POST['point_of_contact_topics']);
} elseif ($_GET['page'] === "fetch") {
    $point_of_contact = $poc->fetchPointOfContact($_POST["id"]);
    $point_of_contact["selected"] = $poc->checkPreviouslySelectedThings($_POST["id"]);
    $point_of_contact["files"] = $poc->fetchAllPointOfContactFiles($_POST["id"]);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($point_of_contact);
    exit;
} elseif ($_GET['page'] === "fetch-incident-report") {
    $incident_report = $ir->fetchIncidentReport($_POST["id"]);
    $incident_report["files"] = $ir->fetchAllIncidentReportFiles($_POST["id"]);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($incident_report);
    exit;
} elseif ($_GET['page'] === "get-attachment") {
    $file = $poc->fetchPointOfContactFile($_GET['file_id']);
    header("Content-Type: {$file['type']}");
    header("Content-Disposition:attachment; filename=" . str_replace(',', '', $file['name']));
Exemple #2
0
        header('Location: point-of-contact.php?student_num=' . $_GET['student_num']);
    } else {
        header('Location: point-of-contact.php');
    }
    die;
} elseif ($_GET['page'] === "lock") {
    $poc->lockPointOfContact($_GET['id']);
    $loggers['audit']->info("Counselling point of contact {$_GET['id']} locked");
    if (ctype_digit($_GET['student_num'])) {
        header('Location: point-of-contact.php?student_num=' . $_GET['student_num']);
    } else {
        header('Location: point-of-contact.php');
    }
    die;
} elseif ($_GET['page'] === "fetch") {
    $point_of_contact = $poc->fetchPointOfContact($_GET['id']);
    $point_of_contact["files"] = $poc->fetchAllPointOfContactFiles($_GET["id"]);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($point_of_contact);
    exit;
} elseif ($_GET['page'] === "get-attachment") {
    $file = $poc->fetchPointOfContactFile($_GET['file_id']);
    header("Content-Type: {$file['type']}");
    header("Content-Disposition:attachment; filename=" . str_replace(',', '', $file['name']));
    echo $file['attachment'];
    exit;
} elseif ($_GET['page'] === "batch-print") {
    $print = $poc->listPointOfContact($_GET['student_num'], $_GET['pocs']);
    foreach ($print as $p) {
        echo '<div>' . htmlspecialchars_decode($p['point_of_contact']) . '<hr></div>';
    }