Files
2026-04-15 15:24:12 +07:00

181 lines
4.4 KiB
PHP
Executable File

<?php
class Status extends CI_Controller {
function hari() {
$dow = date("N");
switch($dow) {
case 1 :
return "Senin";
case 2 :
return "Selasa";
case 3 :
return "Rabu";
case 4 :
return "Kamis";
case 5 :
return "Jum'at";
case 6 :
return "Sabtu";
case 7 :
return "Minggu";
}
return "-";
}
function bulan() {
$mo = date("n");
switch($mo) {
case 1 :
return "Januari";
case 2 :
return "Februari";
case 3 :
return "Maret";
case 4 :
return "April";
case 5 :
return "Mei";
case 6 :
return "Juni";
case 7 :
return "Juli";
case 8 :
return "Agustus";
case 9 :
return "September";
case 10 :
return "Oktober";
case 11 :
return "November";
case 12 :
return "Desember";
}
}
function index() {
global $dummy_order;
$month = $this->bulan();
$tanggal = date("d") . " $month " . date("Y");
$arr = array(
"info" => array(
"username" => "Budi Wisono",
"area" => "Bandung Barat",
"hari" => $this->hari(),
"tanggal" =>$tanggal,
"last_updated" => date("Y-m-d H:i:s")
),
"status" => array(
"order" => 3,
"visited"=> 2,
"served" => 1,
"canceled" => 1
),
"order" => $dummy_order
);
echo json_encode($arr);
}
}
$dummy_order = array(
array (
"date" => date("Y-m-d 10:00:00"),
"pasien"=> array(
"name" => "Bpk. Budi Santoso",
"dob" => "1970-03-04",
"sex" => "M"
),
"test" => array (
array(
"testID" => 10,
"testName" => "SGOT",
"testBruto" => 100000,
"testDiscount" => 3000,
"testSubTotal" => 97000,
),
array(
"testID" => 12,
"testName" => "SGPT",
"testBruto" => 120000,
"testDiscount" => 5000,
"testSubTotal" => 115000,
),
array(
"testID" => 15,
"testName" => "Glucose",
"testBruto" => 80000,
"testDiscount" => 5000,
"testSubTotal" => 75000,
)
),
"address" => "Jl. Teuku Umar No 20",
"phone" => "08781234321",
"geo" => array("lat" => -6.867826, "lang" => 107.620409),
"area" => "Bandung Utara"
),
array (
"date" => date("Y-m-d 12:00:00"),
"pasien"=> array(
"name" => "Ibu. Siti Nuryanti",
"dob" => "1975-06-04",
"sex" => "F"
),
"test" => array (
array(
"testID" => 20,
"testName" => "HBsAg",
"testBruto" => 100000,
"testDiscount" => 3000,
"testSubTotal" => 97000,
),
array(
"testID" => 12,
"testName" => "SGPT",
"testBruto" => 120000,
"testDiscount" => 5000,
"testSubTotal" => 115000,
),
array(
"testID" => 25,
"testName" => "GGT",
"testBruto" => 80000,
"testDiscount" => 5000,
"testSubTotal" => 75000,
)
),
"address" => "Jl. Teuku Umar No 20",
"address" => "Jl. Tubagus Ismail V No 2",
"phone" => "08784534321",
"geo" => array("lat" => -6.884176, "lang" => 107.621268 ),
"area" => "Bandung Utara"
),
array (
"date" => date("Y-m-d 13:00:00"),
"pasien"=> array(
"name" => "Bp. Dudi Nugraha",
"dob" => "1964-06-04",
"sex" => "M"
),
"test" => array (
array(
"testID" => 20,
"testName" => "HBsAg",
"testBruto" => 100000,
"testDiscount" => 3000,
"testSubTotal" => 97000,
),
array(
"testID" => 12,
"testName" => "SGPT",
"testBruto" => 120000,
"testDiscount" => 5000,
"testSubTotal" => 115000,
),
),
"address" => "Jl. Terusan Ciheulang BAru No 7",
"phone" => "0878000321",
"geo" => array("lat" => -6.887279, "lang" => 107.619938 ),
"area" => "Bandung Utara"
),
);
?>