fix all the bug
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
<div class="col-md-12 text-center">
|
||||
<form target="_blank" action="{{ route('printsag') }}" id="print_submit" method="post">
|
||||
@csrf
|
||||
<input hidden value="gadaiansemasa" name="jenisprint">
|
||||
<input type="text" hidden name="norujukan_modal" id="norujukan_modal">
|
||||
<input type="text" hidden name="pinjaman_modal" id="pinjaman_modal">
|
||||
<input type="submit" class="btn btn-primary" id="cetak_sag" value="Cetak SAG">
|
||||
@@ -79,6 +80,20 @@
|
||||
<tbody id="belum_serah">
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-12 text-center">
|
||||
<form target="_blank" action="{{ route('printsag') }}" id="print_submit_belum_serah" method="post">
|
||||
@csrf
|
||||
<input type="text" hidden name="norujukan_modal" id="norujukan_modal1">
|
||||
<input type="text" hidden name="pinjaman_modal" id="pinjaman_modal1">
|
||||
<input type="button" class="btn btn-primary" id="cetak_sag_belum_serah" value="Cetak SAG">
|
||||
</form>
|
||||
</div>
|
||||
<!-- <div class="col-md-6">
|
||||
<button class="btn btn-primary" id="pembelian_komuditi">Pembelian Komuditi</button>
|
||||
<a href="" id="pembelian_komuditi" class="btn btn-primary">Pembelian Komuditi</a>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal footer -->
|
||||
@@ -178,7 +193,7 @@
|
||||
@php
|
||||
$marhun = Http::get($api_url . '/api/marhun/' . $gadaian['norujukan'] )->json();
|
||||
@endphp
|
||||
<a href="#" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-norujukan="{{$gadaian['norujukan']}}" data-hargajualan="{{$gadaian['hargajualan']}}" data-kodcaw="{{ $gadaian['kodcaw'] }}" data-target="#belum_serah_modal"> {{$gadaian['norujukan']}}</a>
|
||||
<a href="#" data-toggle="modal" data-marhun="{{ json_encode($marhun) }}" data-pinjaman="{{$gadaian['pinjaman']}}" data-norujukan="{{$gadaian['norujukan']}}" data-hargajualan="{{$gadaian['hargajualan']}}" data-kodcaw="{{ $gadaian['kodcaw'] }}" data-target="#belum_serah_modal"> {{$gadaian['norujukan']}}</a>
|
||||
</td>
|
||||
<td>{{ number_format($gadaian['pinjaman'],2) }}</td>
|
||||
<td>{{ number_format($gadaian['nilaimarhun'],2) }}</td>
|
||||
@@ -269,7 +284,10 @@
|
||||
var hargajualan = button.data('hargajualan');
|
||||
var pinjaman = button.data('pinjaman');
|
||||
|
||||
$('#tablemarhun').empty();
|
||||
$('#norujukan_modal1').val(norujukan);
|
||||
$('#pinjaman_modal1').val(pinjaman);
|
||||
|
||||
$('#belum_serah').empty();
|
||||
$.each(arraymarhun,function(index,marhun){
|
||||
$.each(marhun, function(index2,marhun_detail){
|
||||
var marhun_name;
|
||||
@@ -331,5 +349,105 @@
|
||||
$("#btn-serah").prop('disabled', true);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#cetak_sag_belum_serah', function(e) {
|
||||
|
||||
let norujukan = $('#norujukan_modal1').val();
|
||||
let mohon = "Print SAG";
|
||||
|
||||
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success ml-1',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
});
|
||||
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Dapatkan Pengesahan Daripada Khazanah?',
|
||||
text: "Cetak SAG Semula!",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Setuju!',
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if(result.isConfirmed) {
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '6em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: '{{ route("teller.createkelulusan") }}',
|
||||
data: {
|
||||
"_token" : "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan,
|
||||
"mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
console.log("created");
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//TIME INTERVAL
|
||||
let timerInterval;
|
||||
|
||||
timerInterval = setInterval(function(){
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('teller.getkelulusan') }}",
|
||||
data: {
|
||||
"norujukan" : norujukan
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data);
|
||||
if(data != 0){
|
||||
console.log('berjaya');
|
||||
clearInterval(timerInterval);
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Anda Berjaya Menerima Pengesahan'
|
||||
}).then(function(){
|
||||
$("#print_submit_belum_serah").submit();
|
||||
});
|
||||
}
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
}, 3000);
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel) {
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Cancelled',
|
||||
'Your imaginary file is safe :)',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user