From 632902a35d706e760ef4d3567f8bb7bbefb829dd Mon Sep 17 00:00:00 2001 From: Afiq Zakwan Hamdan Date: Tue, 20 Apr 2021 14:12:52 +0800 Subject: [PATCH] fix bug --- resources/views/customers/info.blade.php | 18 ++++++++++++++++-- resources/views/gadaian/index.blade.php | 7 ++++++- 2 files changed, 22 insertions(+), 3 deletions(-) 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)