kodcaw
This commit is contained in:
@@ -124,18 +124,15 @@
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-7">
|
||||
<div class="input-group my-3" id="otp_form">
|
||||
<form action="{{ route('customer.otp') }}" method="post">
|
||||
@csrf
|
||||
<input type="text" class="form-control" name="noic_otp" readonly placeholder="No Kad Pengenalan Pelanggan" id="noic_otp" aria-label="No Kad Pengenalan Pelanggan" autocomplete="off" value="" aria-describedby="button-addon2">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="submit" id="jana_otp">Jana OTP</button>
|
||||
</div>
|
||||
</form>
|
||||
<input type="text" class="form-control" name="noic_otp" readonly placeholder="No Kad Pengenalan Pelanggan" id="noic_otp" aria-label="No Kad Pengenalan Pelanggan" autocomplete="off" value="" aria-describedby="button-addon2">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-primary" type="button" id="jana_otp">Jana OTP</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="otp_generate" style="display:none;">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-4">
|
||||
OTP Token
|
||||
OTP Token :
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<span id="otp_number"></span>
|
||||
@@ -446,27 +443,36 @@
|
||||
$('#opt_modal').modal('show');
|
||||
});
|
||||
|
||||
// $('#jana_otp').click(function(){
|
||||
// var noic = $('#noic_otp').val();
|
||||
$('#jana_otp').click(function(){
|
||||
var noic = $('#noic_otp').val();
|
||||
|
||||
// $.ajax({
|
||||
// method:'get',
|
||||
// url: "{{ route('customer.otp') }}",
|
||||
// data:{
|
||||
// 'noic' : noic
|
||||
// },
|
||||
// success: function(otp_token){
|
||||
// console.log(otp_token);
|
||||
// // $('#otp_form').hide();
|
||||
// // $('#otp_generate').show();
|
||||
// // $('#otp_number').text();
|
||||
// },
|
||||
// error: function(xhRequest, ErrorText, thrownError){
|
||||
// alert('Gadai Tidak Berjaya');
|
||||
// console.log(xhRequest);
|
||||
// }
|
||||
// });
|
||||
// })
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: "{{ route('customer.otp') }}",
|
||||
data:{
|
||||
'noic' : noic
|
||||
},
|
||||
dataType:'json',
|
||||
success: function(otp_token){
|
||||
console.log(otp_token['error']);
|
||||
if(otp_token['error']){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran!',
|
||||
text: otp_token['error']
|
||||
});
|
||||
}else if(otp_token['otp']){
|
||||
$('#otp_form').hide();
|
||||
$('#otp_generate').show();
|
||||
$('#otp_number').text(otp_token['otp']);
|
||||
}
|
||||
},
|
||||
error: function(xhRequest, ErrorText, thrownError){
|
||||
// alert('Gadai Tidak Berjaya');
|
||||
console.log(xhRequest);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user