Commit 259c5dc2 authored by Indra Raja's avatar Indra Raja

penambahan fitur tampilan antrian umum

parent 95e7301f
......@@ -219,7 +219,10 @@ class ApiController extends \Application\Master\GlobalActionController {
}
return $this->getOutput($result->toJson());
}
public function TampilanUmumAction(){
}
public function saveregisterAction(){
$result = new Result();
......@@ -799,9 +802,8 @@ class ApiController extends \Application\Master\GlobalActionController {
// print_r($dataArraydokter);die;
$param->saveGlobal($DokterPoli, $table_dokter_to_poli);
$param->saveGlobal($Dokter, $table_dokter);
$param->saveGlobal($DokterPoli, $table_dokter_to_poli);
$result->code = 0;
......@@ -1195,31 +1197,26 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadAntrianAction(){
$result = new Result();
public function loadantrianAction(){
$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());
$antrian = new \Application\Model\Param($storage);
$load = $antrian->loadAntrian();
$test = new \Application\Model\Param($storage);
// print_r($load);die;
$load = $test->loadAntrian($post->id);
if($load->code == 0){
$result->code = $result::CODE_SUCCESS;
$result->info = $result::INFO_SUCCESS;
$result->data = $load->data;
}
else{
}else{
$result->code = 1;
$result->info = 'Not Found';
}
return $this->getOutput($result->toJson());
......@@ -1258,7 +1255,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$poli = new \Application\Model\Param($storage);
$load = $poli->loadPoli();
$load = $poli->loadPoli($post->$id_poli);
......@@ -1325,7 +1322,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->info = $result::INFO_SUCCESS;
$result->data = $listdata;
}else{
$result->code = 1;
$result->code = 1;
$result->info = 'Not Found';
}
......
......@@ -158,8 +158,10 @@ class QueueController extends \Application\Master\GlobalActionController
//print_r($uri);die;
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// print_($getpath);die;
$decodeid = base64_decode($getpath[3]);
// $a = $getpath[3];
$decodeiddok = base64_decode($getpath[4]);
// $decodeidpol = base64_decode($getpath[5]);
......
......@@ -48,25 +48,16 @@ class UmumController extends \Application\Master\GlobalActionController
/* get url */
$uri = $this->getRequest()->getUri();
$baseurl = sprintf('//%s', $uri->getHost());
$getpath = explode("/",$uri->getPath());
// echo "<pre>";
$decodeid = base64_decode($getpath[3]);
// print_r($decodeid);
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umum.js');
$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->appendFile('/action-js/antrian-js/action-umum.js');
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = "' . $decodeid . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-umumtampilan.js');
$this->layout("layout/layoutUmum");
return $view;
......
......@@ -114,8 +114,8 @@ class Param extends Mapper {
$data = $this->_storage->loadkelolaantrian($id);
return $data;
}
public function loadPoli($id = null){
$data = $this->_storage->loadPoli($id);
public function loadPoli($id_poli = null){
$data = $this->_storage->loadPoli($id_poli);
return $data;
}
public function loadPilihAntrian($iddok = null){
......
......@@ -965,8 +965,16 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$sql = " SELECT poli.id_poli, poli.nama_poli
FROM antrian_pasien
INNER JOIN poli
ON antrian_pasien.id_poli = poli.id_poli
GROUP BY poli.id_poli";
ON antrian_pasien.id_poli = poli.id_poli ";
if($id){
$sql .=" WHERE poli.id_poli=$id";
}
$sql .= " GROUP BY poli.id_poli";
......@@ -1186,17 +1194,29 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result;
}
public function loadAntrian($id = null){
public function loadAntrian($id){
$result = new Result();
try {
$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
LEFT JOIN dokter_to_poli dok on idd.id_dokter = dok.id_dokter
LEFT JOIN poli pol on idd.id_poli = pol.id_poli
LEFT JOIN ruang rur on idd.id_ruang = rur.id_ruang
WHERE idd.id_pasien is not null and status_code=20 or status_code=30 or status_code =40";
$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 ,idd.status_code,idd.id_poli
FROM antrian_pasien idd
LEFT JOIN dokter_to_poli dok
on idd.id_dokter = dok.id_dokter
LEFT JOIN poli pol
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
";
$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 -->
<div class="page-header" style="border-bottom: 0px solid #ddd0;">
<!-- Header content -->
<div class="page-header-content">
<div class="page-title">
<h4 style="font-size:25px;"><span class="text-semibold">Rumah Sakit - Mohon Antri Dengan Tertib</span></h4>
</div>
<div class="heading-elements">
<div class="heading-btn-group">
<div style="color: #fff9ff;font-size: 50px;font-weight: 600;margin-top:-20px;">
<span id="tanggalku"></span>
<div class="row">
<div class="page-header" style="border-bottom: 0px solid #ddd0;">
<!-- Header content -->
<div class="page-header-content">
<div class="page-title">
<h4 style="color: #fff;font-size:25px;"><span class="text-semibold">Rumah Sakit - Mohon Antri Dengan Tertib</span></h4>
</div>
<div class="heading-elements">
<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 style="color: #fff9ff;font-size: 17px;font-weight: 600;margin-top:-20px;">
<?php echo $this->today; ?>
</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 id="listdata" class="card-deck" style="padding-left: 100px;padding-right: 100px;width: 2000px;">
</div>
<div class="card">
<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
<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 -->
<div class="page-header" style="border-bottom: 0px solid #ddd0;">
<!-- Header content -->
<div class="page-header-content">
<div class="page-title">
<div style=" text-align: center;color: #808080;font-family: Times New Roman, Times, serif;font-size: 50px;font-weight: 600;margin-top:-20px;">
<span id="tanggalku"></span>
</div>
<div style="text-align: center;color: #808080;font-family: Times New Roman, Times, serif;font-size: 17px;font-weight: 600;margin-top:-20px;">
<?php echo $this->today; ?>
</div>
</div>
</div>
<!-- /header content -->
</div>
<!-- /page header -->
<div id="box" class="wrap">
\ No newline at end of file
......@@ -30,17 +30,13 @@
width: 100wh;
height: 90vh;
color: #fff;
background-color: #4d5dfb;
background: linear-gradient(to right, #f05053 80%, #e1eec3);
background: linear-gradient(-45deg, #EE7752, #E73C7E, #23A6D5, #23D5AB);
background-size: 400% 400%;
-webkit-animation: Gradient 15s ease infinite;
-moz-animation: Gradient 15s ease infinite;
animation: Gradient 15s ease infinite;
overflow: hidden;
}
@-webkit-keyframes Gradient {
0% {
......
......@@ -28,7 +28,7 @@ function textToAudio() {
speech.pitch = 1;
window.speechSynthesis.speak(speech);
}
}
function textToAudioRuang() {
// let msg1 = "nomor antrian";
......
This diff is collapsed.
// alert(id);
//alert(id);
loaddatapasien(id)
function loaddatapasien(param) {
......@@ -39,11 +39,6 @@ function loaddatapasien(param) {
});
}
$('#tambah').on('click', function () {
savedataaja();
})
......@@ -89,6 +84,7 @@ function savedataaja() {
console.log(response);
let $id = response.data[0].id_antrian;
console.log($id);
let $encodedId = btoa($id);
......
......@@ -16,7 +16,7 @@ $(document).ready(function () {
separator: ':',
duration: true,
minimum: '06:00',
maximum: '18:00',
maximum: '24:00',
durationNegative: true
});
});
......@@ -37,7 +37,7 @@ $(document).ready(function () {
separator: ':',
duration: true,
minimum: '00:00',
maximum: '23:00',
maximum: '24:00',
durationNegative: true
});
});
......@@ -47,8 +47,8 @@ $(document).ready(function () {
required: true,
separator: ':',
duration: true,
minimum: '00:10',
maximum: '00:20',
minimum: '00:01',
maximum: '00:59',
durationNegative: true
});
});
......@@ -138,10 +138,23 @@ function loadpoli() {
for (var i = 0; i < res.length; i++) {
optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
}
$("select#poli").html(optionseg);
} else {
bootbox.alert({ message: 'Data Poli Kosong', centerVertical: true });
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');
}
}
}
});
}
}
});
......
loadantrianumum();
function loadantrianumum() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrian',
success: function (result) {
// console.log(result);
// console.log(result.data);
$('loadantrian').empty();
if (result.code == 0) {
var res = result['data'];
let hasil = '';
for (var i = 0; i < res.length; i++) {
hasil += "<div class='box one" + i + "'> <div class='date'> <h4 >" + res[i]['nama_poli'] + "</h4> <h4 >" + res[i]['nama_ruang'] + "</h4></div> <div class='poster p" + i + "'> <h4 >" + res[i]['kode_dokter'] + "" + res[i]['no_antrian'] + "</h4> </div> </div>"
}
$("#box").append(hasil);
} else {
alert(result.info);
}
},
error: function (xhr) {
console.log('ERROR AJAX:' + xhr.status + '-' + xhr.statusText);
}
});
}
// alert(id);
setInterval(function()
{
loadantrian(id)
}, 3000);
loadantrian(id);
function loadantrian(param) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrian',
data: {
id: param,
},
success: function (result) {
console.log(result);
// $('.loaddata').empty();
// console.log(result);
if (result['code'] == 0) {
var res = result['data'];
console.log(res);
$("#listdata").empty();
$('#no_antrian').empty();
let hasil = '';
for (var i = 0; i < res.length; i++) {
$('#no_antrian').empty();
$('#no_antrian').append("-");
if(res[i]['status_code']==30){
valTemp= res[i]['kode_dokter'] + res[i]['no_antrian'];
$('#no_antrian').empty();
$('#no_antrian').append(valTemp);
ruang= res[i]['nama_ruang'];
$('#ruang').empty();
$('#ruang').append(ruang);
}else{
$('#no_antrian').append("-");
}
hasil =
`
<div class="card col-sm-2" style="border-color: #e94c72;background: #faebd73b; width: 20rem;">
<div class="alert alert-info alert-styled-left alert-arrow-left alert-component" style="background: #faebd73b;">
<div><input type="hidden" value="nomer antrian" id="text-to-speech" placeholder="Enter text to speak..."/></div>
<h1 class="error-title" style=" font-weight:;font-size:53px;font-family: Times New Roman, Times, serif;color: #fff"><span > `+res[i]['kode_dokter']+`-`+res[i]['no_antrian']+` </span></h1>
</div>
<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>
`
$("#listdata").append(hasil);
}
} else {
$('#no_antrian').empty();
$('#no_antrian').append("-");
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
loadpoli();
$('#pilih').on('click', function () {
// let poli = $("#poli option:selected").attr("value");
window.location.href = ("tampilanantrian");
loaddatadokter()
});
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() {
$.ajax({
type: 'POST',
dataType: 'json',
......@@ -13,7 +53,7 @@ function loadpoli() {
success: function (result) {
if (result['code'] == 0) {
//console.log (result);
console.log (result);
var res = result['data'];
optionseg = '';
optionseg += '<option value="Pilih" disabled selected>Pilih</option>';
......@@ -21,22 +61,60 @@ function loadpoli() {
optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
}
$("select#antrian_poli").html(optionseg);
let $id = result.data[0].id_poli;
// let $id = result.data['id_poli'];
// console.log($id);
} 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
}
// function loadantriandata() {
// $.ajax({
// type: 'POST',
// dataType: 'json',
// url: baseURL + '/api/loadpoli',
// success: function (result) {
// if (result['code'] == 0) {
// console.log (result);
// var res = result['data'];
// optionseg = '';
// optionseg += '<option value="Pilih" disabled selected>Pilih</option>';
// for (var i = 0; i < res.length; i++) {
// optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
// }
// $("select#antrian_poli").html(optionseg);
// let $id = result.data[0].id_poli;
// // let $id = result.data['id_poli'];
// console.log($id);
// let $encodedId = btoa($id);
// window.location = (baseURL + "/umum/umumtampilan/"+$encodedId);
// } 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