Files
kaunter/resources/views/errors/alert.blade.php
T
2025-07-02 12:10:03 +08:00

43 lines
1.5 KiB
PHP

@if($errorapproval)
<script>
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
})
getPusherResponse();
async function getPusherResponse(){
let api_url = "<?php echo $api_url ?>";
const jsonData = {
norujukan: "{{ $errorapproval['norujukan'] }}",
kodcaw: "{{ Auth::user()->cawangan }}",
};
const queryString = new URLSearchParams(jsonData).toString();
let ansuranlatest = await fetch(api_url + '/admin/ansuran/getLatest?' + queryString)
.then(response => response.json())
.then(response => {return response});
console.log("Ansuran Latest:", ansuranlatest);
console.log("{{ $errorapproval['norujukan'] }}","{{ $errorapproval['siri'] }}",ansuranlatest['created_at'],ansuranlatest['id']);
try{
let pusherresponse = await PusherResponse("{{ $errorapproval['norujukan'] }}","{{ $errorapproval['siri'] }}",ansuranlatest['created_at'],ansuranlatest['id']);
}catch(error){
console.error("Error:", error);
}
}
</script>
@endif