From 7b7a47b13eb7773b5c687923ec85321665d9dc4f Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Sun, 12 Jan 2025 16:42:48 +0800 Subject: [PATCH] added loader and fix marhun call --- app/Services/PembiayaanService.php | 12 +- public/argon/js/main.js | 2 + public/js/miscellaneous/cart.js | 2 + public/js/miscellaneous/navigation-trolley.js | 5 + .../includes/bayaran/pembayaransag.blade.php | 17 ++- resources/views/includes/home.blade.php | 11 ++ resources/views/includes/main/head.blade.php | 36 +++++ .../views/includes/main/navigation.blade.php | 126 +++++++----------- .../partials/table-pembiayaan.blade.php | 1 + resources/views/modal/marhun.blade.php | 20 ++- routes/api.php | 2 +- 11 files changed, 143 insertions(+), 91 deletions(-) diff --git a/app/Services/PembiayaanService.php b/app/Services/PembiayaanService.php index 7e51e3f..b4ccc9c 100644 --- a/app/Services/PembiayaanService.php +++ b/app/Services/PembiayaanService.php @@ -112,13 +112,17 @@ class PembiayaanService return $formatted; } - public function getMarhunModalData($norujukan) + public function getMarhunModalData($norujukan,$tagsyarikat) { - $gadaianDetails = Http::arrahn()->get('/api/gadai/norujukan/' . $norujukan)->json()[0][0]; + $CallableHttp = $tagsyarikat == CompanyStatus::COM_PKB + ? Http::arrahn() + : Http::arrahn_koop(); + + $gadaianDetails = $CallableHttp->get('/api/gadai/norujukan/' . $norujukan)->json()[0][0]; - $attachCawanganName = function ($x) use ($gadaianDetails) { - $x['cawangan_name'] = Http::arrahn()->get('/api/cawangan/detail/' . $gadaianDetails['kodcaw'])->json()[0]['cawangan']; + $attachCawanganName = function ($x) use ($gadaianDetails,$CallableHttp) { + $x['cawangan_name'] = $CallableHttp->get('/api/cawangan/detail/' . $gadaianDetails['kodcaw'])->json()[0]['cawangan']; return $x; }; diff --git a/public/argon/js/main.js b/public/argon/js/main.js index 17f7d79..2b94b44 100644 --- a/public/argon/js/main.js +++ b/public/argon/js/main.js @@ -1,4 +1,6 @@ function loadingbtn(){ + const loader = document.getElementById('load-arrahn'); + loader.classList.remove('d-none'); $.notifyClose(); // $(this).unbind("click"); $('#background').css('display', 'block'); diff --git a/public/js/miscellaneous/cart.js b/public/js/miscellaneous/cart.js index ee6df57..85fd1a7 100644 --- a/public/js/miscellaneous/cart.js +++ b/public/js/miscellaneous/cart.js @@ -67,6 +67,8 @@ radios.forEach((radio) => { }); let deleteCarts = () => { + const loader = document.getElementById('load-arrahn'); + loader.classList.remove('d-none'); fetch('/deletecarts') .then(response => { if (!response.ok) { diff --git a/public/js/miscellaneous/navigation-trolley.js b/public/js/miscellaneous/navigation-trolley.js index 6d951eb..6dd10b4 100644 --- a/public/js/miscellaneous/navigation-trolley.js +++ b/public/js/miscellaneous/navigation-trolley.js @@ -56,6 +56,11 @@ function redirectTrolley() { redirectInput.value = 'trolley'; form.appendChild(redirectInput); document.body.appendChild(form); + + + const loader = document.getElementById('load-arrahn'); + loader.classList.remove('d-none'); + form.submit(); } diff --git a/resources/views/includes/bayaran/pembayaransag.blade.php b/resources/views/includes/bayaran/pembayaransag.blade.php index 046b600..fa5636b 100644 --- a/resources/views/includes/bayaran/pembayaransag.blade.php +++ b/resources/views/includes/bayaran/pembayaransag.blade.php @@ -41,6 +41,13 @@ Bayar SAG | Portal Pelanggan
+
+
+
+ +
+
+
@csrf
@@ -62,7 +69,10 @@

PKB

- +
+ *sila tick di sini untuk memilih bayaran. + +
@@ -145,7 +155,10 @@

KOPKB

- +
+ *sila tick di sini untuk memilih bayaran. + +
diff --git a/resources/views/includes/home.blade.php b/resources/views/includes/home.blade.php index ee36cbf..85dfeaf 100644 --- a/resources/views/includes/home.blade.php +++ b/resources/views/includes/home.blade.php @@ -2,6 +2,13 @@ @section('content') Home | Portal Pelanggan +
+
+
+ +
+
+
{ + const loader = document.getElementById('load-arrahn'); + loader.classList.remove('d-none'); if (result.isDenied) { let remove_carts = fetch('/deletecarts') .then(response => { diff --git a/resources/views/includes/main/head.blade.php b/resources/views/includes/main/head.blade.php index 4bace97..829096e 100644 --- a/resources/views/includes/main/head.blade.php +++ b/resources/views/includes/main/head.blade.php @@ -64,6 +64,42 @@ opacity: 0.8; display: flex; } + + .loader-arrahn { + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 9999; + } + + .loader-arrahn img { + width: 100px; /* Image size */ + } + + .loader-arrahn:before { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 120px; + height: 120px; + background-color: rgba(0, 0, 0, 0.8); + border-radius: 50%; + z-index: -1; + } + + .overlay-arrahn { + position: fixed; + z-index: 9998; + width: 100%; + height: 100%; + top: 0; + left: 0; + background-color: rgba(0, 0, 0, 0.5); + overflow: hidden; + } diff --git a/resources/views/includes/main/navigation.blade.php b/resources/views/includes/main/navigation.blade.php index 55ed837..acfc1b5 100644 --- a/resources/views/includes/main/navigation.blade.php +++ b/resources/views/includes/main/navigation.blade.php @@ -1,69 +1,51 @@ - + + +
+
+
+ +
+
+
@@ -81,24 +63,6 @@