diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index bad70f4..b423b7b 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -42,6 +42,8 @@ class HomeController extends Controller $customer_pkb = $responses[0]->json(); $customer_koop = $responses[1]->json(); + $customerLelong = $this->getCustomerInfoLelong($authUser['icno']); + // ['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo; $customer_gadai = array_merge( $customer_pkb['gadai'] ?? [], @@ -52,7 +54,7 @@ class HomeController extends Controller $customer_pkb['lelong'] ?? [], $customer_koop['lelong'] ?? [] ); - + // only get lelong that is harga jualan that is not null or 0 $customer_lelong = array_filter($customer_lelong, fn($x) => $x['hargajualan'] != null && $x['hargajualan'] != 0); @@ -66,7 +68,7 @@ class HomeController extends Controller $bilangan = sizeof($customer_gadai) + sizeOf($customer_lelong); - return view('includes.buffer', compact('bilangan', 'sixMonths', 'total', 'bilanganLelong', 'homeUrl')); + return view('includes.buffer', compact('bilangan', 'sixMonths', 'total', 'bilanganLelong', 'homeUrl','customerLelong')); } /** @@ -92,6 +94,7 @@ class HomeController extends Controller $customer_koop = $responses[1]->json(); + $customerLelong = $this->getCustomerInfoLelong($authUser['icno']); // ['gadai' => $customer_gadai, 'lelong' => $customer_lelong] = $customerInfo; $customer_gadai = array_merge( @@ -117,6 +120,33 @@ class HomeController extends Controller $bilangan = sizeof($customer_gadai) + sizeOf($customer_lelong); - return view('includes.home', compact('bilangan', 'sixMonths', 'total', 'bilanganLelong', 'pembiayaan')); + return view('includes.home', compact('bilangan', 'sixMonths', 'total', 'bilanganLelong', 'pembiayaan','customerLelong')); + } + + private function getCustomerInfoLelong($icno){ + $customerLelong = Http::withOptions(['verify' => config('app.api_verify')]) + ->get(config('api.url') . '/portal/customer/info/lelong', ['ic' => $icno]) + ->json(); + + $customerLelongKoop = Http::withOptions(['verify' => config('app.api_verify')]) + ->get(config('api.url_koop') . '/portal/customer/info/lelong', ['ic' => $icno]) + ->json(); + + // Extract data with null safety + $bakiLelong = isset($customerLelong['success']) && $customerLelong['success'] + ? ($customerLelong['data']['bakilelong'] ?? 0) : 0; + $rugiLelong = isset($customerLelong['success']) && $customerLelong['success'] + ? ($customerLelong['data']['rugilelong'] ?? 0) : 0; + + $bakiKoop = isset($customerLelongKoop['success']) && $customerLelongKoop['success'] + ? ($customerLelongKoop['data']['bakilelong'] ?? 0) : 0; + $rugiKoop = isset($customerLelongKoop['success']) && $customerLelongKoop['success'] + ? ($customerLelongKoop['data']['rugilelong'] ?? 0) : 0; + + // Calculate totals + $totalBakiLelong = $bakiLelong + $bakiKoop; + $totalRugiLelong = $rugiLelong + $rugiKoop; + + return ['rugilelong' => $totalRugiLelong, 'bakilelong' => $totalBakiLelong]; } } diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index d24e5a1..935cb2f 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -24,8 +24,20 @@ @endif
-
+
+ + + + + +
@if ($errors->has('password')) @@ -109,5 +121,17 @@ slides[slideIndex - 1].style.display = "block"; setTimeout(showSlides, 10000); // Change image every 2 seconds } + + function togglePasswordVisibility(inputId, iconId) { + const passwordInput = document.getElementById(inputId); + const eyeIcon = document.getElementById(iconId); + if (passwordInput.type === 'password') { + passwordInput.type = 'text'; + eyeIcon.setAttribute('fill', '#12B652'); + } else { + passwordInput.type = 'password'; + eyeIcon.setAttribute('fill', '#6c757d'); + } + } @endsection \ No newline at end of file diff --git a/resources/views/auth/loginbackup.blade.php b/resources/views/auth/loginbackup.blade.php index f0a0741..d9eaca5 100644 --- a/resources/views/auth/loginbackup.blade.php +++ b/resources/views/auth/loginbackup.blade.php @@ -45,11 +45,23 @@ @endif
-
+
- + + + + + + +
@if ($errors->has('password')) @@ -86,4 +98,18 @@
+ + @endsection diff --git a/resources/views/auth/passwords/confirm.blade.php b/resources/views/auth/passwords/confirm.blade.php index ca78fc1..5bfdb45 100644 --- a/resources/views/auth/passwords/confirm.blade.php +++ b/resources/views/auth/passwords/confirm.blade.php @@ -16,8 +16,20 @@
-
+
+ + + + + + @error('password') @@ -46,4 +58,18 @@
+ + @endsection diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index cbcd2d2..f698af2 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -19,8 +19,20 @@ @endif -
+
+ + + + + +
@if ($errors->has('password')) @@ -31,11 +43,22 @@ {{ __('password strength') }}: none
-
+
- - +
+ + + + + +
@@ -68,6 +91,18 @@ } } } + + function togglePasswordVisibility(inputId, iconId) { + const passwordInput = document.getElementById(inputId); + const eyeIcon = document.getElementById(iconId); + if (passwordInput.type === 'password') { + passwordInput.type = 'text'; + eyeIcon.setAttribute('fill', '#12B652'); + } else { + passwordInput.type = 'password'; + eyeIcon.setAttribute('fill', '#6c757d'); + } + } @endsection \ No newline at end of file diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 46aabf6..eca32ae 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -45,11 +45,23 @@
-
+
+ + + + + +
@if ($errors->has('password')) @@ -58,11 +70,23 @@ @endif
-
+
- + + + + + + +
@@ -212,6 +236,18 @@ setTimeout(showSlides, 10000); // Change image every 2 seconds } + function togglePasswordVisibility(inputId, iconId) { + const passwordInput = document.getElementById(inputId); + const eyeIcon = document.getElementById(iconId); + if (passwordInput.type === 'password') { + passwordInput.type = 'text'; + eyeIcon.setAttribute('fill', '#12B652'); + } else { + passwordInput.type = 'password'; + eyeIcon.setAttribute('fill', '#6c757d'); + } + } + -
+
+ + + + + +
@if ($errors->has('password')) @@ -44,8 +56,20 @@
-
- +
+ + + + + + +
@@ -178,5 +202,17 @@ // slides[slideIndex - 1].style.display = "block"; // setTimeout(showSlides, 10000); // Change image every 2 seconds // } + + function togglePasswordVisibility(inputId, iconId) { + const passwordInput = document.getElementById(inputId); + const eyeIcon = document.getElementById(iconId); + if (passwordInput.type === 'password') { + passwordInput.type = 'text'; + eyeIcon.setAttribute('fill', '#12B652'); + } else { + passwordInput.type = 'password'; + eyeIcon.setAttribute('fill', '#6c757d'); + } + } @endsection \ No newline at end of file diff --git a/resources/views/components/dashboard-card-small.blade.php b/resources/views/components/dashboard-card-small.blade.php new file mode 100644 index 0000000..39efd5d --- /dev/null +++ b/resources/views/components/dashboard-card-small.blade.php @@ -0,0 +1,29 @@ +@props([ + 'title' => '', + 'subtitle' => '', + 'icon' => '', + 'iconState' => 'info', + 'cardBackgroundState' => 'white', + 'link' => '#', +]) + +
+
+
+
+
+
{{ $title }}
+ {{ $subtitle }} +
+
+ +
+ +
+
+
+
+
+
+
+
diff --git a/resources/views/includes/home.blade.php b/resources/views/includes/home.blade.php index 5b9590f..0fdedd9 100644 --- a/resources/views/includes/home.blade.php +++ b/resources/views/includes/home.blade.php @@ -101,6 +101,21 @@ @endif
+
+ + +
+ @if (request()->get('filter') == 'pembiayaan-akan-dilelong') diff --git a/resources/views/includes/login/loginportal.blade.php b/resources/views/includes/login/loginportal.blade.php index d4a6f6c..2b8e483 100644 --- a/resources/views/includes/login/loginportal.blade.php +++ b/resources/views/includes/login/loginportal.blade.php @@ -30,8 +30,41 @@ @endif -
- +
+ + + + + + + +
@if ($errors->has('password')) diff --git a/resources/views/includes/profile.blade.php b/resources/views/includes/profile.blade.php index a69a4cc..7cc4b68 100644 --- a/resources/views/includes/profile.blade.php +++ b/resources/views/includes/profile.blade.php @@ -117,9 +117,21 @@
-
+
+ + + + + + @if ($errors->has('old_password')) @@ -130,9 +142,21 @@
-
+
+ + + + + + @if ($errors->has('password')) @@ -140,9 +164,21 @@ @endif
-
+
+ + + + + +
@@ -171,4 +207,18 @@
+ + @endsection \ No newline at end of file diff --git a/resources/views/profile/edit.blade.php b/resources/views/profile/edit.blade.php index aa79c5c..5acb3af 100644 --- a/resources/views/profile/edit.blade.php +++ b/resources/views/profile/edit.blade.php @@ -98,9 +98,21 @@ @endif
-
+
+ + + + + + @if ($errors->has('old_password')) @@ -108,9 +120,21 @@ @endif
-
+
+ + + + + + @if ($errors->has('password')) @@ -118,9 +142,21 @@ @endif
-
+
+ + + + + +
@@ -137,4 +173,18 @@ {{-- @include('layouts.footers.auth') --}}
+ + @endsection \ No newline at end of file