diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php index e03324d..15b7659 100644 --- a/resources/views/gadaian/index.blade.php +++ b/resources/views/gadaian/index.blade.php @@ -1025,9 +1025,7 @@ } }); } - } - } diff --git a/resources/views/khazanah/gadaian.blade.php b/resources/views/khazanah/gadaian.blade.php index a4e5a8d..b1670d8 100644 --- a/resources/views/khazanah/gadaian.blade.php +++ b/resources/views/khazanah/gadaian.blade.php @@ -224,6 +224,8 @@ }) function checkserah(func){ + event.preventDefault(); + return false; var norujukan = $('#norujukan_barcode').val(); $.ajax({ method:'get', @@ -235,6 +237,8 @@ }, success:function(data){ if(data == 'true'){ + event.preventDefault(); + return false; Swal.fire({ icon: 'error', title: 'Amaran', @@ -248,11 +252,5 @@ } }); } - - $('#norujukan_barcode').keyup(function(){ - if(this.value.length >= 14){ - $('#submit_button').submit(); - } - }); @endsection diff --git a/resources/views/khazanah/tebus.blade.php b/resources/views/khazanah/tebus.blade.php index a9fad55..d4c8eb3 100644 --- a/resources/views/khazanah/tebus.blade.php +++ b/resources/views/khazanah/tebus.blade.php @@ -52,13 +52,11 @@
-
+ @csrf - -
@@ -75,12 +73,6 @@ - {{-- --}}
@@ -203,8 +195,37 @@ var table_gadaian_semasa = $('#table-gadaian-semasa').DataTable({ }); }); }); - }); + function checkserah(func){ + event.preventDefault(); + return false; + var norujukan = $('#norujukan_barcode').val(); + $.ajax({ + method:'get', + url: api_url + '/api/check/serah/gadai', + datatype:'json', + data:{ + 'kodcaw': "{{ $cawangan_info['kodcaw'] }}", + 'norujukan': norujukan + }, + success:function(data){ + if(data == 'true'){ + event.preventDefault(); + return false; + Swal.fire({ + icon: 'error', + title: 'Amaran', + text: 'Gadaian Sudah Scan' + }); + }else if(data == 'false'){ + $(func).attr("onSubmit","return true;"); + $(func).submit(); + return true; + } + } + }); + } + @endsection