update
This commit is contained in:
@@ -376,7 +376,6 @@ $(document).ready(function() {
|
|||||||
var daftar = button.data('daftar') || '-';
|
var daftar = button.data('daftar') || '-';
|
||||||
var nofoto = button.data('nofoto') || '-';
|
var nofoto = button.data('nofoto') || '-';
|
||||||
var statusAwal = button.data('status') || '-';
|
var statusAwal = button.data('status') || '-';
|
||||||
|
|
||||||
swal({
|
swal({
|
||||||
title: 'Konfirmasi Pembatalan',
|
title: 'Konfirmasi Pembatalan',
|
||||||
text: 'Apakah anda yakin merubah status untuk pemeriksaan ' + reques + ' untuk nama ' + nmpasien + ' yang di order pada ' + daftar + ' dengan accession number ' + nofoto + ' dengan status awal ' + statusAwal + ' ?',
|
text: 'Apakah anda yakin merubah status untuk pemeriksaan ' + reques + ' untuk nama ' + nmpasien + ' yang di order pada ' + daftar + ' dengan accession number ' + nofoto + ' dengan status awal ' + statusAwal + ' ?',
|
||||||
@@ -385,13 +384,22 @@ $(document).ready(function() {
|
|||||||
confirmButtonColor: '#d33',
|
confirmButtonColor: '#d33',
|
||||||
confirmButtonText: 'Ya, batalkan',
|
confirmButtonText: 'Ya, batalkan',
|
||||||
cancelButtonText: 'Tidak'
|
cancelButtonText: 'Tidak'
|
||||||
}, function(isConfirm) {
|
}).then(function(result) {
|
||||||
|
var confirmed = false;
|
||||||
|
if (typeof result === 'boolean') {
|
||||||
|
confirmed = result;
|
||||||
|
} else if (result) {
|
||||||
|
confirmed = !!(result.value || result.isConfirmed);
|
||||||
|
}
|
||||||
|
if (!confirmed) return;
|
||||||
|
|
||||||
|
button.prop('disabled', true);
|
||||||
$.post('{{ url("dashboard/early-warning") }}/' + id + '/cancel', { _token: '{{ csrf_token() }}' }, function (data) {
|
$.post('{{ url("dashboard/early-warning") }}/' + id + '/cancel', { _token: '{{ csrf_token() }}' }, function (data) {
|
||||||
swal({
|
swal({
|
||||||
title: data.status || 'Sukses',
|
title: data.status || 'Sukses',
|
||||||
text: data.message || 'Status berhasil diperbarui.',
|
text: data.message || 'Status berhasil diperbarui.',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
}, function () {
|
}).then(function () {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
}).fail(function (xhr) {
|
}).fail(function (xhr) {
|
||||||
@@ -401,53 +409,55 @@ $(document).ready(function() {
|
|||||||
text: response.message || 'Tidak dapat memperbarui status pemeriksaan.',
|
text: response.message || 'Tidak dapat memperbarui status pemeriksaan.',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
});
|
});
|
||||||
|
}).always(function () {
|
||||||
|
button.prop('disabled', false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$("#btnsimpanfoto").click(function(){
|
$("#btnsimpanfoto").click(function(){
|
||||||
var filegambar = document.getElementById('upload_file');
|
var filegambar = document.getElementById('upload_file');
|
||||||
$('#modalupdatefoto').modal('hide');
|
$('#modalupdatefoto').modal('hide');
|
||||||
var form_data = new FormData();
|
var form_data = new FormData();
|
||||||
form_data.append('file', filegambar.files[0]);
|
form_data.append('file', filegambar.files[0]);
|
||||||
form_data.append('_token', '{{csrf_token()}}');
|
form_data.append('_token', '{{csrf_token()}}');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '{{ url("user/updatefoto") }}',
|
url: '{{ url("user/updatefoto") }}',
|
||||||
data: form_data,
|
data: form_data,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
contentType: false,
|
contentType: false,
|
||||||
processData: false,
|
processData: false,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var status = data.status;
|
var status = data.status;
|
||||||
var message = data.message;
|
var message = data.message;
|
||||||
if (status == 'Failed'){
|
if (status == 'Failed'){
|
||||||
swal({
|
|
||||||
title: status,
|
|
||||||
text: message,
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
}else {
|
|
||||||
$("html, body").animate({ scrollTop: 0 }, "slow");
|
|
||||||
$.toast({
|
|
||||||
heading: status,
|
|
||||||
text: message,
|
|
||||||
position: 'top-right',
|
|
||||||
loaderBg: '#5ba035',
|
|
||||||
icon: 'success',
|
|
||||||
hideAfter: 15000,
|
|
||||||
stack: 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
error: function (xhr, status, error) {
|
|
||||||
swal({
|
swal({
|
||||||
title: status,
|
title: status,
|
||||||
text: error,
|
text: message,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
})
|
||||||
}
|
}else {
|
||||||
});
|
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||||||
|
$.toast({
|
||||||
|
heading: status,
|
||||||
|
text: message,
|
||||||
|
position: 'top-right',
|
||||||
|
loaderBg: '#5ba035',
|
||||||
|
icon: 'success',
|
||||||
|
hideAfter: 15000,
|
||||||
|
stack: 1
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
swal({
|
||||||
|
title: status,
|
||||||
|
text: error,
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endpush
|
@endpush
|
||||||
Reference in New Issue
Block a user