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

cetakk

parent 823eb81e
......@@ -35,9 +35,9 @@ $('#cetak').on('click', function (e) {
'</th></tr></tbody></table></body></html>');
w.window.print();
w.document.close();
w.window.onafterprint = function(){
w.window.onafterprint = function () {
setTimeout(function() {
setTimeout(function () {
w.close()
window.location.href = baseURL + "/queue/beranda"
}, 3000);
......@@ -273,10 +273,10 @@ function pilihAntrian() {
// console.log($antrian);
// console.log(response);
if ($antrian) {
var hour=0;;
var hour = 0;;
var splithour=[];
splithour[0]= $antrian[0]['jam_mulai'].split(':');
var splithour = [];
splithour[0] = $antrian[0]['jam_mulai'].split(':');
......@@ -291,31 +291,31 @@ function pilihAntrian() {
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);
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);
......@@ -324,34 +324,34 @@ function pilihAntrian() {
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);
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);
......@@ -359,7 +359,7 @@ function pilihAntrian() {
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">
......@@ -370,17 +370,17 @@ 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);
hour += Math.floor(minute / 60);
minute = minute % 60;
}
......
......@@ -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