diff --git a/app/Http/Controllers/Pg/GateInspectionController.php b/app/Http/Controllers/Pg/GateInspectionController.php index 7ac553e..1d08a17 100644 --- a/app/Http/Controllers/Pg/GateInspectionController.php +++ b/app/Http/Controllers/Pg/GateInspectionController.php @@ -28,18 +28,37 @@ class GateInspectionController extends Controller $gate = $gateId ? Gate::find($gateId) : Gate::first(); $pendingActivities = collect(); + $todayApprovedCount = 0; + $todayRejectedCount = 0; if ($gate) { $pendingActivities = VehicleActivity::where('gate_id', $gate->id) ->where('validation_status', 'pending') ->with(['vehicle', 'driver']) ->orderBy('recorded_at', 'asc') ->get(); + + $todayApprovedCount = VehicleActivity::where('gate_id', $gate->id) + ->where('validation_status', 'approved') + ->whereDate('validated_at', Carbon::today()) + ->count(); + + $todayRejectedCount = VehicleActivity::where('gate_id', $gate->id) + ->where('validation_status', 'rejected') + ->whereDate('validated_at', Carbon::today()) + ->count(); } // Daftar satpam aktif untuk fallback pilihan $guards = SecurityGuard::where('is_active', true)->orderBy('name')->get(); - return view('pg.gate_inspection', compact('gate', 'pendingActivities', 'guards', 'currentGuard')); + return view('pg.gate_inspection', compact( + 'gate', + 'pendingActivities', + 'guards', + 'currentGuard', + 'todayApprovedCount', + 'todayRejectedCount' + )); } /** diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index fd1463d..2f56303 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -108,19 +108,15 @@ @elseif(auth()->user()->isGateOfficer()) - - - - - - - Pos Gerbang + + Verifikasi Pos Gerbang @endif + @if(!auth()->user()->isGateOfficer())

MANAJEMEN SISTEM @@ -332,13 +328,8 @@ Log Verifikasi Gerbang @endif - @if(auth()->user()->isGateOfficer()) - - - Pos Gerbang - - @endif

+ @endif

PENGATURAN

diff --git a/resources/views/pg/gate_inspection.blade.php b/resources/views/pg/gate_inspection.blade.php index eb92cca..d732843 100644 --- a/resources/views/pg/gate_inspection.blade.php +++ b/resources/views/pg/gate_inspection.blade.php @@ -1,61 +1,161 @@ @extends('layouts.app') -@section('title', 'Verifikasi Pos Gerbang - Private Guard (PG)') +@section('title', 'Verifikasi Pos Gerbang - Private Guard (PG) | PT Kerinci Merangin Hidro') @section('content')
- -
-
-
- - Pos Gerbang Aktif - - - @if($currentGuard) - - - Petugas: {{ $currentGuard->name }} (ID: {{ $currentGuard->badge_id }}) • Regu {{ $currentGuard->team }} - - @else - Akun Pengawas / Bersama - @endif -
-

- {{ $gate ? $gate->name : 'Pos Gerbang Belum Dipilih' }} -

-

- Petugas Satpam yang sedang piket wajib memverifikasi kondisi fisik kendaraan dan angka odometer riil sebelum membuka portal. + +

+
+ + OPERASIONAL POS KEAMANAN + +
+

+ Verifikasi Pos Gerbang +

+ + + +
+

+ Petugas Satpam yang sedang piket wajib memverifikasi kondisi fisik kendaraan dan angka odometer riil sebelum membuka portal gerbang.

+ +
+ + + +
+ + + + + Auto-refresh: 30s +
+
+
+ + +
+
- - - Antrean: {{ $pendingActivities->count() }} Kendaraan +
+ {{ $pendingActivities->count() }} +
+

ANTREAN MENUNGGU

+
+ + +
+
+ {{ $todayApprovedCount }} +
+

DISETUJUI HARI INI

+
+ + +
+
+ {{ $todayRejectedCount }} +
+

DITOLAK HARI INI

+
+ + +
+
+ + {{ $gate ? $gate->name : 'Pos Gerbang' }} + + + Regu {{ $currentGuard->team ?? '1' }} + +
+

POS JAGA AKTIF

+
+
+ + +
+
+ +
+ {{ strtoupper(substr($currentGuard->name ?? auth()->user()->name, 0, 1)) }} +
+
+
+ + + Pos Aktif: {{ $gate ? $gate->name : 'Gerbang' }} + + + Regu {{ $currentGuard->team ?? '1' }} + +
+

+ {{ $currentGuard ? $currentGuard->name : auth()->user()->name }} + + (ID: {{ $currentGuard->badge_id ?? auth()->user()->username }}) + +

+
+
+ + +
+ Waktu Pos Jaga + + --:--:-- WIB
-
-

- Kendaraan Menunggu Verifikasi Fisik -

- Auto-refresh saat halaman dimuat ulang + +
+
+

+ Kendaraan Menunggu Verifikasi Fisik +

+ + {{ $pendingActivities->count() }} + +
+ + + @if($pendingActivities->count() > 0) +
+ +
+ @endif
-
+ +
@forelse($pendingActivities as $act) -
-
+
+ +
+
- + {{ $act->vehicle->code }} - + {{ $act->vehicle->license_plate ?? 'Tanpa Plat' }} @if($act->direction === 'in') @@ -72,70 +172,132 @@
+
-
Unit: {{ $act->vehicle->brand_type }}
-
Pengemudi: {{ $act->driver->name }} ({{ $act->driver->division ?? '-' }})
-
KM Odometer Input: {{ number_format($act->current_km, 0, ',', '.') }} KM
-
Jarak Sesi Ini: +{{ number_format($act->distance, 0, ',', '.') }} KM
+
+ Unit: + {{ $act->vehicle->brand_type }} +
+
+ Pengemudi: + {{ $act->driver->name }} + ({{ $act->driver->division ?? '-' }}) +
+
+ KM Odometer Input: + {{ number_format($act->current_km, 0, ',', '.') }} KM +
+
+ Jarak Sesi Ini: + +{{ number_format($act->distance, 0, ',', '.') }} KM +
+
Keperluan Kerja: {{ $act->purpose }}
-
-
@empty -
- -

Tidak ada kendaraan yang menunggu verifikasi saat ini.

- Semua aktivitas kendaraan di pos gerbang ini telah diperiksa. + +
+
+ +
+

+ Tidak Ada Kendaraan Menunggu Verifikasi +

+

+ Semua aktivitas kendaraan di pos gerbang ini telah diperiksa. Sistem siap memantau kedatangan armada berikutnya. +

+
@endforelse
- +