diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php
index dac70c6..45c31f6 100644
--- a/resources/views/customers/info.blade.php
+++ b/resources/views/customers/info.blade.php
@@ -37,7 +37,14 @@
No Kad Pengenalan
-
+ @php
+ if($customer_info['kpbaru'] != null){
+ $noic = $customer_info['kpbaru'];
+ }else{
+ $noic = $customer_info['kplama'];
+ }
+ @endphp
+
@@ -404,6 +411,9 @@
var api_url = "";
var kodcaw = "{{ $cawangan_info['kodcaw'] }}";
$('#daftar_gadai').on('click',function(){
+ var noic = $('#noic').val();
+ var iclama = "{{ $customer_info['kplama'] }}";
+ var icbaru = "{{ $customer_info['kpbaru'] }}";
event.preventDefault();
$.ajax({
method:'get',
@@ -429,7 +439,11 @@
return false;
}
else{
- window.location.href = "{{ route('gadaian',['noic'=>$customer_info['kpbaru'] ]) }}";
+ if(icbaru.length > 0){
+ window.location.href = "{{ route('gadaian',['noic'=>$customer_info['kpbaru'] ]) }}";
+ }else{
+ window.location.href = "{{ route('gadaian',['noic'=>$customer_info['kplama'] ]) }}";
+ }
}
}
}
diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php
index bb166f2..f7b9d86 100644
--- a/resources/views/gadaian/index.blade.php
+++ b/resources/views/gadaian/index.blade.php
@@ -4,7 +4,12 @@
@php
- $gadai_session = Http::get($api_url . '/api/check/sag',['kodcaw'=>$cawangan_info['kodcaw'],'norujukan'=>$norujukan,'nokp'=>$customer_info['kpbaru']])->json();
+ if($customer_info['kpbaru'] != null){
+ $noic = $customer_info['kpbaru'];
+ }else{
+ $noic = $customer_info['kplama'];
+ }
+ $gadai_session = Http::get($api_url . '/api/check/sag',['kodcaw'=>$cawangan_info['kodcaw'],'norujukan'=>$norujukan,'nokp'=>$noic])->json();
@endphp
@if($gadai_session != null)