<?php /** * Created by PhpStorm. * User: olajuwon * Date: 2/16/2015 * Time: 1:10 PM */ require_once '../_core/global/_require.php'; Crave::requireAll(GLOBAL_VAR); Crave::requireAll(UTIL); Crave::requireFiles(MODEL, array('BaseModel', 'AdmissionModel', 'RoleModel', 'BedModel', 'WardModel', 'VitalsModel')); Crave::requireFiles(CONTROLLER, array('AdmissionController', 'RoleController', 'VitalsController')); $admission = new AdmissionController(); $wards = $admission->loadWards(); ?> <!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title>Admin Dashboard</title> <link href="../css/bootstrap/bootstrap.min.css" rel="stylesheet"> <link href='../css/libs/fullCalendar/fullcalendar.css' rel='stylesheet' /> <link href='../css/libs/fullCalendar/fullcalendar.print.css' rel='stylesheet' media='print' /> <link href="../css/master.css" rel="stylesheet"> </head> <body> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header">
$warden = new AdmissionController(); $response = $warden->admitPatient($_REQUEST[AdmissionTable::patient_id], $_REQUEST[AdmissionTable::treatment_id], $admitted_by, $_REQUEST[AdmissionTable::bed_id], $comments); if ($response[P_STATUS] == STATUS_OK) { echo JsonResponse::message(STATUS_OK, $response[P_MESSAGE]); exit; } else { echo JsonResponse::error($response[P_MESSAGE]); exit; } } else { echo JsonResponse::error("Incomplete request parameters!"); exit; } } elseif ($intent == 'loadWards') { $warden = new AdmissionController(); $response = $warden->loadWards(); if (is_array($response)) { echo JsonResponse::success($response); exit; } else { echo JsonResponse::error("Unable to load wards!"); exit; } } elseif ($intent == 'loadBeds') { if (isset($_REQUEST[BedTable::ward_id])) { $warden = new AdmissionController(); $response = $warden->getWardBeds($_REQUEST[BedTable::ward_id]); if (is_array($response)) { echo JsonResponse::success($response); exit; } else {