예제 #1
0
<?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'));
if (isset($_REQUEST['intent'])) {
    $intent = $_REQUEST['intent'];
} else {
    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!");
예제 #2
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'));
$new_patient = ReportController::newPatients();
?>

<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($new_patient) == 0) {
    ?>
        <tr>