branch aku jah deh

This commit is contained in:
hafifierahman
2021-01-05 09:55:06 +08:00
parent b533e2de7d
commit c7704e0741
26 changed files with 3082 additions and 475 deletions
+118 -9
View File
@@ -60,8 +60,8 @@
</div>
<div class="card">
<div class="card-body">
<form action="{{ route('gadai.store') }}" method='post' onsubmit="verifyGadai()">
<!-- <form action="{{ route('gadai.store') }}" method='post'> -->
<form name="gadaistore" action="{{ route('gadai.store') }}" method='post' onsubmit="verifyGadai(this)">
{{-- <!-- <form action="{{ route('gadai.store') }}" method='post'> --> --}}
@csrf
<div class="col-12 form-group row">
<div class="col-md-4">
@@ -519,7 +519,7 @@
});
})
function verifyGadai(){
function verifyGadai(func){
var kodcaw = $('#kodcaw').val();
var nokp = $('#nokp').val();
var nopelanggan = $('#nopelanggan').val();
@@ -533,6 +533,9 @@
var pembiyaan_max_pelulus = $('#pembiyaan_max_pelulus').val();
var pembiyaan_max_pelulus = Number(pembiyaan_max_pelulus.replace(/[^0-9.-]+/g,""));
var min_pinjaman = nilai_marhun_total * 0.10;
if(pinjaman < min_pinjaman){
Swal.fire({
icon: 'error',
@@ -552,13 +555,119 @@
event.preventDefault();
return false;
}else if(pinjaman > Number(pembiayaan_max_teller)+10){
Swal.fire({
icon: 'error',
title: 'Amaran!',
text: 'Pembiayaan Memerlukan Kelulusan Khazanah'
const swalWithBootstrapButtons = Swal.mixin
({
customClass: {
confirmButton: 'btn btn-success',
cancelButton: 'btn btn-danger'
},
buttonsStyling: false
})
swalWithBootstrapButtons.fire({
title: 'Dapatkan Pengesahan Daripada Khazanah?',
text: "Tetapan margin melebihi 70% untuk Khazanah!",
icon: 'info',
showCancelButton: true,
confirmButtonText: 'Setuju!',
cancelButtonText: 'Batal',
reverseButtons: true
}).then((result) => {
if (result.isConfirmed) {
let norujukan = $('#norujukan').val();
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
})
$.ajax({
method:'post',
url: "{{ route('khazanah.createkelulusan') }}",
data: {
"_token": "{{ csrf_token() }}",
"norujukan" : norujukan
// "teller" : teller,
// "dategadai" : dategadai,
// "bilgadai" : noic,
// "jumpinjam" : jumpinjam,
// "teller" : teller
},
success:function(data){
console.log(data);
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
//TIME INTERVAL
let timerInterval;
timerInterval = setInterval(function()
{
$.ajax({
method:'get',
url: "{{ route('khazanah.getkelulusan') }}",
data: {
"norujukan" : norujukan
},
success:function(data){
if(data != '')
{
clearInterval(timerInterval);
Swal.fire({
icon: 'success',
title: 'Anda Berjaya Menerima Pengesahan'
}).then(function(){
$(func).attr("onSubmit","return true;");
$(func).submit();
return true;
});
}
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
}, 3000);
} else if (
/* Read more about handling dismissals below */
result.dismiss === Swal.DismissReason.cancel
) {
swalWithBootstrapButtons.fire(
'Cancelled',
'Your imaginary file is safe :)',
'error'
)
}
});
event.preventDefault();
return false;
event.preventDefault();
return false;
}
}
Swal.fire({