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)
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);
});
// console.log(validasipasien(id_poli, dokter, id_pasien))
} else {
if ($antrian) {
var hour = 0;
......
......@@ -75,32 +75,59 @@ function actionqueue(idpasien, iddokter) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateantrianmiss',
url: baseURL + '/api/loadantrianmiss',
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();
});
// 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',
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",
});
}
}
} else {
swal({
title: "",
text: "Data Gagal Diupdate!",
icon: "succes",
button: "ok",
});
}
}
});
}
);
}
});
}
......@@ -79,32 +79,58 @@ function unregister(id_pasien) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateunregister',
url: baseURL + '/api/loadantrianunregis',
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();
});
// 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',
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) {
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