Commit dd34a5e0 authored by Indra Raja's avatar Indra Raja

Merge branch 'V1.4' into 'v1.3'

V1.4

See merge request !6
parents 537a6328 faed6147
......@@ -1984,7 +1984,7 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadtotalantrianAction(){
public function loadChartAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
......@@ -1996,7 +1996,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$load = $test->loadtotalantrian();
$load = $test->loadChart($post->id);
// print_r($load);die;
if($load->code == 0){
......
......@@ -175,8 +175,8 @@ class Param extends Mapper {
$data = $this->_storage->loadterlayani();
return $data;
}
public function loadtotalantrian(){
$data = $this->_storage->loadtotalantrian();
public function loadChart($id = null){
$data = $this->_storage->loadChart($id);
return $data;
}
public function tampilpoli($id = null){
......
......@@ -514,11 +514,14 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function loadtotalantrian(){
public function loadChart($id){
$result = new Result();
try {
$sql = " SELECT count(id_dokter) FROM antrian_pasien ";
$sql = " SELECT dp.id_dokter, dp.nama_dokter,ap.id_dokter, count (ap.id_dokter) as total from antrian_pasien ap, dokter_to_poli dp
WHERE ap.id_poli = $id and dp.id_dokter = ap.id_dokter
GROUP BY dp.id_dokter, ap.id_dokter ";
// print_r($sql);die;
......@@ -794,7 +797,8 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
$result = new Result();
try {
$sql = " SELECT * FROM poli";
$sql = " SELECT * FROM poli";
......
<div class="container-fluid">
<div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Antrian Terlewat</h1>
<!-- <form class="form-inline">
<div class="form-group form-control-lg ">
<label >Pilih poli </label>
<select name="nama_poli" id="poli" class="form-control" >
<option disabled selected>Pilih </option>
</select>
</div>
<div class="form-group form-control-lg">
<label>Pilih dokter</label> <br>
<select id="dokter" name="nama_dokter" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
</form> -->
<br>
<table class="table table-bordered" id="dataTable">
<thead >
<tr>
<th style="width: 70px">NO</th>
<th colspan="" class=" thLeftText">NO Antrian Pasien</th>
<th colspan="" class=" thLeftText">Nama Pasien</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Status</th>
<th colspan="" class=" thLeftText">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Antrian Unregister</h1>
<br>
<table class="table table-bordered" id="dataTable">
<thead >
<tr>
<th style="width: 70px">NO</th>
<th colspan="" class=" thLeftText">No Rekam Medis</th>
<th colspan="" class=" thLeftText">No Induk Kependudukan (NIK)</th>
<th colspan="" class=" thLeftText">Nama Pasien</th>
<th colspan="" class=" thLeftText">No Antrian</th>
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
......@@ -80,31 +80,35 @@
<!-- Content Row -->
<div class="row">
<div class="row justify-content-center">
<!-- Pie Chart -->
<div class="col-xl-4 col-lg-5">
<div class="card shadow mb-4">
<!-- Card Header - Dropdown -->
<div class="card-header py-3 d-flex flex-row align-items-center justify-content-between">
<h6 class="m-0 font-weight-bold text-primary">Revenue Sources</h6>
<h6 class="m-0 font-weight-bold text-primary">Jumlah Antrian</h6>
<div class="dropdown no-arrow">
<a class="dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-ellipsis-v fa-sm fa-fw text-gray-400"></i>
</a>
<div id="poli" class="dropdown-menu dropdown-menu-right shadow animated--fade-in" aria-labelledby="dropdownMenuLink">
</div>
</div>
</div>
<!-- Card Body -->
<div class="card-body">
<div class="chart-pie pt-4 pb-2">
<canvas id="myPieChart"></canvas>
</div>
<div class="mt-4 text-center small">
<span class="mr-2">
<i class="fas fa-circle text-primary"></i> Direct
</span>
<span class="mr-2">
<i class="fas fa-circle text-success"></i> Social
</span>
<span class="mr-2">
<i class="fas fa-circle text-info"></i> Referral
</span>
<div id="nama_dokter" class="mt-4 text-center small">
</div>
</div>
</div>
......@@ -116,7 +120,7 @@
>
</div>
</div>
......
<!-- breadcrumb start-->
<style>
.bg-login-image {
background: url("https://source.unsplash.com/K4mSJ7kc0As/600x800");
background-position: center;
background-size: cover;
}
</style>
<hr>
<hr>
<hr>
<hr>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumb_iner">
<div class="breadcrumb_iner_item">
<h2>Deskripsi </h2>
<h2>Poli</h2>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- breadcrumb start-->
<!-- feature_part start-->
<section class="doctor_part single_page_doctor_part" style="padding:50px;">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-8">
<div class="section_tittle text-center">
<h2> Poli Kami </h2>
</div>
</div>
</div>
<div class="row">
<div class="container-fluid DP">
</div>
<div class="container-fluid">
<div class=" row justify-content-center datapoli">
</div>
</div>
</div>
</div>
</section>
<!-- feature_part start-->
......@@ -12,20 +12,20 @@ const STATUS_MISSED = 60;
/* JS comes here */
function textToAudio() {
let no_antrian = document.getElementById("no_antrian").innerHTML;
let voice = "nomor antrian " + no_antrian;
console.log(voice)
let speech = new SpeechSynthesisUtterance();
speech.lang = "id";
speech.text = voice;
speech.volume = 1;
speech.rate = 0.70;
speech.rate = 0.70;
speech.pitch = 1;
window.speechSynthesis.speak(speech);
}
......@@ -34,18 +34,18 @@ function textToAudioRuang() {
let ruang = document.getElementById("nama_ruang").innerHTML;
var res = ruang.replace(".", " ");
document.getElementById("nama_ruang").innerHTML = res;
let voice = "silahkan masuk ke " + res;
console.log(voice)
let speech = new SpeechSynthesisUtterance();
speech.lang = "id";
speech.text = voice;
speech.volume = 1;
speech.rate = 0.70;
speech.rate = 0.70;
speech.pitch = 1;
window.speechSynthesis.speak(speech);
}
......@@ -151,7 +151,7 @@ function loadantrian() {
if (result.code == 0) {
let data = result.data;
console.log(data);
console.log(data);
let counter = 1;
for (x in data) {
......@@ -186,7 +186,7 @@ function loadantrian() {
$('#dokter').on('change', function () {
loadantrian();
tampilangka();
});
......@@ -273,7 +273,7 @@ function tampilangka() {
$('#btnNext').on('click', function () {
actionqueue(noantrian + 1, 20);
loadantrian()
......@@ -281,19 +281,19 @@ $('#btnNext').on('click', function () {
$('#btnCall').on('click', function () {
actionqueue(noantrian, 30);
});
$('#btnDone').on('click', function () {
actionqueue(noantrian, 50);
});
$('#btnMissed').on('click', function () {
actionqueue(noantrian, 60);
});
$('#btnServed').on('click', function () {
actionqueue(noantrian, 40);
});
......@@ -321,7 +321,7 @@ function actionqueue(antrianno, status) {
});
$('#no_antrian').html('-');
return false;
}
if (status == 20) {
......@@ -344,28 +344,30 @@ function actionqueue(antrianno, status) {
} else if (status == 30) {
// SOound call
var flush = new Audio('../../data/tone/a1.mp3');
setTimeout(function() {
flush.play(); }, )
flush.onended = function() {
textToAudio()
setTimeout(function() {
textToAudioRuang() }, 3000)
};
swal({
setTimeout(function () {
flush.play();
})
flush.onended = function () {
textToAudio()
setTimeout(function () {
textToAudioRuang()
}, 3000)
};
swal({
title: "Call!",
text: "Sedang Melakukan Panggilan",
type: "success",
showConfirmButton: false,
timer: 14000
});
$('#btnNext').prop('disabled', true);
......
$(document).ready(function () {
$("#tanggal_lahir").change(function () {
//console.log("berubah nih!");
var x = new Date($("#tanggal_lahir").val());
var Cnow = new Date();
if (Cnow.getFullYear() < x.getFullYear()) {
bootbox.alert({
title: "<span min-height='100px'></span>",
message: "Tanggal Lahir tidak Boleh Melebihi Tanggal Hari ini!",
callback: function () {
console.log('This was logged in the callback!');
},
centerVertical: true
})
//$("#tanggal_lahir").val('');
}
});
});
$('#cetak').on('click', function (e) {
//alert("kepanggil");
e.preventDefault();
var w = window.open('', '', 'width=300,height=400');
w.document.write('<html><body><table border="" >' +
'<tr><th><h1>SELAMAT DATANG</h1><h2> Di Rumah Sakit</h2></th></tr></thead>' +
'<tbody><tr>' +
'<th><h2>ANTRIAN</h2>' +
'<h1>' + kode_dokter_cetak + + no_antrian_cetak + '</h1>' +
'<h3>Nama Pasien : ' + nama_pasien_cetak + '</h3>' +
'<h3>Poli : ' + kode_poli_cetak + '</h3>' +
'<h3>Nama Dokter : ' + nama_dokter_cetak + '</h3>' +
'</th></tr></tbody></table></body></html>');
w.window.print();
w.document.close();
w.window.onafterprint = function () {
setTimeout(function () {
w.close()
window.location.href = baseURL + "/queue/beranda"
}, 3000);
}
})
$('#tambah').on('click', function () {
SaveDataAja();
})
function SaveDataAja(param) {
let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val();
let tanggal_lahir = $('#tanggal_lahir').val();
let alamat = $('#alamat').val();
let no_hp = $('#no_hp').val();
let poli = $("#poli option:selected").attr("value");
let dokter = $('#dokter option:selected').attr("value");
let ktp = $('#ktp').val();
let no_antrian = $("input[name=antrian]:checked").val();
// console.log(no_antrian);
/* save data */
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/savedata',
data: {
iktp: ktp,
//id_pasien: param,
inama: nama,
itempat_lahir: tempat_lahir,
itanggal_lahir: tanggal_lahir,
ialamat: alamat,
ino_hp: no_hp,
ipoli: poli,
idokter: dokter,
ino_antrian: no_antrian,
},
success: function (response) {
// alert("success");
// response[data];
if (response['code'] == 0) {
let $id = response.data.id_pasien;
console.log(response.data);
// alert($id);
let $encodedId = btoa($id);
console.log($encodedId);
window.location.href = ("cetakantrian/" + $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('dadas');
}
}
});
}
loadpoli();
$('#poli').on('change', function () {
var idpoli = $('#poli').val();
console.log(idpoli);
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loaddokter',
data: {
id_poli: idpoli
},
success: function (result) {
if (result['code'] == 0) {
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_dokter + '">' + res[i].nama_dokter + '</option>';
}
$("select#dokter").removeAttr('disabled');
$("select#dokter").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 loadpoli() {
$.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#poli").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');
}
}
}
});
}
}
});
}
$('#pilihno').on('click', function () {
// let nama = $('#nama').val();
// let tempat_lahir = $('#tempat_lahir').val();
// let tanggal_lahir = $('#tanggal_lahir').val();
// let alamat = $('#alamat').val();
// let no_hp = $('#no_hp').val();
// let poli = $("#poli option:selected").attr("value");
// let dokter = $('#dokter option:selected').attr("value");
// let ktp = $('#ktp').val();
// // let $kode_poli = $("#poli option:selected").attr("code");
// let $no_antrian = $('#no_antrian').val();
// // console.log(nama);
// if (ktp == null || ktp == "") {
// bootbox.alert({ message: 'Ktp tidak boleh kosong', centerVertical: true });
// return false;
// }
// else if (nama == null || nama == "") {
// bootbox.alert({ message: 'Nama tidak boleh kosong', centerVertical: true });
// return false;
// } else if (tempat_lahir == null || tempat_lahir == "") {
// bootbox.alert({ message: 'Tempat lahir tidak boleh kosong', centerVertical: true });
// return false;
// } else if (tanggal_lahir == null || tanggal_lahir == "") {
// bootbox.alert({ message: 'Tanggal lahir tidak boleh kosong', centerVertical: true });
// return false;
// } else if (alamat == null || alamat == "") {
// bootbox.alert({ message: 'Alamat tidak boleh kosong', centerVertical: true });
// return false;
// } else if (no_hp == null || no_hp == "") {
// bootbox.alert({ message: 'No hp tidak boleh kosong', centerVertical: true });
// return false;
// }
// else if (poli == null || poli == "") {
// bootbox.alert({ message: 'Poli tidak boleh kosong', centerVertical: true });
// return false;
// }
// else if (dokter == null || dokter == "") {
// bootbox.alert({ message: 'Dokter tidak boleh kosong', centerVertical: true });
// return false;
// } else if (ktp.toString().length > 16) {
// bootbox.alert({ message: 'KTP tidak boleh lebih dari 16 angka', centerVertical: true });
// return false;
// } else if (ktp.toString().length < 16) {
// bootbox.alert({ message: 'KTP tidak boleh kurang dari 16 angka', centerVertical: true });
// return false;
// } else if (no_hp.toString().length > 13) {
// bootbox.alert({ message: 'No HP tidak boleh lebih dari 13 angka', centerVertical: true });
// return false;
// } else {
pilihAntrian()
// }
});
function pilihAntrian() {
var $dokter = $('#dokter option:selected').attr("value");
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadPilihAntrian',
data: {
iddok: $dokter,
},
success: function (response) {
console.log(response.data);
var $antrian = (response.data);
$('.antrian').empty();
// console.log($antrian);
// console.log(response);
if ($antrian) {
var hour = 0;;
var splithour = [];
splithour[0] = $antrian[0]['jam_mulai'].split(':');
hour += parseInt(splithour[0][0]);
minute = parseInt(splithour[0][1]);
for (var i = 0; i < $antrian.length; i++) {
if ($antrian[i]['id_pasien'] === null) {
let y = '';
var splittime = [];
splittime[i] = $antrian[i]['waktu_antrian'].split(':');
if (minute >= 60) {
hour += Math.floor(minute / 60);
minute = minute % 60;
}
if (minute.toString().length === 1) {
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="radio" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
<label style="text-align:center` + i + `">` + hour + ':' + '0' + minute + `</label>
</div>
</div > `;
$('.antrian').append(y);
} else {
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="radio" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
<label style="text-align:center"` + i + `">` + hour + ':' + minute + `</label>
</div>
</div > `;
$('.antrian').append(y);
}
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) {
var splittime = [];
splittime[i] = $antrian[i]['waktu_antrian'].split(':');
let y = '';
if (minute >= 60) {
hour += Math.floor(minute / 60);
minute = minute % 60;
}
if (minute.toString().length === 1) {
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="picked" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
<label for="antrian` + i + `">` + hour + ':' + '0' + minute + `</label>
</div>
</div > `;
$('.antrian').append(y);
} else {
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="picked" name="antrian" value="` + $antrian[i]['no_antrian'] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
<label for="antrian` + i + `">` + hour + ':' + minute + `</label>
</div>
</div > `;
$('.antrian').append(y);
}
minute += parseInt(splittime[i][1]);
}
else if ($antrian[i]['status_code'] == 60) {
let y = '';
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="done" name="antrian" value="` + $antrian[i] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
</div>
</div > `;
$('.antrian').append(y);
} else if ($antrian[i]['status_code'] == 50) {
var splittime = [];
splittime[i] = $antrian[i]['waktu_antrian'].split(':');
if (minute >= 60) {
hour += Math.floor(minute / 60);
minute = minute % 60;
}
let y = '';
y += `<div class="col-lg-1">
<div class="buttons" >
<input type="done" name="antrian" value="` + $antrian[i] + `" id="antrian` + i + `" />
<label for="antrian` + i + `">` + $antrian[i]['no_antrian'] + `</label>
</div>
</div > `;
$('.antrian').append(y);
minute += parseInt(splittime[i][1]);
}
}
} else {
}
},
error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('Cannot load queue');
}
}
});
}
$(document).ready(function () {
$('#close').on('click', function () {
document.getElementById("seat").innerHTML = "";
})
});
jumlahpasien();
function jumlahpasien() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadjumlahpasien',
data: {
},
success: function (result) {
// console.log(result)
var data = result.data;
// console.log(data[0].count);
$("#jumlah_pasien").html(data[0].count);
// document.getElementById("jumlah_pasien") = ;
}
});
}
pasiendalamantrian();
function pasiendalamantrian() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpasiendalamantrian',
data: {
},
success: function (result) {
// console.log(data[0].count)
var data = result.data;
// console.log(data[0].count);
$("#pasien_antrian").html(data[0].count);
// document.getElementById("jumlah_pasien") = ;
}
});
}
pasienterlewat();
function pasienterlewat() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpasienterlewat',
success: function (result) {
// console.log(data)
var data = result.data;
// console.log(data[0].count);
$("#pasien_terlewat").html(data[0].count);
// document.getElementById("jumlah_pasien") = ;
}
});
}
jumlahterlayani()
function jumlahterlayani() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadterlayani',
success: function (result) {
// console.log(data)
var data = result.data;
// console.log(data[0].count);
$("#jumlah_terlayani").html(data[0].count);
// document.getElementById("jumlah_pasien") = ;
}
});
}
\ No newline at end of file
Loadpasien();
function Loadpasien() {
// var iddokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrianmiss',
data: {
// id: iddokter
},
success: function (result) {
console.log(result);
$('table.table-bordered > tbody').empty();
// console.log(result);
if (result.code == 0) {
let data = result.data;
// console.log(data);
let counter = 1;
for (x in data) {
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="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-primary btn-xs" onClick="actionqueue(' + data[x].id_pasien + "," + data[x].id_dokter + ')">Update</span></div> </td>';
console.log(data[x].id_pasien);
newRow.append(cols);
$("table.table-bordered").append(newRow);
counter++;
// $('.loaddata').append('' + x + '<span>' + data[x].nama + '</span>');
}
} else {
bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true });
}
$('#dataTable').DataTable({
"scrollY": '500px',
"scrollX": true,
fixedHeader: true,
scrollCollapse: true,
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 50, targets: 1 },
{ width: 130, targets: 2 },
{ width: 130, targets: 3 },
{ width: 130, targets: 4 },
{ width: 130, targets: 5 },
{ width: 100, targets: 6 },
],
});
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
function actionqueue(idpasien, iddokter) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateantrianmiss',
data: {
iddok: iddokter,
iidpasien: idpasien,
},
success: function (result) {
console.log()
if (result.code == 0) {
swal({
title: "",
text: "Data Berhasil Diupdate!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Diupdate!",
icon: "succes",
button: "ok",
});
}
}
});
}
Loadunregister();
function Loadunregister() {
// var iddokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrianunregis',
// data: {
// id: iddokter
// },
success: function (result) {
// console.log(result.data);
$('table.table-bordered > tbody').empty();
// console.log(result);
if (result.code == 0) {
let data = result.data;
// console.log(data);
let counter = 1;
for (x in data) {
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_rekam_medis + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].ktp + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_antrian + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-primary btn-xs" onClick="unregister(' + data[x].id_pasien + ')">Reset</span></div> </td>';
// console.log(data[x].id_pasien);
newRow.append(cols);
$("table.table-bordered").append(newRow);
counter++;
}
$('#dataTable').DataTable({
"scrollY": '500px',
"scrollX": true,
fixedHeader: true,
scrollCollapse: true,
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 130, targets: 1 },
{ width: 130, targets: 2 },
{ width: 120, targets: 3 },
{ width: 50, targets: 4 },
{ width: 100, targets: 5 },
{ width: 100, targets: 6 },
{ width: 100, targets: 7 },
],
});
} else {
bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true });
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
function unregister(id_pasien) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateunregister',
data: {
id_pasien: id_pasien,
},
success: function (result) {
console.log()
if (result.code == 0) {
swal({
title: "",
text: "Data Berhasil Diupdate!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Diupdate!",
icon: "succes",
button: "ok",
});
}
}
});
}
\ No newline at end of file
......@@ -396,8 +396,7 @@ function loadedit(param) {
success: function (result) {
// console.log(result);
// $('.loaddata').empty();
// console.log(result);
// $('.loaddata').empty();
if (result.code == 0) {
......
loadpoli();
function loadpoli() {
// console.log(id)
//let $id_dokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/tampilpoli',
data: {
id: id
},
success: function (result) {
// console.log(result);
//console.log(result.data);
let data = result.data;
let counter = 0;
//Poli Seluruh
for (poli in data) {
var cols = "";
y = '';
y += ` <div class="col-lg-4">
<div class="card" style="height:330px;width:300px; " >
<div class="card-body text-center " >
<h5 class="card-title "> <img style="width:230px; height:200px;" src="/tamplate/img/poli/`+ data[counter]['image_poli'] + `" ></h5>
<h4 class="card-text font-weight-bold">` + `Poli ` + data[counter]['nama_poli'] + `</h4>
<h5 class="card-text">`+ `Kode Poli : ` + data[counter]['kode_poli'] + `</h5>
<a class="card-text" href="datapoli?id=`+ data[counter]['id_poli'] + `">Deskripsi Poli Klik Disini! </a>
</div>
</div>
<br>
</div>`;
counter++;
$(".poli").append(y);
}
//DOKTER
let data1 = result.data;
let counter1 = 0;
for (datapoli in data1) {
// console.log(data[counter1])
x = '';
x += `
<div class="card-hide" style="height:330px;width:200px; " >
<div class="card-body text-center " >
<h5 class="card-title "> <img style="width:180px; height:200px; " src="/tamplate/img/doctor/`+ data1[counter1]['image_dokter'] + `" ></h5>
<h4 class="card-text font-weight-bold">`+ `Nama Dokter : ` + data1[counter1]['nama_dokter'] + `</h4>
<h5 class="card-text">`+ `Kode Dokter : ` + data1[counter1]['kode_dokter'] + `</h5>
</div>
</div>`;
counter1++;
$(".datapoli").append(x);
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
loaddatapoli()
function loaddatapoli() {
// console.log(id)
//let $id_dokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/tampildatapoli',
data: {
id: id
},
success: function (result) {
let data2 = result.data;
let counter2 = 0;
z = '';
z += ` <div class="row justify-content-center">
<div class="col-xl-10 col-lg-12 col-md-9">
<div class="card " style="min-height :430px">
<div class="card-body">
<div class="row " style="min-height :400px">
<div class="col-lg-6 text-center mt-4 ">
<img style="width:300px; height:350px;" src="/tamplate/img/poli/`+ data2[counter2]['image_poli'] + `">
</div>
<div class="col-lg-6">
<div class="p-5">
<div class="text-center card-text font-weight-bold">
<h2 >` + `Poli ` + data2[counter2]['nama_poli'] + ` (` + data2[counter2]['kode_poli'] + `)` + ` </h2>
</div>
<hr>
<div class= "text-center card-text" >
<h4 >` + `Poli ` + data2[counter2]['deskripsi_poli'] + ` </h4>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<h2 class="text-center font-weight-bold">`+ `Dokter Poli ` + data2[counter2]['nama_poli'] + `</h2>
</div>
</div>
</div>
<br>
`;
counter2++;
$(".DP").append(z);
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
......@@ -2,58 +2,141 @@
Chart.defaults.global.defaultFontFamily = 'Nunito', '-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
Chart.defaults.global.defaultFontColor = '#858796';
// Pie Chart Example
// var ctx = document.getElementById("myPieChart");
// var myPieChart = new Chart(ctx, {
// type: 'doughnut',
// data: {
// labels: ["Direct", "Referral", "Social"],
// datasets: [{
// data: [55, 30, 15],
// backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc'],
// hoverBackgroundColor: ['#2e59d9', '#17a673', '#2c9faf'],
// hoverBorderColor: "rgba(234, 236, 244, 1)",
// }],
// },
// options: {
// maintainAspectRatio: false,
// tooltips: {
// backgroundColor: "rgb(255,255,255)",
// bodyFontColor: "#858796",
// borderColor: '#dddfeb',
// borderWidth: 1,
// xPadding: 15,
// yPadding: 15,
// displayColors: false,
// caretPadding: 10,
// },
// legend: {
// display: false
// },
// cutoutPercentage: 80,
// },
// });
jumlahantrian()
function jumlahantrian() {
var id = document.getElementById("myPieChart");
// Pie Chart Exampl
loadpoli()
function loadpoli() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadtotalantrian',
url: baseURL + '/api/loadRegisterPoli',
success: function (result) {
if (result.code == 0) {
let data = result.data;
y = ' <div class="dropdown-header">Poli</div>';
for (x in data) {
// console.log(data[x]['nama_poli']);
y += ` <a onclick="loadChart(` + data[x]['id_poli'] + `)" class="dropdown-item">` + data[x]['nama_poli'] + `</a>`;
}
$("#poli").append(y);
} else {
alert(result.info);
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
$(document).ready(function () {
loadChart(9)
});
function loadChart(id) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadChart',
data: {
id: id,
},
success: function (result) {
console.log(result)
}
var data = [];
var label = [];
var data1 = result.data
var nama_dokter = '';
var colour = ['primary', 'success', 'info', 'danger', 'secondary'];
});
if (result.code == 0) {
for (x in data1) {
data.push(data1[x].total);
label.push(data1[x].nama_dokter)
}
$('#nama_dokter').empty();
$('#myPieChart').empty();
for (x in label) {
nama_dokter += '<span class="mr-2"> <i class="fas fa-circle text-' + colour[x] + '"></i>' + label[x] + '</span>';
}
$('#nama_dokter').append(nama_dokter)
// console.log(data)
var ctx = document.getElementById("myPieChart");
var myPieChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: label,
datasets: [{
data: data,
backgroundColor: ['#4e73df', '#1cc88a', '#36b9cc', '#dc3545', '#6c757d'],
hoverBackgroundColor: ['#2e59d9', '#17a673', '#2c9faf', '#a60d1c', '#444a4f'],
hoverBorderColor: "rgba(234, 236, 244, 1)",
}],
},
options: {
maintainAspectRatio: false,
tooltips: {
backgroundColor: "rgb(255,255,255)",
bodyFontColor: "#858796",
borderColor: '#dddfeb',
borderWidth: 1,
xPadding: 15,
yPadding: 15,
displayColors: false,
caretPadding: 10,
},
legend: {
display: false
},
cutoutPercentage: 80,
},
});
} else {
var ctx = document.getElementById("myPieChart");
$('#nama_dokter').empty();
var myPieChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: null,
data: null,
},
});
bootbox.alert({ message: 'Data Kosong', centerVertical: true });
}
},
error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('gagal error');
}
}
});
}
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