} elseif ($intent == 'patientVisits') { if (!isset($_REQUEST[DAY])) { echo JsonResponse::error("Incomplete request parameters!"); exit; } $result = ReportController::patientVisits(); if (is_array($result)) { echo JsonResponse::success($result); exit; } else { echo JsonResponse::error("Unable to retrieve patient visitation report for the specified date!"); exit; } } elseif ($intent == 'inPatients') { ReportController::datesIncluded(); $result = ReportController::inPatients(); if (is_array($result)) { echo JsonResponse::success($result); exit; } else { echo JsonResponse::error("Unable to retrieve in-patient report for the specified dates!"); exit; } } elseif ($intent == 'consultationReport') { ReportController::datesIncluded(); $result = ReportController::consultationReport(); if (is_array($result)) { echo JsonResponse::success($result); exit; } else { echo JsonResponse::error("Unable to retrieve consultation report for the specified dates!");
<?php /** * Created by PhpStorm. * User: Olaniyi * Date: 6/4/15 * Time: 3:37 PM */ require_once 'includes/iframe-header.php'; require_once '../../_core/global/_require.php'; Crave::requireAll(GLOBAL_VAR); Crave::requireAll(UTIL); Crave::requireFiles(MODEL, array('BaseModel', 'ReportModel')); Crave::requireFiles(CONTROLLER, array('ReportController')); $inpatients = ReportController::inPatients(); ?> <table class="table table-responsive dataTable"> <thead> <tr> <th>S/N</th> <th>Name</th> <th>Registration Number</th> </tr> </thead> <tbody id="new_patient"> <?php if (count($inpatients) == 0) { ?> <tr> <td></td>