Commit 95a3d3f6 authored by Indra Raja's avatar Indra Raja

memperbaiki bagian kelola

parent 186edff5
......@@ -391,7 +391,8 @@ class ApiController extends \Application\Master\GlobalActionController {
$param = new \Application\Model\Param($storage);
try{
$id_register = $post->id;
$id_register = $post->id;
$antrian_all = $post->iantrial_all;
$antrian_awal = $post->iantrian_awal;
$antrian_akhir = $post->iantrian_akhir;
......@@ -401,9 +402,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$dataArrayRegister = array (
'id_poli' =>$poli,
'id_dokter' =>$dokter,
'id_ruang' =>$ruang,
'antrian_all' =>$antrian_all,
'antrian_awal' =>$antrian_awal,
'antrian_akhir' =>$antrian_akhir,
......@@ -840,7 +839,7 @@ class ApiController extends \Application\Master\GlobalActionController {
//print_r($poli);die;
$dataArrayruang = array (
'nama_ruang' =>$nama_ruang,
'nama_ruang' =>'R '.$nama_ruang,
'id_poli' =>$poli,
'id_condition' => 1
);
......@@ -881,12 +880,15 @@ class ApiController extends \Application\Master\GlobalActionController {
$id_ruang = $post->id;
$nama_ruang = $post->inama_ruang;
$poli = $post->ipoli;
$condition = $post->icondition;
$dataArrayruang = array (
'nama_ruang' =>$nama_ruang,
'id_poli' =>$poli,
'nama_ruang' =>$nama_ruang,
'id_poli' =>$poli,
'id_condition' =>$condition,
);
......
......@@ -97,6 +97,7 @@
</tr>
</thead>
<tbody id="antrianadmin" >
</tbody>
</table>
......
......@@ -88,7 +88,7 @@
<div class="modal-body">
<form id="myFormedt" >
<input type="input" id="id_ruang" class="form-control" /></input>
<input type="hidden" id="id_ruang" class="form-control" /></input>
<div class="form-group">
<label>Nama Poli</label>
......
......@@ -14,10 +14,11 @@
<th style="">NO</th>
<th colspan="" class=" thLeftText">Jenis Layanan (Poli)</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Ruang</th>
<th colspan="" class=" thLeftText">Ruangan</th>
<th colspan="" class=" thLeftText">Antrian Seluruh</th>
<th colspan="" class=" thLeftText">Antrian Awal (mobile)</th>
<th colspan="" class=" thLeftText">Antrian Akhir (mobile)</th>
<th colspan="" class=" thLeftText">Jam Mulai</th>
<th colspan="" class=" thLeftText">Waktu Antrian</th>
<th colspan="" class=" thLeftText">Tanggal Antrian</th>
<th colspan="" class=" thLeftText">Action</th>
......
<?= $this->doctype() ?>
<html lang="en">
<head>
<meta charset="utf-8">
<?= $this->headTitle('ZF Skeleton Application')->setSeparator(' - ')->setAutoEscape(false) ?>
<?= $this->headMeta()
->appendName('viewport', 'width=device-width, initial-scale=1.0')
->appendHttpEquiv('X-UA-Compatible', 'IE=edge')
?>
<!-- Le styles -->
<?= $this->headLink(['rel' => 'shortcut icon', 'type' => 'image/vnd.microsoft.icon', 'href' => $this->basePath() . '/img/favicon.ico'])
->prependStylesheet($this->basePath('css/style.css'))
->prependStylesheet($this->basePath('css/bootstrap-theme.min.css'))
->prependStylesheet($this->basePath('css/bootstrap.min.css'))
// ->prependStylesheet($this->basePath('css/style_seat.css'))
?>
<div class="container">
<?= $this->content ?>
<hr>
<footer>
</div>
<?= $this->headScript()
->prependFile($this->basePath('js/bootstrap.min.js'))
->prependFile($this->basePath('js/jquery-3.1.0.min.js'))
// ->prependFile($this->basePath('js/scripts.js'))
//->prependFile($this->basePath('js/jquery-1.11.0.min.js"'))
// ->prependFile($this->basePath('js/jquery.seat-charts.js'))
?>
<?= $this->inlineScript() ?>
</body>
</html>
......@@ -106,7 +106,7 @@ function loadantrian() {
success: function (result) {
// console.log(result.data);
$('table.order-bordered > tbody').empty();
$('table.table-bordered > tbody').empty();
// console.log(result);
if (result.code == 0) {
......@@ -115,16 +115,16 @@ function loadantrian() {
// console.log(data);
let counter = 1;
for (x in data) {
for (var i = 0; i < data.length; i++) {
var newRow = $("<tr>");
var cols = "";
// onClick="openmyprofile('+reg[x].userid+',\''+reg[x].named+'\')">
cols += '<td class="">' + counter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_antrian + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].status_name + '</td>';
cols = '<td class="">' + counter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[i].no_antrian + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[i].nama + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[i].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[i].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[i].status_name + '</td>';
newRow.append(cols);
$("#antrianadmin").append(newRow);
......@@ -147,8 +147,9 @@ function loadantrian() {
$('#dokter').on('change', function () {
loadantrian();
tampilangka(10);
tampilangka();
});
$('#no_antrian').html('-');
......@@ -223,26 +224,27 @@ function tampilangka() {
$('#btnNext').on('click', function () {
actionqueue(noantrian + 1, 20);
loadantrian();
loadantrian()
});
$('#btnCall').on('click', function () {
actionqueue(noantrian, 30);
loadantrian();
});
$('#btnDone').on('click', function () {
actionqueue(noantrian, 50);
loadantrian();
});
$('#btnMissed').on('click', function () {
actionqueue(noantrian, 60);
loadantrian();
});
$('#btnServed').on('click', function () {
actionqueue(noantrian, 40);
loadantrian();
});
......@@ -261,14 +263,16 @@ function actionqueue(antrianno, status) {
if (result.data == null && status == 20) {
// swal({
// title: "<span style='color:#222'>error!</span>",
// text: "<span style='color:#222'>Nomer Antrian Selanjutnya Tidak ada!</span>",
// confirmButtonColor: "#66BB6A",
// html: true,
// type: "warning"
// });
swal({
title: "<span style='color:#222'>error!</span>",
text: "<span style='color:#222'>Nomer Antrian Selanjutnya Tidak ada!</span>",
confirmButtonColor: "#66BB6A",
html: true,
type: "warning"
});
$('#no_antrian').html('-');
return false;
}
if (status == 20) {
......@@ -291,13 +295,13 @@ function actionqueue(antrianno, status) {
} else if (status == 30) {
// SOound call
swal({
title: "Call!",
text: "Sedang Melakukan Panggilan",
type: "success",
showConfirmButton: false,
timer: 5000
});
// swal({
// title: "Call!",
// text: "Sedang Melakukan Panggilan",
// type: "success",
// showConfirmButton: false,
// timer: 5000
// });
$('#btnNext').prop('disabled', true);
$('#btnCall').prop('disabled', false);
......
......@@ -241,45 +241,7 @@ function editdatadokter(id_dokter) {
});
}
function loadcondition() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadCondition',
success: function (result) {
if (result['code'] == 0) {
//console.log (result);
var res = result['data'];
optionseg = '';
for (var i = 0; i < res.length; i++) {
optionseg += '<option value="' + res[i].id_condition + '">' + res[i].condition + '</option>';
}
$("select#condition").html(optionseg);
} 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');
}
}
}
});
}
}
});
}
function loadedit(id_dokter) {
......
......@@ -190,6 +190,7 @@ $('#edit').on('click', function () {
function editdataruang(id_ruang) {
let poli = $("#poliedt option:selected").attr("value");
let nama_ruang = $('#nama_ruangedt').val();
let condition = $("#condition option:selected").attr("value");
$.ajax({
type: 'POST',
......@@ -199,6 +200,7 @@ function editdataruang(id_ruang) {
id: id_ruang,
inama_ruang: nama_ruang,
ipoli: poli,
icondition: condition,
},
......@@ -238,80 +240,7 @@ function editdataruang(id_ruang) {
});
}
function loadpoliedt() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadregisterpoli',
success: function (result) {
if (result['code'] == 0) {
//console.log (result);
var res = result['data'];
optionseg = '';
for (var i = 0; i < res.length; i++) {
optionseg += '<option value="' + res[i].id_poli + '">' + res[i].nama_poli + '</option>';
}
$("select#poliedt").html(optionseg);
} 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');
}
}
}
});
}
}
});
}
function loadcondition() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadCondition',
success: function (result) {
if (result['code'] == 0) {
//console.log (result);
var res = result['data'];
optionseg = '';
for (var i = 0; i < res.length; i++) {
optionseg += '<option value="' + res[i].id_condition + '">' + res[i].condition + '</option>';
}
$("select#condition").html(optionseg);
} 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');
}
}
}
});
}
}
});
}
function loadedit(id_ruang) {
......@@ -325,7 +254,7 @@ function loadedit(id_ruang) {
id: id_ruang,
},
success: function (result) {
console.log(result);
// console.log(result);
// $('.loaddata').empty();
// console.log(result);
......@@ -340,10 +269,10 @@ function loadedit(id_ruang) {
async: false,
success: function (result) {
// console.log(data);
if (result['code'] == 0) {
console.log(result );
var res = result['data'];
optionseg = '';
......@@ -373,8 +302,6 @@ function loadedit(id_ruang) {
}
});
$('#id_ruang').val(data[0].id_ruang);
loadcondition()
loadpoliedt()
$('#nama_ruangedt').val(data[0].nama_ruang);
} else {
......
......@@ -190,6 +190,7 @@ function LoadDadta(id) {
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].antrian_all + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].antrian_awal + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].antrian_akhir + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].jam_mulai + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].waktu_antrian + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].create_date + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center" ><span style="width:80px;height:30;" class="btn btn-success btn-xs" data-toggle="modal" data-target="#editData" onClick="loadedit(' + data[x].id_register + ')">Edit</span><span style="width:80px;height:30;"class="btn btn-danger btn-xs" onclick="Delete(' + data[x].id_register + ')">Delete</span></div></td>';
......@@ -456,7 +457,9 @@ $('#edit').on('click', function () {
function editregister(id_register) {
let ruang = $("#ruang option:selected").attr("value");
let poli = $('#poli option:selected').attr("value");
let dokter = $('#dokter option:selected').attr("value");
let antrian_all = $('#antrian_alledt').val();
let antrian_awal = $('#antrian_awaledt').val();
let antrian_akhir = $('#antrian_akhiredt').val();
......@@ -473,7 +476,9 @@ function editregister(id_register) {
async: false,
data: {
id: id_register,
ipoli :poli,
idokter: dokter,
iruang: ruang,
iantrial_all: antrian_all,
iantrian_awal: antrian_awal,
iantrian_akhir: antrian_akhir,
......@@ -489,7 +494,8 @@ function editregister(id_register) {
text: "Data Berhasil DiUbah!",
icon: "succes",
button: "ok",
}, function () {
},
function () {
location.reload();
});
......
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