Ejemplo n.º 1
0
//============================================================================================
$profile = new Profile($dbo);
$sessionnotes = new SessionNotes($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 = 'case';
    if (!empty($studentProfile)) {
        $emp_signature = nl2br($emp_profile->getEmpSignature($SESSION->user_name));
        $result = $sessionnotes->listSessionNotes($_GET['student_num']);
        $next_interview_number = $sessionnotes->getLastInterviewNumber($_GET['student_num']);
        if (is_int($next_interview_number)) {
            $next_interview_number++;
        }
        $l10n->addResource(__DIR__ . '/l10n/session-notes.json');
        $viewFile = 'views/session-notes.php';
    }
} elseif ($_GET['page'] === "fetch") {
    $content = $sessionnotes->getSessionNote($_GET['row']);
    header('Content-Type: application/json; charset=utf-8');
    echo json_encode($content);
    exit;
} elseif ($_GET['page'] === "add") {
    $sessionnotes->addSessionNote($_POST);
    $loggers['audit']->info("Session note added");