2026-10-12 23:47:41 +07:00
|
|
|
@extends('layouts.app')
|
|
|
|
|
|
2026-10-13 08:55:10 +07:00
|
|
|
@section('title', 'Log Aktivitas Kendaraan QMA')
|
2026-10-12 23:47:41 +07:00
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
<div class="space-y-6">
|
2026-10-13 08:55:10 +07:00
|
|
|
<!-- Header Judul & Total Catatan -->
|
2026-10-12 23:47:41 +07:00
|
|
|
<div class="flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4">
|
|
|
|
|
<div>
|
|
|
|
|
<span class="text-xs font-bold uppercase tracking-wider text-[#1b5e20] block mb-1">
|
|
|
|
|
MANAJEMEN SISTEM
|
|
|
|
|
</span>
|
|
|
|
|
<div class="flex items-center space-x-3">
|
2026-10-13 08:55:10 +07:00
|
|
|
<h2 class="text-2xl sm:text-3xl font-extrabold text-slate-900 tracking-tight">
|
2026-10-12 23:47:41 +07:00
|
|
|
Log Aktivitas Kendaraan
|
|
|
|
|
</h2>
|
2026-10-13 08:55:10 +07:00
|
|
|
<span class="w-6 h-6 rounded-full bg-slate-200/90 text-slate-500 text-xs inline-flex items-center justify-center font-bold shadow-sm" title="Catatan pergerakan armada kendaraan dengan validasi pos gerbang">
|
2026-10-12 23:47:41 +07:00
|
|
|
<i class="fa-solid fa-info"></i>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center space-x-3 w-full sm:w-auto">
|
2026-10-13 10:48:46 +07:00
|
|
|
<a href="{{ route('qma.activity.summary') }}" class="inline-flex items-center px-4 py-2.5 rounded-xl text-xs font-bold text-white bg-[#06213f] hover:bg-[#0b315b] shadow-sm transition group">
|
|
|
|
|
<i class="fa-solid fa-chart-pie mr-2 text-emerald-400 group-hover:scale-110 transition-transform"></i>
|
|
|
|
|
<span>Summary Aktifitas</span>
|
|
|
|
|
</a>
|
2026-10-12 23:47:41 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-10-13 08:55:10 +07:00
|
|
|
<!-- Filter Card Modern & Rapi -->
|
|
|
|
|
<div class="bg-white rounded-2xl border border-slate-200 shadow-sm p-4 sm:p-5">
|
|
|
|
|
<form method="GET" action="{{ route('qma.activity.log') }}" class="space-y-4">
|
|
|
|
|
<!-- Header Filter -->
|
|
|
|
|
<div class="flex items-center justify-between pb-3 border-b border-slate-100">
|
2026-10-13 16:13:13 +07:00
|
|
|
<span class="text-slate-800 font-bold text-xs uppercase tracking-wider">
|
|
|
|
|
Filter & Pencarian Log
|
|
|
|
|
</span>
|
2026-10-13 08:55:10 +07:00
|
|
|
@if(request()->hasAny(['search', 'start_date', 'end_date', 'gate_id', 'direction', 'status']))
|
2026-10-13 16:13:13 +07:00
|
|
|
<a href="{{ route('qma.activity.log') }}" class="text-xs text-rose-600 hover:text-rose-700 font-semibold transition">
|
2026-10-13 08:55:10 +07:00
|
|
|
<span>Reset Semua Filter</span>
|
|
|
|
|
</a>
|
|
|
|
|
@endif
|
2026-10-12 23:47:41 +07:00
|
|
|
</div>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Baris Input Filter (Grid Responsif 12 Kolom) -->
|
|
|
|
|
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-12 gap-3.5">
|
|
|
|
|
<!-- Pencarian Cepat -->
|
|
|
|
|
<div class="lg:col-span-4">
|
2026-10-13 16:13:13 +07:00
|
|
|
<label class="block text-xs font-bold text-slate-700 mb-1.5">
|
|
|
|
|
Pencarian Cepat
|
2026-10-13 08:55:10 +07:00
|
|
|
</label>
|
|
|
|
|
<div class="relative">
|
|
|
|
|
<input type="text"
|
|
|
|
|
name="search"
|
|
|
|
|
value="{{ request('search') }}"
|
|
|
|
|
placeholder="Cari Kode LV, Driver, Plat, Keperluan..."
|
|
|
|
|
class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3.5 py-2.5 text-slate-800 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Rentang Mulai Tanggal -->
|
|
|
|
|
<div class="lg:col-span-2">
|
2026-10-13 16:13:13 +07:00
|
|
|
<label class="block text-xs font-bold text-slate-700 mb-1.5">
|
|
|
|
|
Mulai Tanggal
|
2026-10-13 08:55:10 +07:00
|
|
|
</label>
|
|
|
|
|
<input type="date"
|
|
|
|
|
name="start_date"
|
|
|
|
|
value="{{ request('start_date') }}"
|
|
|
|
|
class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-2 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Rentang Sampai Tanggal -->
|
|
|
|
|
<div class="lg:col-span-2">
|
2026-10-13 16:13:13 +07:00
|
|
|
<label class="block text-xs font-bold text-slate-700 mb-1.5">
|
|
|
|
|
Sampai Tanggal
|
2026-10-13 08:55:10 +07:00
|
|
|
</label>
|
|
|
|
|
<input type="date"
|
|
|
|
|
name="end_date"
|
|
|
|
|
value="{{ request('end_date') }}"
|
|
|
|
|
class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-2 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Pos Gerbang -->
|
|
|
|
|
<div class="lg:col-span-2">
|
2026-10-13 16:13:13 +07:00
|
|
|
<label class="block text-xs font-bold text-slate-700 mb-1.5">
|
|
|
|
|
Pos Gerbang
|
2026-10-13 08:55:10 +07:00
|
|
|
</label>
|
|
|
|
|
<select name="gate_id" class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-2.5 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
|
|
|
|
|
<option value="">Semua Gerbang</option>
|
|
|
|
|
@foreach($gates as $g)
|
|
|
|
|
<option value="{{ $g->id }}" {{ request('gate_id') == $g->id ? 'selected' : '' }}>{{ $g->name }}</option>
|
|
|
|
|
@endforeach
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Arah Akses -->
|
|
|
|
|
<div class="lg:col-span-2">
|
2026-10-13 16:13:13 +07:00
|
|
|
<label class="block text-xs font-bold text-slate-700 mb-1.5">
|
|
|
|
|
Arah Akses
|
2026-10-13 08:55:10 +07:00
|
|
|
</label>
|
|
|
|
|
<select name="direction" class="w-full text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-2.5 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
|
|
|
|
|
<option value="">Semua Arah</option>
|
|
|
|
|
<option value="in" {{ request('direction') === 'in' ? 'selected' : '' }}>MASUK (In)</option>
|
|
|
|
|
<option value="out" {{ request('direction') === 'out' ? 'selected' : '' }}>KELUAR (Out)</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
</div>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Baris Aksi Bawah: Filter Status PG & Tombol -->
|
|
|
|
|
<div class="flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-3 pt-3 border-t border-slate-100">
|
|
|
|
|
<!-- Status Validasi Pos Gerbang -->
|
|
|
|
|
<div class="flex items-center space-x-2">
|
2026-10-13 16:13:13 +07:00
|
|
|
<span class="text-xs font-bold text-slate-600 whitespace-nowrap">
|
|
|
|
|
Status PG:
|
2026-10-13 08:55:10 +07:00
|
|
|
</span>
|
|
|
|
|
<select name="status" class="text-xs rounded-xl border border-slate-200 bg-slate-50/50 hover:bg-white focus:bg-white px-3 py-1.5 text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#1b5e20]/20 focus:border-[#1b5e20] transition">
|
|
|
|
|
<option value="">Semua Status</option>
|
|
|
|
|
<option value="approved" {{ request('status') === 'approved' ? 'selected' : '' }}>Disetujui</option>
|
|
|
|
|
<option value="pending" {{ request('status') === 'pending' ? 'selected' : '' }}>Menunggu PG</option>
|
|
|
|
|
<option value="rejected" {{ request('status') === 'rejected' ? 'selected' : '' }}>Ditolak</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Tombol Submit & Reset -->
|
|
|
|
|
<div class="flex items-center space-x-2 justify-end">
|
2026-10-13 16:13:13 +07:00
|
|
|
<a href="{{ route('qma.activity.log') }}" class="px-4 py-2 rounded-xl text-xs font-semibold text-slate-600 bg-slate-100 hover:bg-slate-200 border border-slate-200 transition">
|
2026-10-13 08:55:10 +07:00
|
|
|
<span>Reset</span>
|
|
|
|
|
</a>
|
2026-10-13 16:13:13 +07:00
|
|
|
<button type="submit" class="px-5 py-2 rounded-xl text-xs font-bold text-white bg-[#06213f] hover:bg-[#0b315b] shadow-sm transition">
|
2026-10-13 08:55:10 +07:00
|
|
|
<span>Filter</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-10-13 08:55:10 +07:00
|
|
|
<!-- Tabel Log Aktivitas (Header Navy Solid #06213f Tanpa Nomor Kolom) -->
|
|
|
|
|
<div class="bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden">
|
2026-10-12 23:47:41 +07:00
|
|
|
<div class="overflow-x-auto">
|
2026-10-13 08:55:10 +07:00
|
|
|
<table class="min-w-full text-xs text-left border-collapse">
|
|
|
|
|
<thead class="bg-[#06213f] text-white font-bold text-[11px] uppercase tracking-wider">
|
2026-10-12 23:47:41 +07:00
|
|
|
<tr>
|
2026-10-13 08:55:10 +07:00
|
|
|
<th class="py-3.5 px-4 text-center whitespace-nowrap">Tanggal</th>
|
|
|
|
|
<th class="py-3.5 px-4 text-center whitespace-nowrap">Kode LV</th>
|
|
|
|
|
<th class="py-3.5 px-4 whitespace-nowrap">Unit</th>
|
|
|
|
|
<th class="py-3.5 px-4 whitespace-nowrap">Penanggung Jawab</th>
|
|
|
|
|
<th class="py-3.5 px-4 whitespace-nowrap">Driver</th>
|
|
|
|
|
<th class="py-3.5 px-4 text-center whitespace-nowrap">Gate</th>
|
|
|
|
|
<th class="py-3.5 px-4 text-center whitespace-nowrap">Akses</th>
|
|
|
|
|
<th class="py-3.5 px-4 text-right whitespace-nowrap">KM Sebelumnya</th>
|
|
|
|
|
<th class="py-3.5 px-4 text-right whitespace-nowrap">KM Berjalan</th>
|
|
|
|
|
<th class="py-3.5 px-4 whitespace-nowrap">Aktivitas</th>
|
|
|
|
|
<th class="py-3.5 px-4 text-center whitespace-nowrap">Status PG</th>
|
2026-10-12 23:47:41 +07:00
|
|
|
</tr>
|
|
|
|
|
</thead>
|
2026-10-13 08:55:10 +07:00
|
|
|
<tbody class="divide-y divide-slate-100 text-slate-700 bg-white">
|
2026-10-12 23:47:41 +07:00
|
|
|
@forelse($activities as $act)
|
2026-10-13 08:55:10 +07:00
|
|
|
<tr class="hover:bg-slate-50/70 transition">
|
|
|
|
|
<!-- Tanggal & Waktu -->
|
|
|
|
|
<td class="py-3.5 px-4 text-center whitespace-nowrap">
|
2026-10-13 16:21:00 +07:00
|
|
|
<div class="font-bold text-slate-900">{{ $act->recorded_at->locale('id')->translatedFormat('d M Y') }}</div>
|
|
|
|
|
<div class="text-xs text-slate-400 font-medium mt-0.5">{{ $act->recorded_at->format('H:i') }} WIB</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Kode LV -->
|
|
|
|
|
<td class="py-3.5 px-4 text-center whitespace-nowrap font-mono">
|
|
|
|
|
<span class="inline-block bg-emerald-50 text-emerald-800 font-bold px-2.5 py-1 rounded border border-emerald-200">
|
2026-10-12 23:47:41 +07:00
|
|
|
{{ $act->vehicle->code }}
|
|
|
|
|
</span>
|
|
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Unit & Plat -->
|
|
|
|
|
<td class="py-3.5 px-4">
|
|
|
|
|
<div class="font-bold text-slate-900">{{ $act->vehicle->brand_type }}</div>
|
|
|
|
|
@if($act->vehicle->license_plate)
|
|
|
|
|
<span class="inline-block text-[10px] font-mono font-bold text-amber-800 bg-amber-50 px-2 py-0.5 rounded border border-amber-200 mt-0.5">
|
|
|
|
|
{{ $act->vehicle->license_plate }}
|
|
|
|
|
</span>
|
|
|
|
|
@else
|
|
|
|
|
<span class="text-[10px] text-slate-400 italic">-</span>
|
|
|
|
|
@endif
|
2026-10-12 23:47:41 +07:00
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Penanggung Jawab -->
|
|
|
|
|
<td class="py-3.5 px-4 text-slate-600 font-medium">
|
2026-10-12 23:47:41 +07:00
|
|
|
{{ $act->vehicle->ownership ?? '-' }}
|
|
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Driver -->
|
|
|
|
|
<td class="py-3.5 px-4">
|
|
|
|
|
<div class="font-bold text-slate-900">{{ $act->driver->name }}</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
<div class="text-[10px] text-slate-400 font-normal">{{ $act->driver->division ?? '-' }}</div>
|
|
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Gate -->
|
|
|
|
|
<td class="py-3.5 px-4 text-center whitespace-nowrap">
|
|
|
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-xs font-semibold bg-slate-100 text-slate-700 border border-slate-200">
|
2026-10-12 23:47:41 +07:00
|
|
|
{{ $act->gate->name }}
|
|
|
|
|
</span>
|
|
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Akses (In / Out) -->
|
|
|
|
|
<td class="py-3.5 px-4 text-center whitespace-nowrap">
|
2026-10-12 23:47:41 +07:00
|
|
|
@if($act->direction === 'in')
|
2026-10-13 08:55:10 +07:00
|
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-full text-[10px] font-bold bg-emerald-50 text-emerald-700 border border-emerald-200">
|
|
|
|
|
<i class="fa-solid fa-arrow-right-to-bracket mr-1.5 text-emerald-600"></i> MASUK
|
2026-10-12 23:47:41 +07:00
|
|
|
</span>
|
|
|
|
|
@else
|
2026-10-13 08:55:10 +07:00
|
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-full text-[10px] font-bold bg-blue-50 text-blue-700 border border-blue-200">
|
|
|
|
|
<i class="fa-solid fa-arrow-right-from-bracket mr-1.5 text-blue-600"></i> KELUAR
|
2026-10-12 23:47:41 +07:00
|
|
|
</span>
|
|
|
|
|
@endif
|
|
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- KM Sebelumnya -->
|
|
|
|
|
<td class="py-3.5 px-4 text-right font-mono font-medium text-slate-600 whitespace-nowrap">
|
|
|
|
|
{{ number_format($act->previous_km, 0, ',', '.') }}
|
|
|
|
|
<span class="text-[10px] text-slate-400 font-sans font-normal">KM</span>
|
2026-10-12 23:47:41 +07:00
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- KM Berjalan & Akhir -->
|
|
|
|
|
<td class="py-3.5 px-4 text-right font-mono whitespace-nowrap">
|
|
|
|
|
<div class="font-bold text-emerald-600 text-xs">
|
|
|
|
|
+{{ number_format($act->distance, 0, ',', '.') }} <span class="text-[10px] font-sans font-normal">KM</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-[10px] text-slate-400 font-normal">
|
|
|
|
|
Akhir: {{ number_format($act->current_km, 0, ',', '.') }}
|
|
|
|
|
</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Aktivitas -->
|
|
|
|
|
<td class="py-3.5 px-4 text-slate-700 max-w-xs" title="{{ $act->purpose }}">
|
|
|
|
|
<div class="truncate">{{ $act->purpose }}</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
</td>
|
2026-10-13 08:55:10 +07:00
|
|
|
|
|
|
|
|
<!-- Status PG -->
|
|
|
|
|
<td class="py-3.5 px-4 text-center whitespace-nowrap">
|
2026-10-12 23:47:41 +07:00
|
|
|
@if($act->validation_status === 'approved')
|
2026-10-13 08:55:10 +07:00
|
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-[10px] font-bold bg-emerald-50 text-emerald-700 border border-emerald-200" title="Divalidasi oleh: {{ $act->securityGuard->name ?? 'Satpam' }}">
|
|
|
|
|
<i class="fa-solid fa-circle-check mr-1 text-emerald-600"></i> Disetujui
|
2026-10-12 23:47:41 +07:00
|
|
|
</span>
|
|
|
|
|
@elseif($act->validation_status === 'rejected')
|
2026-10-13 08:55:10 +07:00
|
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-[10px] font-bold bg-rose-50 text-rose-700 border border-rose-200" title="Alasan: {{ $act->rejection_note }}">
|
|
|
|
|
<i class="fa-solid fa-circle-xmark mr-1 text-rose-600"></i> Ditolak
|
2026-10-12 23:47:41 +07:00
|
|
|
</span>
|
|
|
|
|
@else
|
2026-10-13 08:55:10 +07:00
|
|
|
<span class="inline-flex items-center px-2.5 py-1 rounded-lg text-[10px] font-bold bg-amber-50 text-amber-700 border border-amber-200 animate-pulse">
|
|
|
|
|
<i class="fa-solid fa-clock mr-1 text-amber-600"></i> Menunggu PG
|
2026-10-12 23:47:41 +07:00
|
|
|
</span>
|
|
|
|
|
@endif
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@empty
|
|
|
|
|
<tr>
|
2026-10-13 08:55:10 +07:00
|
|
|
<td colspan="11" class="py-12 px-4 text-center">
|
|
|
|
|
<div class="flex flex-col items-center justify-center space-y-3">
|
|
|
|
|
<div class="w-14 h-14 rounded-full bg-slate-100 flex items-center justify-center text-slate-400 text-2xl">
|
|
|
|
|
<i class="fa-solid fa-route"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-sm font-bold text-slate-700">Belum Ada Data Log Aktivitas</div>
|
|
|
|
|
<p class="text-xs text-slate-400 max-w-sm">
|
|
|
|
|
Tidak ditemukan catatan aktivitas kendaraan yang sesuai dengan kriteria filter saat ini.
|
|
|
|
|
</p>
|
|
|
|
|
@if(request()->hasAny(['search', 'start_date', 'end_date', 'gate_id', 'direction', 'status']))
|
|
|
|
|
<a href="{{ route('qma.activity.log') }}" class="mt-2 inline-flex items-center space-x-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold text-[#1b5e20] bg-emerald-50 border border-emerald-200 hover:bg-emerald-100 transition">
|
|
|
|
|
<i class="fa-solid fa-rotate-left text-[11px]"></i>
|
|
|
|
|
<span>Reset Filter</span>
|
|
|
|
|
</a>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
@endforelse
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Pagination -->
|
2026-10-13 08:55:10 +07:00
|
|
|
@if($activities->hasPages())
|
|
|
|
|
<div class="p-4 bg-slate-50 border-t border-slate-100">
|
|
|
|
|
{{ $activities->links() }}
|
|
|
|
|
</div>
|
|
|
|
|
@endif
|
2026-10-12 23:47:41 +07:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
@endsection
|