Пример #1
0
// Model
//============================================================================================
$profile = new Profile($dbo);
$summary = new CaseSummary($dbo);
$emp_profile = new \Ventus\Profile\MyProfile($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 = 'summary';
    if (!empty($studentProfile)) {
        $emp_signature = nl2br($emp_profile->getEmpSignature($SESSION->user_name));
        $triage_list = $summary->listTriage($_GET['student_num']);
        $casedata = $summary->listCaseSummaries($_GET['student_num']);
        $l10n->addResource(__DIR__ . '/l10n/case-summary.json');
        $viewFile = 'views/case-summary.php';
    }
} elseif ($_GET['page'] === "fetch") {
    $content = $summary->getCaseSummary($_GET['row']);
    echo $content[0]['case_summary'];
} elseif ($_GET['page'] === "add") {
    $summary->addCaseSummary($_POST);
    $loggers['audit']->info("Case summary added");
} elseif ($_GET['page'] === "update") {
    $summary->updateCaseSummary($_POST['id'], $_POST);
    $loggers['audit']->info("Case summary {$_POST['id']} updated");
} elseif ($_GET['page'] === "lock") {