Commit 45eb06fd authored by Azy Mushofy Anwary's avatar Azy Mushofy Anwary

Baru

parent f41e1573
......@@ -236,7 +236,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$id_antrian = $register->data[0]['id_antrian'];
$whereidantrian = 'id_antrian='.$id_antrian;
// print_r($id_antrian);die;
// print_r($register);die;
$param->updateGlobal($table_antrianpasien, $dataArrayAntrianPasien , $whereidantrian);
......
......@@ -220,16 +220,28 @@ function validasipasien(id_poli, dokter, id_pasien) {
id_pasien: id_pasien
},
success: function (result) {
console.log(dokter)
// console.log(dokter)
var data = result.data;
for (x in data) {
if (id_pasien == data[x]['id_pasien']) {
if (id_poli == data[x]['id_poli']) {
if (dokter == data[x]['id_dokter']) {
let $idantrian = result.data[0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian)
let nama = result.data[0]['nama'];
swal({
title: "Pasien dengan nama'" + nama + "' telah melakukan pendaftaran di poli dan dokter ini! \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "warning",
confirmButtonClass: "success",
confirmButtonText: "Yes!",
showCancelButton: true,
}, function () {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
exist = 1;
}
}
......@@ -277,23 +289,11 @@ function pilihAntrian(id_poli) {
success: function (response) {
var $antrian = (response.data);
// console.log(validasipasien(id_poli, dokter, id_pasien) == 1);
if (validasipasien(id_poli, dokter, id_pasien) == 1) {
let $idantrian = response.data[0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian)
if (validasipasien(id_poli, dokter, id_pasien) == 1) {
// console.log(validasipasien(id_poli, dokter, id_pasien))
let nama = response.data[0]['nama'];
swal({
title: "Pasien dengan nama'" + nama + "' telah melakukan pendaftaran di poli dan dokter ini! \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error",
confirmButtonClass: "success",
confirmButtonText: "Yes!",
showCancelButton: true,
}, function () {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
} else {
if ($antrian) {
var hour = 0;
......
......@@ -72,6 +72,27 @@ function Loadpasien() {
}
function actionqueue(idpasien, iddokter) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrianmiss',
data: {
iidpasien: idpasien,
},
success: function (result) {
// console.log(result);
let nama = result.data[0].nama;
let no = result.data[0].no_antrian;
let poli = result.data[0].nama_poli;
let dokter = result.data[0].nama_dokter;
swal({
title: "Apakah yakin mengupdate data antrian dengan Nama '" + nama + "' di Poli '" + poli + "' dan Nama Dokter '" + dokter + "' ? ",
type: "warning",
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes!",
showCancelButton: true,
},
function () {
$.ajax({
type: 'POST',
dataType: 'json',
......@@ -101,6 +122,12 @@ function actionqueue(idpasien, iddokter) {
});
}
}
});
}
);
}
});
}
......@@ -76,6 +76,27 @@ function Loadunregister() {
}
function unregister(id_pasien) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrianunregis',
data: {
id_pasien: id_pasien,
},
success: function (result) {
// console.log(result);
let nama = result.data[0].nama;
let no = result.data[0].no_antrian;
let poli = result.data[0].nama_poli;
let dokter = result.data[0].nama_dokter;
swal({
title: "Apakah yakin mereset data antrian dengan Nama '" + nama + "' di Poli '" + poli + "' dan Nama Dokter '" + dokter + "' dengan No Antrian '" + no + "' ?",
type: "warning",
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes!",
showCancelButton: true,
},
function () {
$.ajax({
type: 'POST',
dataType: 'json',
......@@ -105,6 +126,11 @@ function unregister(id_pasien) {
});
}
}
});
}
);
}
});
}
......@@ -470,15 +470,8 @@ function Delete(param) {
button: "ok",
});
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
},
function () {
// This function will run if the user clicked "cancel"
window.location.href = "<?php echo Yii::$app->request->baseUrl;?>/todo/index/";
}
);
......
......@@ -342,7 +342,7 @@ function SaveDataRegister(param) {
if (result.code == 0) {
$('#addData').modal('hide');
swal({
title: "<span style='color:#222'>Good Job!</span>",
title: "<span style='color:#222'>Berhasil!</span>",
confirmButtonColor: "#66BB6A",
html: true,
type: "success"
......
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