<?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'));
$current_patient = ReportController::currentPatients();
?>

    <table class="table table-responsive dataTable">
        <thead>
        <tr>
            <th>S/N</th>
            <th>Name</th>
            <th>Registration Number</th>
            <th>Gender</th>
        </tr>
        </thead>
        <tbody id="new_patient">
        <?php 
if (count($current_patient) == 0) {
    ?>
            <tr>
Exemple #2
0
    echo JsonResponse::error('Intent not set!');
    exit;
}
if ($intent == 'newPatients') {
    ReportController::datesIncluded();
    $result = ReportController::newPatients();
    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve new patient report for the specified dates!");
        exit;
    }
} elseif ($intent == 'currentPatients') {
    ReportController::datesIncluded();
    $result = ReportController::currentPatients();
    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve current patient report for the specified dates!");
        exit;
    }
} elseif ($intent == 'patientsAge') {
    ReportController::datesIncluded();
    $result = ReportController::patientsAge();
    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve patient age report for the specified dates!");