Commit 9f79eea5 authored by Indra Raja's avatar Indra Raja

asdfa

parent dd34a5e0
...@@ -50,8 +50,71 @@ class AdminController extends \Application\Master\GlobalActionController ...@@ -50,8 +50,71 @@ class AdminController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost()); $baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// echo "<pre>";
$id = $getpath[3];
// echo "<pre>";
// print_r($uri);die;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); // $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
// $param = new \Application\Model\Param($storage);
// $curl = curl_init();
// curl_setopt_array($curl, array(
// CURLOPT_URL => "http://queue.indra/api/nextantrian",
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => "",
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "POST",
// CURLOPT_POSTFIELDS => array('inoantrian' => '1','idok' => '74','istatus' => '30'),
// ));
// $response = curl_exec($curl);
// curl_close($curl);
// echo $response;
// function curl($url, $data){
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output = curl_exec($ch);
// curl_close($ch);
// return $output;
// }
// // Data Parameter yang Dikirim oleh cURL
// $data = array("inoantrian"=>"1","idok"=>"74","istatus"=>"40");
// print_r($data);
// $send = curl("http://queue.indra/api/nextantrian/",json_encode($data));
// echo json_encode(array('respon'=>$send),JSON_UNESCAPED_SLASHES);
$arr = json_decode(file_get_contents("php://input"));
if (empty($arr->inoantrian) OR empty($arr->idok) OR empty($arr->istatus)){
echo "Submit gagal!";
} else {
echo "Submit berhasil!".$arr->inoantrian."</b><b>".$arr->idok."</b>.<b>".$arr->istatus."</b>.";
}
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = "' . $id . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-admin.js'); $this->headScript->appendFile('/action-js/antrian-js/action-admin.js');
$this->layout("layout/layoutAdmin"); $this->layout("layout/layoutAdmin");
......
...@@ -129,6 +129,32 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -129,6 +129,32 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson()); return $this->getOutput($result->toJson());
} }
public function loadsisaantrianAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
//$name = $this->isFieldMandatory(@$data['name'], 'name');
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
// print_r($load);die;
$load = $test->loadsisaantrian($post->id,$post->no);
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $load->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
}
public function cekpasienAction(){ public function cekpasienAction(){
$result = new Result(); $result = new Result();
$request = $this->getRequest(); $request = $this->getRequest();
...@@ -185,6 +211,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -185,6 +211,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$ktp = $post->iktp; $ktp = $post->iktp;
$no_antrian = $post->ino_antrian; $no_antrian = $post->ino_antrian;
$no_rekam_medis = $post->ino_rekam_medis; $no_rekam_medis = $post->ino_rekam_medis;
$sisa_antrian = $post->isisa_antrian;
// $counter= $param->getMaxCounter(); // $counter= $param->getMaxCounter();
...@@ -200,6 +227,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -200,6 +227,7 @@ class ApiController extends \Application\Master\GlobalActionController {
'no_hp' => $no_hp, 'no_hp' => $no_hp,
'ktp' => $ktp, 'ktp' => $ktp,
'status_code' => 10, 'status_code' => 10,
'sisa_antrian' => $sisa_antrian,
); );
$table_antrianpasien = 'antrian_pasien'; $table_antrianpasien = 'antrian_pasien';
...@@ -1499,14 +1527,14 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1499,14 +1527,14 @@ class ApiController extends \Application\Master\GlobalActionController {
$post = $request->getPost(); $post = $request->getPost();
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$antrian = new \Application\Model\Param($storage); $test = new \Application\Model\Param($storage);
$load = $antrian->loadAntrian();
// $id = $this->_getParam($test->loadAntrian($post->id_poli));
$load = $test->loadAntrian($post->id_poli);
if($load->code == 0){ if($load->code == 0){
$result->code = $result::CODE_SUCCESS; $result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS; $result->info = $result::INFO_SUCCESS;
...@@ -1555,7 +1583,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1555,7 +1583,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$poli = new \Application\Model\Param($storage); $poli = new \Application\Model\Param($storage);
$load = $poli->loadPoli(); $load = $poli->loadPoli($post->$id_poli);
...@@ -1640,7 +1668,7 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1640,7 +1668,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig()); $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage); $test = new \Application\Model\Param($storage);
$idokter = $post->id; $idokter = $post->iid;
$loadAntrianAdmin = $test->loadAntrianAdmin($idokter); $loadAntrianAdmin = $test->loadAntrianAdmin($idokter);
// print_r( $idokter);die; // print_r( $idokter);die;
...@@ -1690,33 +1718,47 @@ class ApiController extends \Application\Master\GlobalActionController { ...@@ -1690,33 +1718,47 @@ class ApiController extends \Application\Master\GlobalActionController {
$request = $this->getRequest(); $request = $this->getRequest();
$post = $request->getPost(); $post = $request->getPost();
if ($request->isPost()) {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage);
try{
$noantrian = $post->inoantrian;
$iddok = $post->idok;
$status = $post->istatus;
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$test = new \Application\Model\Param($storage); $dataarray = array(
'status_code' => $status,
);
$loadAntrianAdmin = $test->loadAntrianAdmin($iddok);
$noantrian = $post->inoantrian; $table = 'antrian_pasien';
$iddok = $post->idok; $where = 'id_dokter='.$iddok.' and no_antrian='.$noantrian;
$status = $post->istatus; $test->updateGlobal($table, $dataarray, $where);
$dataarray = array(
'status_code' => $status,
);
$loadAntrianAdmin = $test->loadAntrianAdmin($iddok);
$table = 'antrian_pasien'; if($load->code == 0){
$where = 'id_dokter='.$iddok.' and no_antrian='.$noantrian; $result->code = $result::CODE_SUCCESS;
$test->updateGlobal($table, $dataarray, $where); $result->info = $result::INFO_SUCCESS;
$result->data = $loadAntrianAdmin->data;
}else{
$result->code = 1;
$result->info = 'Not Found';
}
if($loaddokter->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS; }catch (\Exception $exc) {
$result->data = $loadAntrianAdmin->data; $result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
}else{ }
$result->code = 1;
$result->info = 'Not Found';
} }
return $this->getOutput($result->toJson()); return $this->getOutput($result->toJson());
......
...@@ -204,6 +204,7 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -204,6 +204,7 @@ class QueueController extends \Application\Master\GlobalActionController
$view->setVariable('no_antrian', $result['no_antrian']); $view->setVariable('no_antrian', $result['no_antrian']);
$view->setVariable('no_antrian', $result['no_antrian']); $view->setVariable('no_antrian', $result['no_antrian']);
$view->setVariable('kode_dokter', $result['kode_dokter']); $view->setVariable('kode_dokter', $result['kode_dokter']);
$view->setVariable('sisa_antrian', $result['sisa_antrian']);
// print_r($result);die; // print_r($result);die;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
...@@ -212,7 +213,8 @@ class QueueController extends \Application\Master\GlobalActionController ...@@ -212,7 +213,8 @@ class QueueController extends \Application\Master\GlobalActionController
$this->headScript->appendScript(' var nama_dokter_cetak = "' . $result['nama_dokter'] . '"'); $this->headScript->appendScript(' var nama_dokter_cetak = "' . $result['nama_dokter'] . '"');
$this->headScript->appendScript(' var kode_poli_cetak = "' . $result['nama_poli'] . '"'); $this->headScript->appendScript(' var kode_poli_cetak = "' . $result['nama_poli'] . '"');
$this->headScript->appendScript(' var no_antrian_cetak = "' . $result['no_antrian'] . '"'); $this->headScript->appendScript(' var no_antrian_cetak = "' . $result['no_antrian'] . '"');
$this->headScript->appendScript(' var kode_dokter_cetak = "' . $result['kode_dokter'] . '"'); $this->headScript->appendScript(' var kode_dokter_cetak = "' . $result['kode_dokter'] . '"');
$this->headScript->appendScript(' var sisa_antrian = "' . $result['sisa_antrian'] . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-cetak.js'); $this->headScript->appendFile('/action-js/antrian-js/action-cetak.js');
$this->layout("layout/layoutQueue"); $this->layout("layout/layoutQueue");
......
...@@ -41,6 +41,7 @@ class UmumController extends \Application\Master\GlobalActionController ...@@ -41,6 +41,7 @@ class UmumController extends \Application\Master\GlobalActionController
{ {
$view = new ViewModel(); $view = new ViewModel();
$result = new Result(); $result = new Result();
$today = gmdate("d M Y ", time()+60*60*7); $today = gmdate("d M Y ", time()+60*60*7);
$view->setVariable('today', $today); $view->setVariable('today', $today);
...@@ -48,27 +49,40 @@ class UmumController extends \Application\Master\GlobalActionController ...@@ -48,27 +49,40 @@ class UmumController extends \Application\Master\GlobalActionController
/* get url */ /* get url */
$uri = $this->getRequest()->getUri(); $uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost()); $baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// echo "<pre>";
$decodeid = base64_decode($getpath[3]);
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umum.js'); // $curl = curl_init();
// curl_setopt_array($curl, array(
// CURLOPT_URL => "http://queue.indra/api/loadantrian?id_poli=$decodeid",
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => "",
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "POST",
// CURLOPT_POSTFIELDS => array('id_poli' => $decodeid),
// ));
// $response = curl_exec($curl);
// curl_close($curl);
// // echo $response;
$this->layout("layout/layoutUmum");
return $view;
}
public function tampilanantrianAction()
{
$view = new ViewModel();
$result = new Result();
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"'); $this->headScript->appendScript(' var id_poli = "' . $decodeid . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umum.js'); $this->headScript->appendFile('/action-js/antrian-js/action-umumtampilan.js');
$this->layout("layout/layoutUmum"); $this->layout("layout/layoutUmum");
return $view; return $view;
} }
} }
...@@ -69,6 +69,10 @@ class Param extends Mapper { ...@@ -69,6 +69,10 @@ class Param extends Mapper {
$data = $this->_storage->loaddatapasien($id); $data = $this->_storage->loaddatapasien($id);
return $data; return $data;
} }
public function loadsisaantrian($id,$no){
$data = $this->_storage->loadsisaantrian($id,$no);
return $data;
}
public function cekpasien($no_rekam_medis = null,$ktp = null ){ public function cekpasien($no_rekam_medis = null,$ktp = null ){
$data = $this->_storage->cekpasien($no_rekam_medis, $ktp); $data = $this->_storage->cekpasien($no_rekam_medis, $ktp);
return $data; return $data;
...@@ -126,12 +130,12 @@ class Param extends Mapper { ...@@ -126,12 +130,12 @@ class Param extends Mapper {
$data = $this->_storage->loadantrianmiss($id); $data = $this->_storage->loadantrianmiss($id);
return $data; return $data;
} }
public function loadantrianunregis($id){ public function loadPoli($id_poli = null){
$data = $this->_storage->loadantrianunregis($id); $data = $this->_storage->loadPoli($id_poli);
return $data; return $data;
} }
public function loadPoli($id = null){ public function loadantrianunregis($id){
$data = $this->_storage->loadPoli($id); $data = $this->_storage->loadantrianunregis($id);
return $data; return $data;
} }
public function loadPilihAntrian($iddok = null){ public function loadPilihAntrian($iddok = null){
...@@ -155,8 +159,8 @@ class Param extends Mapper { ...@@ -155,8 +159,8 @@ class Param extends Mapper {
return $data; return $data;
} }
public function loadAntrian($id = null){ public function loadAntrian($id_poli){
$data = $this->_storage->loadAntrian($id); $data = $this->_storage->loadAntrian($id_poli);
return $data; return $data;
} }
public function loadjumlahpasien(){ public function loadjumlahpasien(){
......
...@@ -322,7 +322,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -322,7 +322,7 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { try {
$sql = " SELECT antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.no_rekam_medis, dokter_to_poli.nama_dokter, poli.nama_poli , dokter_to_poli.kode_dokter,antrian_pasien.id_pasien, dokter_to_poli.id_dokter $sql = " SELECT antrian_pasien.nama, antrian_pasien.no_antrian,antrian_pasien.no_rekam_medis, dokter_to_poli.nama_dokter, poli.nama_poli , dokter_to_poli.kode_dokter,antrian_pasien.id_pasien, dokter_to_poli.id_dokter,antrian_pasien.sisa_antrian
FROM antrian_pasien FROM antrian_pasien
INNER JOIN dokter_to_poli INNER JOIN dokter_to_poli
ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter ON antrian_pasien.id_dokter = dokter_to_poli.id_dokter
...@@ -444,6 +444,50 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -444,6 +444,50 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result(); $result = new Result();
try { try {
public function loadsisaantrian($id,$no){
$result = new Result();
try {
$sql = " SELECT COUNT(id_pasien)
FROM antrian_pasien
WHERE id_pasien is not null AND
id_dokter =$id AND (status_code <> 50 and status_code <> 60) and no_antrian < $no";
// print_r($sql);die;
$stmt = $this->_db->query($sql);
$resdata = $stmt->execute();
$listdata = array();
foreach($resdata as $val){
// print_r($val);die;
array_push($listdata, $val);
}
if ($listdata) {
$result->code = 0;
$result->info = 'OK';
$result->data = $listdata;
}else{
$result->code = 1;
$result->info = 'nok';
}
}catch (\Zend\Db\Adapter\Exception\RuntimeException $ex) {
$result->code = 3;
$result->info = 'ERROR : ' . $ex->getMessage();
}catch (\Exception $ex) {
$result->code = 4;
$result->info = 'ERROR : ' . $ex->getMessage();
}
return $result;
}
$sql = " SELECT * FROM pasien WHERE id_pasien = $id "; $sql = " SELECT * FROM pasien WHERE id_pasien = $id ";
...@@ -1342,9 +1386,16 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1342,9 +1386,16 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$sql = " SELECT poli.id_poli, poli.nama_poli $sql = " SELECT poli.id_poli, poli.nama_poli
FROM antrian_pasien FROM antrian_pasien
INNER JOIN poli INNER JOIN poli
ON antrian_pasien.id_poli = poli.id_poli ON antrian_pasien.id_poli = poli.id_poli ";
GROUP BY poli.id_poli
ORDER BY nama_poli asc"; if($id){
$sql .=" WHERE poli.id_poli=$id";
}
$sql .= " GROUP BY poli.id_poli";
...@@ -1660,17 +1711,29 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton { ...@@ -1660,17 +1711,29 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result; return $result;
} }
public function loadAntrian($id = null){ public function loadAntrian($id_poli){
$result = new Result(); $result = new Result();
try { try {
$sql="
$sql = " SELECT DISTINCT on (idd.id_dokter) idd.id_dokter,idd.no_antrian,dok.nama_dokter,pol.nama_poli,dok.kode_dokter,rur.nama_ruang FROM antrian_pasien idd SELECT DISTINCT on (idd.id_dokter) idd.id_dokter,idd.no_antrian,dok.nama_dokter,pol.nama_poli,dok.kode_dokter,rur.nama_ruang ,idd.status_code,idd.id_poli
LEFT JOIN dokter_to_poli dok on idd.id_dokter = dok.id_dokter FROM antrian_pasien idd
LEFT JOIN poli pol on idd.id_poli = pol.id_poli
LEFT JOIN ruang rur on idd.id_ruang = rur.id_ruang LEFT JOIN dokter_to_poli dok
on idd.id_dokter = dok.id_dokter
LEFT JOIN poli pol
WHERE idd.id_pasien is not null and status_code=20 or status_code=30 or status_code =40"; on idd.id_poli = pol.id_poli
LEFT JOIN ruang rur
on idd.id_ruang = rur.id_ruang
LEFT JOIN counter_status cs
on cs.status_code = idd.status_code
WHERE idd.id_pasien is not null
and
(cs.status_code=30 or cs.status_code =40) and
idd.id_poli=$id_poli
";
$stmt = $this->_db->query($sql); $stmt = $this->_db->query($sql);
......
<!-- <script type="text/javascript">
// 1 detik = 1000
window.setTimeout("waktu()",1000);
function waktu() {
var tanggal = new Date();
setTimeout("waktu()",1000);
document.getElementById("tanggalku").innerHTML
= tanggal.getHours()+":"+tanggal.getMinutes()+":"+tanggal.getSeconds();
}
</script> -->
<!-- Page header --> <!-- Page header -->
<div class="page-header" style="border-bottom: 0px solid #ddd0;"> <div class="row">
<!-- Header content --> <div class="page-header" style="border-bottom: 0px solid #ddd0;">
<div class="page-header-content"> <!-- Header content -->
<div class="page-title"> <div class="page-header-content">
<h4 style="font-size:25px;"><span class="text-semibold">Rumah Sakit - Mohon Antri Dengan Tertib</span></h4> <div class="page-title">
</div> <h4 style="color: #fff;font-size:25px;"><span class="text-semibold">Rumah Sakit - Mohon Antri Dengan Tertib</span></h4>
<div class="heading-elements"> </div>
<div class="heading-btn-group">
<div style="color: #fff9ff;font-size: 50px;font-weight: 600;margin-top:-20px;"> <div class="heading-elements">
<span id="tanggalku"></span> <div class="heading-btn-group">
<div style="color: #fff;font-size: 17px;font-weight: 600;margin-top:-20px;">
<?php echo $this->today; ?>
</div>
</div> </div>
<div style="color: #fff9ff;font-size: 17px;font-weight: 600;margin-top:-20px;">
<?php echo $this->today; ?>
</div>
</div> </div>
</div> </div>
</div>
</div>
<div class="justify-content-center">
<div class="col-sm-200" >
<div class="card mb-3 alert alert-info alert-styled-left alert-arrow-left alert-component col-sm-100" style="border-color: #e94c72;background: #faebd73b;width: 1300px;margin-left: 100px;">
<div class="text-center content-group">
<div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: #fff"><span > Nomer</span></p>
<h1 class="error-title" style=" font-weight: bold;font-size:100px;font-family: Times New Roman, Times, serif;color: #fff"><span id="no_antrian"></span></h1>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: #fff"><span > Please Proceed To</span></p>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: #fff"><span id="ruang"></span></p>
<!-- <div><input type="hidden" value="no_antrian" id="no_antrian" /></div>
<div><input type="hidden" value="nama_ruang" id="nama_ruang" /><span style="visibility:hidden" id="nama_ruang"></span></div> -->
</div>
</div> </div>
<div id="listdata" class="card-deck" style="padding-left: 100px;padding-right: 100px;width: 2000px;">
</div> </div>
<div class="card"> </div>
<h5 class="card-header">Featured</h5>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<a href="#" class="btn btn-primary">Go somewhere</a>
</div>
</div> </div>
<!-- <div id="box" class="wrap">
<!--
<div class="col-md-7 mt-25">
<div class="card mb-3">
<div class="text-center content-group">
<div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: grey"><span > Number</span></p>
<h1 class="error-title" style=" font-weight: bold;font-size:215px;font-family: Times New Roman, Times, serif;color: red"><span id="no_antrian"></span></h1>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: grey"><span > Please Proceed To</span></p>
<p class="error-title" style=" font-weight: ;font-size:50px;font-family: Times New Roman, Times, serif;color: red"><span > Ruang 1.1</span></p>
<div><input type="hidden" value="no_antrian" id="no_antrian" /></div>
<div><input type="hidden" value="nama_ruang" id="nama_ruang" /><span style="visibility:hidden" id="nama_ruang"></span></div> -->
<!-- </div>
</div>
</div> -->
</div> -->
<!-- /navigation -->
\ No newline at end of file
...@@ -90,6 +90,18 @@ ...@@ -90,6 +90,18 @@
</div> </div>
</div> </div>
<br> <br>
<div class="row">
<div class="col-sm-2">
<h3>Sisa Antrian</h3>
</div>
<div class="col-sm-1">
<h3>:</h3>
</div>
<div class="col-sm-6">
<h3><?php echo $this->sisa_antrian ?></label></h3>
</div>
</div>
<br>
</div> </div>
</div> </div>
......
...@@ -179,6 +179,9 @@ input[type="done"] + label { ...@@ -179,6 +179,9 @@ input[type="done"] + label {
<div class="form-group "> <div class="form-group ">
<input type="hidden" id="tempat_lahir" class="form-control "disabled ></input> <input type="hidden" id="tempat_lahir" class="form-control "disabled ></input>
</div> </div>
<div class="form-group ">
<input type="hidden" id="sisa_antrian" class="form-control "disabled ></input>
</div>
<div class="form-group"> <div class="form-group">
<input type="hidden" id="tanggal_lahir" class="form-control"disabled /></input> <input type="hidden" id="tanggal_lahir" class="form-control"disabled /></input>
......
...@@ -30,8 +30,7 @@ ...@@ -30,8 +30,7 @@
width: 100wh; width: 100wh;
height: 90vh; height: 90vh;
color: #fff; color: #fff;
background-color: #4d5dfb; background: linear-gradient(-45deg, #EE7752, #E73C7E, #23A6D5, #23D5AB);
background: linear-gradient(to right, #f05053 80%, #e1eec3);
background-size: 400% 400%; background-size: 400% 400%;
-webkit-animation: Gradient 15s ease infinite; -webkit-animation: Gradient 15s ease infinite;
-moz-animation: Gradient 15s ease infinite; -moz-animation: Gradient 15s ease infinite;
......
...@@ -34,9 +34,9 @@ function textToAudioRuang() { ...@@ -34,9 +34,9 @@ function textToAudioRuang() {
let ruang = document.getElementById("nama_ruang").innerHTML; let ruang = document.getElementById("nama_ruang").innerHTML;
var res = ruang.replace(".", " "); var res = ruang.replace(".", " ");
document.getElementById("nama_ruang").innerHTML = res; document.getElementById("nama_ruang").innerHTML = res;
let voice = "silahkan masuk ke " + res; let voice = "silahkan masuk ke ruang " + res;
console.log(voice) console.log(voice)
let speech = new SpeechSynthesisUtterance(); let speech = new SpeechSynthesisUtterance();
speech.lang = "id"; speech.lang = "id";
...@@ -92,7 +92,18 @@ $('#poli').on('change', function () { ...@@ -92,7 +92,18 @@ $('#poli').on('change', function () {
}); });
}); });
$( '#dokter' ).on( "change", function() {
$id_dokter =$('#dokter').val();
window.location.href = ("/admin/antrianadmin/" +$id_dokter);
});
if(window.location.pathname == "/admin/antrianadmin/" +id){
$( window ).on( "load", function() {
tampilangka(id)
loadantrian(id)
});
}
function loadpoli() { function loadpoli() {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
...@@ -131,14 +142,15 @@ function loadpoli() { ...@@ -131,14 +142,15 @@ function loadpoli() {
}); });
} }
function loadantrian() {
var iddokter = $('#dokter').val(); function loadantrian(id) {
$iddok= $('#dokter').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadAntrianAdmin', url: baseURL + '/api/loadAntrianAdmin',
data: { data: {
id: iddokter iid: id,
}, },
...@@ -185,23 +197,17 @@ function loadantrian() { ...@@ -185,23 +197,17 @@ function loadantrian() {
} }
$('#dokter').on('change', function () {
loadantrian();
tampilangka();
});
$('#no_antrian').html('-'); $('#no_antrian').html('-');
function tampilangka() { function tampilangka(id) {
var iddokter = $('#dokter').val();
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/loadNoAntrian', url: baseURL + '/api/loadNoAntrian',
data: { data: {
id_dokter: iddokter, id_dokter: id,
}, },
async: false, async: false,
...@@ -273,40 +279,41 @@ function tampilangka() { ...@@ -273,40 +279,41 @@ function tampilangka() {
$('#btnNext').on('click', function () { $('#btnNext').on('click', function () {
actionqueue(noantrian + 1, 20); actionqueue(noantrian + 1, 20,id);
loadantrian() loadantrian()
}); });
$('#btnCall').on('click', function () { $('#btnCall').on('click', function () {
actionqueue(noantrian, 30); actionqueue(noantrian, 30,id);
}); });
$('#btnDone').on('click', function () { $('#btnDone').on('click', function () {
actionqueue(noantrian, 50); actionqueue(noantrian, 50,id);
}); });
$('#btnMissed').on('click', function () { $('#btnMissed').on('click', function () {
actionqueue(noantrian, 60); actionqueue(noantrian, 60,id);
}); });
$('#btnServed').on('click', function () { $('#btnServed').on('click', function () {
actionqueue(noantrian, 40); actionqueue(noantrian, 40,id);
}); });
function actionqueue(antrianno, status) { function actionqueue(antrianno, status, iddok) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/nextantrian', url: baseURL + '/api/nextantrian',
data: { data: {
inoantrian: antrianno, inoantrian: antrianno,
istatus: status,
idok: iddok, idok: iddok,
istatus: status
}, },
success: function (result) { success: function (result) {
...@@ -319,7 +326,7 @@ function actionqueue(antrianno, status) { ...@@ -319,7 +326,7 @@ function actionqueue(antrianno, status) {
html: true, html: true,
type: "warning" type: "warning"
}); });
$('#no_antrian').html('-');
return false; return false;
} }
...@@ -347,20 +354,18 @@ function actionqueue(antrianno, status) { ...@@ -347,20 +354,18 @@ function actionqueue(antrianno, status) {
var flush = new Audio('../../data/tone/a1.mp3'); var flush = new Audio('../../data/tone/a1.mp3');
setTimeout(function () { setTimeout(function() {
flush.play(); flush.play(); }, )
})
flush.onended = function() {
flush.onended = function () { textToAudio()
textToAudio()
setTimeout(function() {
setTimeout(function () { textToAudioRuang() }, 3000)
textToAudioRuang() };
}, 3000)
}; swal({
swal({
title: "Call!", title: "Call!",
text: "Sedang Melakukan Panggilan", text: "Sedang Melakukan Panggilan",
type: "success", type: "success",
......
...@@ -2,17 +2,18 @@ ...@@ -2,17 +2,18 @@
$('#cetak').on('click', function (e) { $('#cetak').on('click', function (e) {
//alert("kepanggil"); //alert("kepanggil");
e.preventDefault(); e.preventDefault();
var w = window.open('', '', 'width=300,height=400'); var w = window.open('', '', 'width=300,height=400');
w.document.write('<html><body><table border="" >' + w.document.write('<html><body><table border="" >' +
'<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' + '<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' +
'<tbody><tr>' + '<tbody><tr>' +
'<th><h3>No Rekam Medis : ' + no_rekam_medis_cetak + '</h3>' + '<th><h2>ANTRIAN</h2>' +
'<h2>ANTRIAN</h2>' +
'<h1>' + kode_dokter_cetak + + no_antrian_cetak + '</h1>' + '<h1>' + kode_dokter_cetak + + no_antrian_cetak + '</h1>' +
'<h4>Nama Pasien : ' + nama_pasien_cetak + '</h4>' + '<h3>Nama Pasien : ' + nama_pasien_cetak + '</h3>' +
'<h4>Poli : ' + kode_poli_cetak + '</h4>' + '<h3>Poli : ' + kode_poli_cetak + '</h3>' +
'<h5>Nama Dokter : ' + nama_dokter_cetak + '</h5>' + '<h3>Nama Dokter : ' + nama_dokter_cetak + '</h3>' +
'<div class="h6a" style="text-align:right;font-size: 11px;";>No rekam medis tidak boleh hilang</div>' + '<h3>Jumlah yang sedang dalam antrian : ' + sisa_antrian + '</h3>' +
'<h4>waktu : ' + new Date().toLocaleString("en-US", {timeZone: "Asia/Jakarta"}) + '</h4>' +
'</th></tr></tbody></table></body></html>'); '</th></tr></tbody></table></body></html>');
w.window.print(); w.window.print();
w.document.close(); w.document.close();
......
...@@ -40,12 +40,51 @@ function loaddatapasien(param) { ...@@ -40,12 +40,51 @@ function loaddatapasien(param) {
} }
function loadsisaantrian() {
let dokter = $('#dokter option:selected').attr("value");
let no_antrian = $("input[name=antrian]:checked").val();
var sisa_antrian;
console.log(dokter);
console.log(no_antrian);
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadsisaantrian',
async: false,
data: {
id: dokter,
no: no_antrian,
},
success: function (result) {
// console.log(result);
// $('.loaddata').empty();
// console.log(result);
if (result.code == 0) {
let data = result.data;
console.log(data[0].count);
sisa_antrian = data[0].count;
// $('#sisa_antrian').val(data[0].count);
} else {
alert(result.info);
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
return sisa_antrian;
}
$('#tambah').on('click', function () { $('#tambah').on('click', function () {
savedataaja(); loadsisaantrian()
savedataaja()
}) })
...@@ -59,6 +98,7 @@ function savedataaja() { ...@@ -59,6 +98,7 @@ function savedataaja() {
let no_rekam_medis = $('#no_rekam_medis').val(); let no_rekam_medis = $('#no_rekam_medis').val();
let poli = $("#poli option:selected").attr("value"); let poli = $("#poli option:selected").attr("value");
let dokter = $('#dokter option:selected').attr("value"); let dokter = $('#dokter option:selected').attr("value");
let sisa_antrian = loadsisaantrian()
let ktp = $('#ktp').val(); let ktp = $('#ktp').val();
let no_antrian = $("input[name=antrian]:checked").val(); let no_antrian = $("input[name=antrian]:checked").val();
...@@ -81,6 +121,7 @@ function savedataaja() { ...@@ -81,6 +121,7 @@ function savedataaja() {
ipoli: poli, ipoli: poli,
idokter: dokter, idokter: dokter,
ino_antrian: no_antrian, ino_antrian: no_antrian,
isisa_antrian :sisa_antrian,
}, },
success: function (response) { success: function (response) {
...@@ -214,7 +255,7 @@ function pilihAntrian() { ...@@ -214,7 +255,7 @@ function pilihAntrian() {
// console.log($antrian); // console.log($antrian);
// console.log(response); // console.log(response);
if ($antrian) { if ($antrian) {
var hour = 0;; var hour = 0;
var splithour = []; var splithour = [];
splithour[0] = $antrian[0]['jam_mulai'].split(':'); splithour[0] = $antrian[0]['jam_mulai'].split(':');
...@@ -225,10 +266,10 @@ function pilihAntrian() { ...@@ -225,10 +266,10 @@ function pilihAntrian() {
minute = parseInt(splithour[0][1]); minute = parseInt(splithour[0][1]);
$('.antrian').empty();
for (var i = 0; i < $antrian.length; i++) { for (var i = 0; i < $antrian.length; i++) {
if ($antrian[i]['id_pasien'] === null) { if ($antrian[i]['id_pasien'] === null) {//jika masih kosong
let y = ''; let y = '';
...@@ -241,6 +282,9 @@ function pilihAntrian() { ...@@ -241,6 +282,9 @@ function pilihAntrian() {
hour += Math.floor(minute / 60); hour += Math.floor(minute / 60);
minute = minute % 60; minute = minute % 60;
} }
if(hour >=24){
hour=0;
}
if (minute.toString().length === 1) { if (minute.toString().length === 1) {
y += `<div class="col-lg-1"> y += `<div class="col-lg-1">
...@@ -265,7 +309,7 @@ function pilihAntrian() { ...@@ -265,7 +309,7 @@ function pilihAntrian() {
minute += parseInt(splittime[i][1]); minute += parseInt(splittime[i][1]);
} else if ($antrian[i]['status_code'] == 10 || $antrian[i]['status_code'] == 20 || $antrian[i]['status_code'] == 30 || $antrian[i]['status_code'] == 40) { } else if ($antrian[i]['status_code'] == 10 || $antrian[i]['status_code'] == 20 || $antrian[i]['status_code'] == 30 || $antrian[i]['status_code'] == 40) {//jika antrian sudah terisi
var splittime = []; var splittime = [];
splittime[i] = $antrian[i]['waktu_antrian'].split(':'); splittime[i] = $antrian[i]['waktu_antrian'].split(':');
let y = ''; let y = '';
...@@ -274,8 +318,15 @@ function pilihAntrian() { ...@@ -274,8 +318,15 @@ function pilihAntrian() {
if (minute >= 60) { if (minute >= 60) {
hour += Math.floor(minute / 60); hour += Math.floor(minute / 60);
minute = minute % 60; minute = minute % 60;
}
if(hour >=24){
hour=0;
} }
if (minute.toString().length === 1) { if (minute.toString().length === 1) {
...@@ -323,6 +374,10 @@ function pilihAntrian() { ...@@ -323,6 +374,10 @@ function pilihAntrian() {
if (minute >= 60) { if (minute >= 60) {
hour += Math.floor(minute / 60); hour += Math.floor(minute / 60);
minute = minute % 60; minute = minute % 60;
}
if(hour >=24){
hour=0;
} }
let y = ''; let y = '';
...@@ -349,10 +404,11 @@ function pilihAntrian() { ...@@ -349,10 +404,11 @@ function pilihAntrian() {
if (xhr.status != 200) { if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) "); //bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else { } else {
bootbox.alert({ message: 'Cannot load queue', centerVertical: true }); alert('Cannot load queue');
} }
} }
}); });
} }
$(document).ready(function () { $(document).ready(function () {
......
...@@ -16,7 +16,7 @@ $(document).ready(function () { ...@@ -16,7 +16,7 @@ $(document).ready(function () {
separator: ':', separator: ':',
duration: true, duration: true,
minimum: '06:00', minimum: '06:00',
maximum: '18:00', maximum: '24:00',
durationNegative: true durationNegative: true
}); });
}); });
...@@ -37,7 +37,7 @@ $(document).ready(function () { ...@@ -37,7 +37,7 @@ $(document).ready(function () {
separator: ':', separator: ':',
duration: true, duration: true,
minimum: '00:00', minimum: '00:00',
maximum: '23:00', maximum: '24:00',
durationNegative: true durationNegative: true
}); });
}); });
...@@ -47,8 +47,8 @@ $(document).ready(function () { ...@@ -47,8 +47,8 @@ $(document).ready(function () {
required: true, required: true,
separator: ':', separator: ':',
duration: true, duration: true,
minimum: '00:10', minimum: '00:01',
maximum: '00:20', maximum: '00:59',
durationNegative: true durationNegative: true
}); });
}); });
......
loadpoli(); loadpoli();
$('#pilih').on('click', function () { $('#pilih').on('click', function () {
// let poli = $("#poli option:selected").attr("value"); loaddatadokter()
window.location.href = ("tampilanantrian");
}); });
function loaddatadokter() {
let poli =$("#antrian_poli option:selected").attr("value");
console.log(poli);
/* save data */
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpoli',
data: {
id_poli: poli,
},
success: function (response) {
if (response['code'] == 0) {
console.log(response);
let $id = poli;
console.log($id)
let $encodedId = btoa($id);
window.location.href = ("/umum/umumtampilan/" + $encodedId);
} else {
bootbox.alert({ message: ' gagal', centerVertical: true });
}
}, error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('data tidak ada');
}
}
});
}
function loadpoli() { function loadpoli() {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
...@@ -13,7 +53,7 @@ function loadpoli() { ...@@ -13,7 +53,7 @@ function loadpoli() {
success: function (result) { success: function (result) {
if (result['code'] == 0) { if (result['code'] == 0) {
//console.log (result); console.log (result);
var res = result['data']; var res = result['data'];
optionseg = ''; optionseg = '';
optionseg += '<option value="Pilih" disabled selected>Pilih</option>'; optionseg += '<option value="Pilih" disabled selected>Pilih</option>';
...@@ -21,22 +61,14 @@ function loadpoli() { ...@@ -21,22 +61,14 @@ function loadpoli() {
optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>'; optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
} }
$("select#antrian_poli").html(optionseg); $("select#antrian_poli").html(optionseg);
let $id = result.data[0].id_poli;
// let $id = result.data['id_poli'];
// console.log($id);
} else { } else {
bootbox.dialog({
message: "<span class='bigger-110'>" + result['info'] + "</span>",
buttons:
{
"OK":
{
"label": "<i class='icon-ok'></i> OK ",
"className": "btn-sm btn-danger",
"callback": function () {
notifyCancel('ERROR: ' + result['info'] + '. Bila ada kesulitan dimohon untuk menghubungi Admin terkait');
}
}
}
});
} }
} }
}); });
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment