fix skit2
This commit is contained in:
@@ -199,6 +199,40 @@
|
||||
|
||||
function bayarantuntubaki()
|
||||
{
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
});
|
||||
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Dapatkan Pengesahan Khazanah',
|
||||
text: "Tuntutan Baki Pelanggan!",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Hantar',
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if(result.isConfirmed) {
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
let mohon = "Tuntut Baki Lelongan";
|
||||
|
||||
|
||||
let norujukan = $('#norujukan').val();
|
||||
let api = "{{ config('api.url') }}";
|
||||
let nowakil = 0;
|
||||
@@ -216,6 +250,40 @@
|
||||
let cajlain = 0.00; let cajlelong = $('#cajlelong').val();
|
||||
let jumlah = $('#jumlah').val();let hargajual = $('#hargajual').val();
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: '{{ route("teller.createkelulusan") }}',
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan,
|
||||
"mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
var pusher = new Pusher('26b0ec2f297f94b7aa9b', {
|
||||
cluster: 'ap1',
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
var channel = pusher.subscribe('notice-ubahhapus');
|
||||
channel.bind('my-ubahhapus', function(data) {
|
||||
|
||||
console.log(data);
|
||||
|
||||
|
||||
if(data.norujukan == norujukan)
|
||||
{
|
||||
if(data.kelulusan == 'lulus')
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Telah Disahkan'
|
||||
}).then(function(){
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
@@ -250,8 +318,31 @@
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
});
|
||||
}
|
||||
else if(data.kelulusan == 'batal')
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Telah Dibatalkan',
|
||||
text: `Komen : ${data.komen}`
|
||||
}).then(function(){
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel){
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Batal',
|
||||
'Tidak Berjaya Mendaptkan Pengesahan Khazanah',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user