Exemple #1
0
<?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'));
$patient_with_age = ReportController::patientsAge();
?>

    <table class="table table-responsive dataTable">
        <thead>
        <tr>
            <th>S/N</th>
            <th>Name</th>
            <th>Registration Number</th>
            <th>Age</th>
        </tr>
        </thead>
        <tbody id="new_patient">
        <?php 
if (count($patient_with_age) == 0) {
    ?>
            <tr>
Exemple #2
0
        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!");
        exit;
    }
} 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);