コード例 #1
0
ファイル: point-of-contact.php プロジェクト: hughnguy/php
        $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']));
    echo $file['attachment'];