Commit 10fccefe authored by Azy Mushofy Anwary's avatar Azy Mushofy Anwary

cetakk

parent 823eb81e
......@@ -35,12 +35,12 @@ $('#cetak').on('click', function (e) {
'</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);
w.window.onafterprint = function () {
setTimeout(function () {
w.close()
window.location.href = baseURL + "/queue/beranda"
}, 3000);
}
})
......@@ -87,9 +87,9 @@ function SaveDataAja(param) {
success: function (response) {
// alert("success");
// response[data];
if (response['code'] == 0) {
let $id = response.data.id_pasien;
let $id = response.data.id_pasien;
console.log(response.data);
// alert($id);
let $encodedId = btoa($id);
......@@ -273,94 +273,94 @@ function pilihAntrian() {
// console.log($antrian);
// console.log(response);
if ($antrian) {
var hour=0;;
var splithour=[];
splithour[0]= $antrian[0]['jam_mulai'].split(':');
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(':');
var splittime = [];
splittime[i] = $antrian[i]['waktu_antrian'].split(':');
if (minute >= 60) {
hour += Math.floor(minute/60);
minute = minute % 60;
hour += Math.floor(minute / 60);
minute = minute % 60;
}
if(minute.toString().length ===1){
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>
<label style="text-align:center` + i + `">` + hour + ':' + '0' + minute + `</label>
</div>
</div > `;
$('.antrian').append(y);
}else{
} 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>
<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(':');
} 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;
hour += Math.floor(minute / 60);
minute = minute % 60;
}
if(minute.toString().length ===1){
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>
<label for="antrian` + i + `">` + hour + ':' + '0' + minute + `</label>
</div>
</div > `;
$('.antrian').append(y);
}else{
} 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>
<label for="antrian` + i + `">` + hour + ':' + minute + `</label>
</div>
</div > `;
$('.antrian').append(y);
}
minute += parseInt(splittime[i][1]);
}
else if ( $antrian[i]['status_code']==60){
else if ($antrian[i]['status_code'] == 60) {
let y = '';
y += `<div class="col-lg-1">
<div class="buttons" >
......@@ -370,20 +370,20 @@ function pilihAntrian() {
</div>
</div > `;
$('.antrian').append(y);
} else if ( $antrian[i]['status_code']==50){
} else if ($antrian[i]['status_code'] == 50) {
var splittime = [];
splittime[i] = $antrian[i]['waktu_antrian'].split(':');
var splittime=[];
splittime[i]= $antrian[i]['waktu_antrian'].split(':');
if (minute >= 60) {
hour += Math.floor(minute/60);
minute = minute % 60;
hour += Math.floor(minute / 60);
minute = minute % 60;
}
let y = '';
y += `<div class="col-lg-1">
<div class="buttons" >
......@@ -400,7 +400,7 @@ function pilihAntrian() {
}
} else {
}
},
error: function (xhr) {
......
......@@ -14,7 +14,12 @@ $('#cetak').on('click', function (e) {
'</th></tr></tbody></table></body></html>');
w.window.print();
w.document.close();
return false;
w.window.onafterprint = function () {
setTimeout(function () {
w.close()
window.location = baseURL + "/queue/beranda"
}, 3000);
}
})
\ No newline at end of file
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