From 2e992bc6e375830bec17638c69a85c73fd337450 Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Tue, 21 Nov 2023 14:20:07 +0800 Subject: [PATCH] fix layout gadai and fix ansuran return fail --- app/Http/Controllers/PenebusanController.php | 4 +-- resources/views/gadaian/index.blade.php | 15 +++++----- resources/views/penebusan/index.blade.php | 29 +++++++++++++------- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/app/Http/Controllers/PenebusanController.php b/app/Http/Controllers/PenebusanController.php index 5b4892b..4b3acd8 100644 --- a/app/Http/Controllers/PenebusanController.php +++ b/app/Http/Controllers/PenebusanController.php @@ -87,7 +87,7 @@ class PenebusanController extends Controller 'nowakil' => $request->nowakil ])->json(); - if($updategadai) + if($updategadai == 'success') { $getTunai2=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$request->kodcaw,['kodlaluan' => $request->teller])->json(); @@ -128,7 +128,7 @@ class PenebusanController extends Controller return response()->json($updateTunai,200); }else{ - return response('error',500); + return response('error'); } } diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php index 366baad..5914278 100644 --- a/resources/views/gadaian/index.blade.php +++ b/resources/views/gadaian/index.blade.php @@ -106,7 +106,7 @@ -
+
Keuntungan Sebulan @@ -116,7 +116,7 @@
-
+
Ujrah @@ -143,7 +143,7 @@
-
+
Keuntungan 6 Bulan @@ -153,7 +153,7 @@
-
+
One Percent @@ -163,13 +163,12 @@
-
-
+
-
+
Pembiayaan Max Pelulus
-
+
diff --git a/resources/views/penebusan/index.blade.php b/resources/views/penebusan/index.blade.php index f4c9d00..f1831c3 100644 --- a/resources/views/penebusan/index.blade.php +++ b/resources/views/penebusan/index.blade.php @@ -1270,17 +1270,26 @@ }, success:function(success_data){ - var urlroute = '{{ route("resit.ansurans", ":id") }}'; - urlroute = urlroute.replace(':id', norujukan); + if(success_data != 'error'){ + var urlroute = '{{ route("resit.ansurans", ":id") }}'; + urlroute = urlroute.replace(':id', norujukan); - Swal.fire( - 'Berjaya!', - 'Bayaran Ansuran Berjaya', - 'success' - ).then(function() { - window.open(urlroute, '_blank'); - window.location.replace("{{ route('customer_info') }}"); - }) + Swal.fire( + 'Berjaya!', + 'Bayaran Ansuran Berjaya', + 'success' + ).then(function() { + window.open(urlroute, '_blank'); + window.location.replace("{{ route('customer_info') }}"); + }) + }else{ + Swal.fire( + 'Tidak Berjaya!', + 'Bayaran ansuran tidak berjaya!', + 'error' + ); + } + } });