From 5b1d90b273fbbbb6cbb0c01da8b3864c5b39c75c Mon Sep 17 00:00:00 2001 From: Zhaqian Rouf Alfauzi Date: Wed, 12 Feb 2025 16:42:17 +0700 Subject: [PATCH] [add] All 2603 to 2780 --- app/Exceptions/Handler.php | 13 ++++ app/Http/Controllers/HitungController.php | 12 ++-- .../views/pages/admin/add-santri.blade.php | 60 +++++++++---------- .../views/pages/admin/class-result.blade.php | 4 +- .../views/pages/admin/data-santri.blade.php | 6 +- .../views/pages/admin/train-data.blade.php | 2 +- resources/views/pages/auth/login.blade.php | 2 +- resources/views/pages/auth/register.blade.php | 31 ++++++++-- .../views/pages/santri/counting.blade.php | 57 ++++++++++++------ .../views/pages/santri/dashboard.blade.php | 60 +++++++++++++++++++ .../views/pages/santri/history.blade.php | 59 +++++++++++++++++- .../views/partial/headbar-admin.blade.php | 2 +- 12 files changed, 242 insertions(+), 66 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 56af264..0a1a2c5 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -27,4 +27,17 @@ public function register(): void // }); } + + public function render($request, Throwable $exception) +{ + if ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) { + $statusCode = $exception->getStatusCode(); + if (view()->exists("errors.{$statusCode}")) { + return response()->view("errors.{$statusCode}", [], $statusCode); + } + } + + return parent::render($request, $exception); +} + } diff --git a/app/Http/Controllers/HitungController.php b/app/Http/Controllers/HitungController.php index e1ba18a..fc16399 100644 --- a/app/Http/Controllers/HitungController.php +++ b/app/Http/Controllers/HitungController.php @@ -31,7 +31,7 @@ public function processCounting(Request $request) $request->validate([ 'year' => 'required|integer', 'alquran' => 'required|integer|min:0|max:606', // maksimal 606 halaman - 'alhadis' => 'required|integer|min:0|max:1997', // maksimal 1997 halaman + 'alhadis' => 'required|integer|min:0|max:2174', // maksimal 2174 halaman ]); // Buat objek Carbon dari "1 Januari [tahun angkatan]" @@ -46,19 +46,19 @@ public function processCounting(Request $request) $n = 0; $status = 'Tidak Tercapai'; - // 1) Jika jumlah halaman (y) >= 2603, langsung "Tercapai" - if ($y >= 2603) { + // 1) Jika jumlah halaman (y) >= 2780, langsung "Tercapai" + if ($y >= 2780) { $n = 100; // Anda dapat mengganti nilai sesuai kebutuhan $status = 'Tercapai'; } - // 2) Jika y < 2603 dan x > 0, hitung kecepatan pencapaian + // 2) Jika y < 2780 dan x > 0, hitung kecepatan pencapaian elseif ($x > 0) { $userSpeed = $y / $x; - $targetSpeed = 2603 / 1095; + $targetSpeed = 2780 / 1095; $n = ($userSpeed / $targetSpeed) * 100; $status = $n >= 100 ? 'Tercapai' : 'Tidak Tercapai'; } - // 3) Jika x == 0 dan y < 2603, nilai default tetap 0 dengan status "Tidak Tercapai" + // 3) Jika x == 0 dan y < 2780, nilai default tetap 0 dengan status "Tidak Tercapai" // Simpan data ke database Riwayat::create([ diff --git a/resources/views/pages/admin/add-santri.blade.php b/resources/views/pages/admin/add-santri.blade.php index 87fdcbe..1fc3c60 100644 --- a/resources/views/pages/admin/add-santri.blade.php +++ b/resources/views/pages/admin/add-santri.blade.php @@ -45,16 +45,15 @@ {{ $index + 1 }} {{ $santri->name }} {{ $santri->email }} - {{ $santri->asal_daerah }} + {{ $santri->asal_daerah == 'dalamProvinsi' ? 'Dalam Daerah' : 'Luar Provinsi' }} {{ $santri->jenis_kelamin }} -
+ + @csrf @method('DELETE') -
@@ -64,16 +63,13 @@ - - - - - + + + + + + -@endsection \ No newline at end of file +@endsection diff --git a/resources/views/pages/admin/class-result.blade.php b/resources/views/pages/admin/class-result.blade.php index 47c808c..2d83942 100644 --- a/resources/views/pages/admin/class-result.blade.php +++ b/resources/views/pages/admin/class-result.blade.php @@ -92,9 +92,9 @@ @endif {{ $item->tahun_angkatan }} - {{ number_format(($item->alhadis / 1997) * 100, 2) }}% + {{ number_format(($item->alhadis / 2174) * 100, 2) }}% {{ number_format(($item->alquran / 606) * 100, 2) }}% - {{ number_format(((($item->alhadis / 1997) * 100) + (($item->alquran / 606) * + {{ number_format(((($item->alhadis / 2174) * 100) + (($item->alquran / 606) * 100)) / 2, 2) }}% {{ $item->status }} diff --git a/resources/views/pages/admin/data-santri.blade.php b/resources/views/pages/admin/data-santri.blade.php index 0b0fa69..b6bb58b 100644 --- a/resources/views/pages/admin/data-santri.blade.php +++ b/resources/views/pages/admin/data-santri.blade.php @@ -79,7 +79,7 @@ {{ $item->alquran }} {{ number_format(($item->alquran / 606) * 100, 2) }}% {{ $item->alhadis }} - {{ number_format(($item->alhadis / 1997) * 100, 2) }}% + {{ number_format(($item->alhadis / 2174) * 100, 2) }}% {{ number_format($item->nilai_n, 2) }} {{ $item->status }} @@ -165,7 +165,7 @@ {{ $item->alquran }} {{ number_format(($item->alquran / 606) * 100, 2) }}% {{ $item->alhadis }} - {{ number_format(($item->alhadis / 1997) * 100, 2) }}% + {{ number_format(($item->alhadis / 2174) * 100, 2) }}% {{ number_format($item->nilai_n, 2) }} {{ $item->status }} @@ -254,7 +254,7 @@ {{ $item->alquran }} {{ number_format(($item->alquran / 606) * 100, 2) }}% {{ $item->alhadis }} - {{ number_format(($item->alhadis / 1997) * 100, 2) }}% + {{ number_format(($item->alhadis / 2174) * 100, 2) }}% {{ number_format($item->nilai_n, 2) }} {{ $item->status }} diff --git a/resources/views/pages/admin/train-data.blade.php b/resources/views/pages/admin/train-data.blade.php index 5ebc471..03339f2 100644 --- a/resources/views/pages/admin/train-data.blade.php +++ b/resources/views/pages/admin/train-data.blade.php @@ -101,7 +101,7 @@ class="btn btn-warning w-100 d-flex align-items-center justify-content-center ga {{ $item->tahun_angkatan }} - {{ $item->alhadis >= 1997 ? 'Khatam' : 'Belum Khatam' }} + {{ $item->alhadis >= 2174 ? 'Khatam' : 'Belum Khatam' }} {{ $item->alquran >= 606 ? 'Khatam' : 'Belum Khatam' }} diff --git a/resources/views/pages/auth/login.blade.php b/resources/views/pages/auth/login.blade.php index 20520d2..ad96d52 100644 --- a/resources/views/pages/auth/login.blade.php +++ b/resources/views/pages/auth/login.blade.php @@ -1,7 +1,7 @@ @extends('layouts.app-none') Login | SR Klasifikasi @section('content') - +
diff --git a/resources/views/pages/auth/register.blade.php b/resources/views/pages/auth/register.blade.php index fcf6530..b0dae8c 100644 --- a/resources/views/pages/auth/register.blade.php +++ b/resources/views/pages/auth/register.blade.php @@ -36,7 +36,7 @@ @endif
+ novalidate> @csrf
@@ -59,8 +59,8 @@
- + @@ -101,7 +101,7 @@
- +
@@ -118,8 +118,31 @@
+ + @endsection \ No newline at end of file diff --git a/resources/views/partial/headbar-admin.blade.php b/resources/views/partial/headbar-admin.blade.php index 229ed3f..9ccd2a8 100644 --- a/resources/views/partial/headbar-admin.blade.php +++ b/resources/views/partial/headbar-admin.blade.php @@ -36,7 +36,7 @@ Hadis - 1997 Halaman + 2174 Halaman