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 { ...@@ -236,7 +236,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$id_antrian = $register->data[0]['id_antrian']; $id_antrian = $register->data[0]['id_antrian'];
$whereidantrian = 'id_antrian='.$id_antrian; $whereidantrian = 'id_antrian='.$id_antrian;
// print_r($id_antrian);die; // print_r($register);die;
$param->updateGlobal($table_antrianpasien, $dataArrayAntrianPasien , $whereidantrian); $param->updateGlobal($table_antrianpasien, $dataArrayAntrianPasien , $whereidantrian);
......
...@@ -220,16 +220,28 @@ function validasipasien(id_poli, dokter, id_pasien) { ...@@ -220,16 +220,28 @@ function validasipasien(id_poli, dokter, id_pasien) {
id_pasien: id_pasien id_pasien: id_pasien
}, },
success: function (result) { success: function (result) {
console.log(dokter) // console.log(dokter)
var data = result.data; var data = result.data;
for (x in data) { for (x in data) {
if (id_pasien == data[x]['id_pasien']) { if (id_pasien == data[x]['id_pasien']) {
if (id_poli == data[x]['id_poli']) { if (id_poli == data[x]['id_poli']) {
if (dokter == data[x]['id_dokter']) { 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; exist = 1;
} }
} }
...@@ -277,23 +289,11 @@ function pilihAntrian(id_poli) { ...@@ -277,23 +289,11 @@ function pilihAntrian(id_poli) {
success: function (response) { success: function (response) {
var $antrian = (response.data); var $antrian = (response.data);
// console.log(validasipasien(id_poli, dokter, id_pasien) == 1);
if (validasipasien(id_poli, dokter, id_pasien) == 1) { if (validasipasien(id_poli, dokter, id_pasien) == 1) {
let $idantrian = response.data[0]['id_antrian']; // console.log(validasipasien(id_poli, dokter, id_pasien))
let $encodedIdantrian = btoa($idantrian)
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 { } else {
if ($antrian) { if ($antrian) {
var hour = 0; var hour = 0;
......
...@@ -75,32 +75,59 @@ function actionqueue(idpasien, iddokter) { ...@@ -75,32 +75,59 @@ function actionqueue(idpasien, iddokter) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/updateantrianmiss', url: baseURL + '/api/loadantrianmiss',
data: { data: {
iddok: iddokter,
iidpasien: idpasien, iidpasien: idpasien,
}, },
success: function (result) { success: function (result) {
console.log() // console.log(result);
if (result.code == 0) { let nama = result.data[0].nama;
swal({ let no = result.data[0].no_antrian;
title: "", let poli = result.data[0].nama_poli;
text: "Data Berhasil Diupdate!", let dokter = result.data[0].nama_dokter;
icon: "succes", swal({
button: "ok", title: "Apakah yakin mengupdate data antrian dengan Nama '" + nama + "' di Poli '" + poli + "' dan Nama Dokter '" + dokter + "' ? ",
}, function () { type: "warning",
location.reload(); confirmButtonClass: "btn-danger",
}); confirmButtonText: "Yes!",
showCancelButton: true,
},
function () {
$.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 { } else {
swal({ swal({
title: "", title: "",
text: "Data Gagal Diupdate!", text: "Data Gagal Diupdate!",
icon: "succes", icon: "succes",
button: "ok", button: "ok",
}); });
} }
} }
});
}
);
}
}); });
} }
...@@ -79,32 +79,58 @@ function unregister(id_pasien) { ...@@ -79,32 +79,58 @@ function unregister(id_pasien) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
dataType: 'json', dataType: 'json',
url: baseURL + '/api/updateunregister', url: baseURL + '/api/loadantrianunregis',
data: { data: {
id_pasien: id_pasien, id_pasien: id_pasien,
}, },
success: function (result) { success: function (result) {
console.log() // console.log(result);
if (result.code == 0) { let nama = result.data[0].nama;
swal({ let no = result.data[0].no_antrian;
title: "", let poli = result.data[0].nama_poli;
text: "Data Berhasil Direset!", let dokter = result.data[0].nama_dokter;
icon: "succes", swal({
button: "ok", title: "Apakah yakin mereset data antrian dengan Nama '" + nama + "' di Poli '" + poli + "' dan Nama Dokter '" + dokter + "' dengan No Antrian '" + no + "' ?",
}, function () { type: "warning",
location.reload(); confirmButtonClass: "btn-danger",
}); confirmButtonText: "Yes!",
showCancelButton: true,
},
function () {
$.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 Direset!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Direset!",
icon: "succes",
button: "ok",
});
}
}
});
}
);
} else {
swal({
title: "",
text: "Data Gagal Direset!",
icon: "succes",
button: "ok",
});
}
} }
}); });
}
\ No newline at end of file }
...@@ -470,15 +470,8 @@ function Delete(param) { ...@@ -470,15 +470,8 @@ function Delete(param) {
button: "ok", 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) { ...@@ -342,7 +342,7 @@ function SaveDataRegister(param) {
if (result.code == 0) { if (result.code == 0) {
$('#addData').modal('hide'); $('#addData').modal('hide');
swal({ swal({
title: "<span style='color:#222'>Good Job!</span>", title: "<span style='color:#222'>Berhasil!</span>",
confirmButtonColor: "#66BB6A", confirmButtonColor: "#66BB6A",
html: true, html: true,
type: "success" 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