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>
|
2026-10-13 21:28:39 +07:00
|
|
|
<div class="flex items-center space-x-1.5 mb-1">
|
|
|
|
|
<span class="text-xs font-bold uppercase tracking-wider text-[#1b5e20]">
|
|
|
|
|
MANAJEMEN SISTEM
|
2026-10-12 23:47:41 +07:00
|
|
|
</span>
|
2026-10-13 21:28:39 +07:00
|
|
|
<!-- Tombol Info Panduan Halaman Sejajar Kicker -->
|
|
|
|
|
<button type="button"
|
|
|
|
|
onclick="openGuideModal()"
|
|
|
|
|
class="w-3.5 h-3.5 rounded-full bg-slate-200/90 hover:bg-slate-300 text-slate-500 hover:text-slate-800 text-[8px] inline-flex items-center justify-center font-bold transition shadow-2xs cursor-pointer focus:outline-none"
|
|
|
|
|
title="Panduan Halaman Log Aktivitas Kendaraan">
|
|
|
|
|
<i class="fa-solid fa-info"></i>
|
|
|
|
|
</button>
|
2026-10-12 23:47:41 +07:00
|
|
|
</div>
|
2026-10-13 21:28:39 +07:00
|
|
|
<h2 class="text-2xl sm:text-3xl font-extrabold text-slate-900 tracking-tight">
|
|
|
|
|
Log Aktivitas Kendaraan
|
|
|
|
|
</h2>
|
2026-10-12 23:47:41 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="flex items-center space-x-3 w-full sm:w-auto">
|
2026-10-13 21:28:39 +07:00
|
|
|
<a href="{{ route('qma.activity.summary') }}" class="w-full sm:w-auto inline-flex items-center justify-center px-4 py-2.5 rounded-xl text-xs font-bold text-white bg-[#06213f] hover:bg-[#0b315b] shadow-sm transition group">
|
2026-10-13 10:48:46 +07:00
|
|
|
<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 21:38:14 +07:00
|
|
|
@php
|
|
|
|
|
$activeFilterCount = count(array_filter(request()->only(['start_date', 'end_date', 'gate_id', 'direction', 'status'])));
|
|
|
|
|
$isFilterOpen = request()->anyFilled(['start_date', 'end_date', 'gate_id', 'direction', 'status']);
|
|
|
|
|
@endphp
|
|
|
|
|
|
|
|
|
|
<!-- Form Filter & Pencarian Cepat -->
|
|
|
|
|
<form method="GET" action="{{ route('qma.activity.log') }}" class="space-y-3">
|
|
|
|
|
<!-- Baris Atas: Search Bar Mandiri di Luar Card Filter & Tombol Toggle -->
|
|
|
|
|
<div class="flex flex-col sm:flex-row items-stretch sm:items-center gap-3">
|
|
|
|
|
<!-- Search Bar Utama (Real-Time) -->
|
|
|
|
|
<div class="relative flex-1">
|
|
|
|
|
<div class="absolute inset-y-0 left-0 pl-3.5 flex items-center pointer-events-none text-slate-400">
|
|
|
|
|
<i class="fa-solid fa-magnifying-glass text-xs"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<input type="text"
|
|
|
|
|
name="search"
|
|
|
|
|
id="activityLogSearchInput"
|
|
|
|
|
value="{{ request('search') }}"
|
|
|
|
|
placeholder="Cari Kode LV, Driver, Plat, Keperluan..."
|
|
|
|
|
class="w-full text-xs rounded-xl border border-slate-200 bg-white hover:border-slate-300 focus:bg-white pl-9 pr-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 shadow-2xs">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Tombol Buka/Tutup Filter Card & Reset Filter -->
|
|
|
|
|
<div class="flex items-center gap-2.5 self-end sm:self-auto w-full sm:w-auto justify-between sm:justify-start">
|
|
|
|
|
<button type="button"
|
|
|
|
|
id="filterToggleBtn"
|
|
|
|
|
onclick="toggleFilterCard()"
|
|
|
|
|
class="inline-flex items-center justify-center px-4 py-2.5 rounded-xl text-xs font-bold text-slate-700 bg-white hover:bg-slate-50 border border-slate-200 shadow-2xs transition group cursor-pointer">
|
|
|
|
|
<i class="fa-solid fa-sliders text-slate-500 mr-2 group-hover:text-[#1b5e20] transition-colors"></i>
|
|
|
|
|
<span>Filter</span>
|
|
|
|
|
@if($activeFilterCount > 0)
|
|
|
|
|
<span class="ml-1.5 px-1.5 py-0.5 rounded-full text-[10px] font-extrabold bg-[#1b5e20] text-white">
|
|
|
|
|
{{ $activeFilterCount }}
|
|
|
|
|
</span>
|
|
|
|
|
@endif
|
|
|
|
|
<i id="filterChevron" class="fa-solid fa-chevron-down ml-2 text-[10px] text-slate-400 transition-transform duration-200 {{ $isFilterOpen ? 'rotate-180' : '' }}"></i>
|
|
|
|
|
</button>
|
|
|
|
|
|
2026-10-13 21:21:07 +07:00
|
|
|
<div id="headerResetFilterContainer">
|
|
|
|
|
@if(request()->anyFilled(['search', 'start_date', 'end_date', 'gate_id', 'direction', 'status']))
|
|
|
|
|
<a href="{{ route('qma.activity.log') }}"
|
|
|
|
|
id="headerResetFilterBtn"
|
2026-10-13 21:38:14 +07:00
|
|
|
class="text-xs text-rose-600 hover:text-rose-700 font-semibold flex items-center space-x-1 transition px-3 py-2 rounded-xl hover:bg-rose-50 border border-transparent hover:border-rose-100">
|
2026-10-13 21:21:07 +07:00
|
|
|
<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
|
|
|
</div>
|
2026-10-13 21:38:14 +07:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Card Filter Lanjutan (Bisa Di Buka-Tutup / Collapsible) -->
|
|
|
|
|
<div id="collapsibleFilterCard" class="{{ $isFilterOpen ? '' : 'hidden ' }}bg-white rounded-2xl border border-slate-200 shadow-sm p-4 sm:p-5 transition-all">
|
|
|
|
|
<!-- Header Card Filter -->
|
|
|
|
|
<div class="flex items-center justify-between pb-3 border-b border-slate-100 mb-3.5">
|
|
|
|
|
<div class="flex items-center space-x-2">
|
|
|
|
|
<span class="text-slate-800 font-bold text-xs uppercase tracking-wider">
|
|
|
|
|
Opsi Filter Lanjutan
|
|
|
|
|
</span>
|
|
|
|
|
@if($activeFilterCount > 0)
|
|
|
|
|
<span class="text-[11px] text-slate-400 font-medium">({{ $activeFilterCount }} filter aktif)</span>
|
|
|
|
|
@endif
|
|
|
|
|
</div>
|
|
|
|
|
<button type="button"
|
|
|
|
|
onclick="toggleFilterCard()"
|
|
|
|
|
class="text-xs text-slate-400 hover:text-slate-600 transition flex items-center space-x-1 cursor-pointer">
|
|
|
|
|
<span>Tutup</span>
|
|
|
|
|
<i class="fa-solid fa-xmark text-[11px]"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</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">
|
|
|
|
|
<!-- Rentang Mulai Tanggal -->
|
2026-10-13 21:38:14 +07:00
|
|
|
<div class="lg:col-span-3">
|
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') }}"
|
2026-10-13 16:33:30 +07:00
|
|
|
onchange="this.form.submit()"
|
2026-10-13 08:55:10 +07:00
|
|
|
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 -->
|
2026-10-13 21:38:14 +07:00
|
|
|
<div class="lg:col-span-3">
|
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') }}"
|
2026-10-13 16:33:30 +07:00
|
|
|
onchange="this.form.submit()"
|
2026-10-13 08:55:10 +07:00
|
|
|
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>
|
2026-10-13 16:33:30 +07:00
|
|
|
<select name="gate_id" onchange="this.form.submit()" 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">
|
2026-10-13 08:55:10 +07:00
|
|
|
<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>
|
2026-10-13 16:33:30 +07:00
|
|
|
<select name="direction" onchange="this.form.submit()" 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">
|
2026-10-13 08:55:10 +07:00
|
|
|
<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>
|
|
|
|
|
|
|
|
|
|
<!-- Status Validasi Pos Gerbang -->
|
2026-10-13 21:38:14 +07:00
|
|
|
<div class="lg:col-span-2">
|
|
|
|
|
<label class="block text-xs font-bold text-slate-700 mb-1.5">
|
|
|
|
|
Status PG
|
|
|
|
|
</label>
|
|
|
|
|
<select name="status" onchange="this.form.submit()" 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">
|
2026-10-13 08:55:10 +07:00
|
|
|
<option value="">Semua Status</option>
|
|
|
|
|
<option value="approved" {{ request('status') === 'approved' ? 'selected' : '' }}>Disetujui</option>
|
|
|
|
|
<option value="pending" {{ request('status') === 'pending' ? 'selected' : '' }}>Menunggu PG</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
</div>
|
2026-10-13 21:38:14 +07:00
|
|
|
</div>
|
|
|
|
|
</form>
|
2026-10-12 23:47:41 +07:00
|
|
|
|
2026-10-13 21:43:18 +07:00
|
|
|
<!-- Tabel Log Aktivitas (Pada Mobile: Format Kotak Tanpa Border Radius) -->
|
|
|
|
|
<div class="bg-white rounded-none sm: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 21:21:07 +07:00
|
|
|
<tbody id="activityLogTableBody" 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 21:21:07 +07:00
|
|
|
<tr class="activity-row hover:bg-slate-50/70 transition">
|
2026-10-13 08:55:10 +07:00
|
|
|
<!-- 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>
|
2026-10-13 16:41:53 +07:00
|
|
|
@if(request()->anyFilled(['search', 'start_date', 'end_date', 'gate_id', 'direction', 'status']))
|
2026-10-13 08:55:10 +07:00
|
|
|
<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
|
2026-10-13 21:21:07 +07:00
|
|
|
|
|
|
|
|
<!-- Baris Hasil Pencarian Real-Time Kosong -->
|
|
|
|
|
<tr id="clientSearchEmptyRow" class="hidden">
|
|
|
|
|
<td colspan="11" class="py-12 px-4 text-center">
|
|
|
|
|
<div class="flex flex-col items-center justify-center space-y-2">
|
|
|
|
|
<div class="w-12 h-12 rounded-full bg-slate-100 flex items-center justify-center text-slate-400 text-xl">
|
|
|
|
|
<i class="fa-solid fa-magnifying-glass"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="text-sm font-bold text-slate-700">Tidak Ada Hasil Pencarian</div>
|
|
|
|
|
<p class="text-xs text-slate-400">Tidak ditemukan log aktivitas yang sesuai dengan kata kunci pencarian Anda.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
2026-10-12 23:47:41 +07:00
|
|
|
</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>
|
2026-10-13 21:21:07 +07:00
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
|
const searchInput = document.getElementById('activityLogSearchInput');
|
|
|
|
|
const tableBody = document.getElementById('activityLogTableBody');
|
|
|
|
|
const resetContainer = document.getElementById('headerResetFilterContainer');
|
|
|
|
|
const emptyRow = document.getElementById('clientSearchEmptyRow');
|
|
|
|
|
const hasServerFilters = {{ request()->anyFilled(['start_date', 'end_date', 'gate_id', 'direction', 'status']) ? 'true' : 'false' }};
|
|
|
|
|
|
|
|
|
|
if (searchInput && tableBody) {
|
|
|
|
|
searchInput.addEventListener('input', function (e) {
|
|
|
|
|
const query = e.target.value.toLowerCase().trim();
|
|
|
|
|
const rows = tableBody.querySelectorAll('tr.activity-row');
|
|
|
|
|
let visibleCount = 0;
|
|
|
|
|
|
|
|
|
|
rows.forEach(row => {
|
|
|
|
|
const text = row.textContent.toLowerCase();
|
|
|
|
|
if (text.includes(query)) {
|
|
|
|
|
row.style.display = '';
|
|
|
|
|
visibleCount++;
|
|
|
|
|
} else {
|
|
|
|
|
row.style.display = 'none';
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Tampilkan pesan kosong jika tidak ada baris yang cocok secara instan
|
|
|
|
|
if (emptyRow) {
|
|
|
|
|
if (rows.length > 0 && visibleCount === 0) {
|
|
|
|
|
emptyRow.classList.remove('hidden');
|
|
|
|
|
} else {
|
|
|
|
|
emptyRow.classList.add('hidden');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Tampilkan atau sembunyikan tombol Reset Filter secara real-time
|
|
|
|
|
if (resetContainer) {
|
|
|
|
|
let resetBtn = document.getElementById('headerResetFilterBtn');
|
|
|
|
|
if (query.length > 0 || hasServerFilters) {
|
|
|
|
|
if (!resetBtn) {
|
|
|
|
|
resetBtn = document.createElement('a');
|
|
|
|
|
resetBtn.href = "{{ route('qma.activity.log') }}";
|
|
|
|
|
resetBtn.id = 'headerResetFilterBtn';
|
|
|
|
|
resetBtn.className = 'text-xs text-rose-600 hover:text-rose-700 font-semibold flex items-center space-x-1 transition';
|
|
|
|
|
|
|
|
|
|
const resetIcon = document.createElement('i');
|
|
|
|
|
resetIcon.className = 'fa-solid fa-rotate-left text-[11px]';
|
|
|
|
|
const resetText = document.createElement('span');
|
|
|
|
|
resetText.textContent = 'Reset Filter';
|
|
|
|
|
|
|
|
|
|
resetBtn.appendChild(resetIcon);
|
|
|
|
|
resetBtn.appendChild(resetText);
|
|
|
|
|
resetContainer.appendChild(resetBtn);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (resetBtn && !hasServerFilters) {
|
|
|
|
|
resetBtn.remove();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-10-13 21:28:39 +07:00
|
|
|
|
2026-10-13 21:38:14 +07:00
|
|
|
// Toggle Card Filter Lanjutan
|
|
|
|
|
function toggleFilterCard() {
|
|
|
|
|
const card = document.getElementById('collapsibleFilterCard');
|
|
|
|
|
const chevron = document.getElementById('filterChevron');
|
|
|
|
|
if (card) {
|
|
|
|
|
card.classList.toggle('hidden');
|
|
|
|
|
}
|
|
|
|
|
if (chevron) {
|
|
|
|
|
chevron.classList.toggle('rotate-180');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-10-13 21:28:39 +07:00
|
|
|
// Buka & Tutup Modal Panduan Halaman
|
|
|
|
|
function openGuideModal() {
|
|
|
|
|
const modal = document.getElementById('guideModal');
|
|
|
|
|
if (modal) {
|
|
|
|
|
modal.classList.remove('hidden');
|
|
|
|
|
document.documentElement.classList.add('modal-open');
|
|
|
|
|
document.body.classList.add('modal-open');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function closeGuideModal() {
|
|
|
|
|
const modal = document.getElementById('guideModal');
|
|
|
|
|
if (modal) {
|
|
|
|
|
modal.classList.add('hidden');
|
|
|
|
|
document.documentElement.classList.remove('modal-open');
|
|
|
|
|
document.body.classList.remove('modal-open');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
document.addEventListener('keydown', function(e) {
|
|
|
|
|
if (e.key === 'Escape') {
|
|
|
|
|
closeGuideModal();
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-10-13 21:21:07 +07:00
|
|
|
</script>
|
2026-10-13 21:28:39 +07:00
|
|
|
|
|
|
|
|
<!-- ========================================================================= -->
|
|
|
|
|
<!-- MODAL POPUP: PANDUAN HALAMAN (LOG AKTIVITAS KENDARAAN) -->
|
|
|
|
|
<!-- ========================================================================= -->
|
|
|
|
|
<div id="guideModal"
|
|
|
|
|
onclick="if(event.target === this) closeGuideModal()"
|
|
|
|
|
class="hidden fixed inset-0 z-50 bg-slate-900/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto">
|
|
|
|
|
<div class="bg-white rounded-3xl shadow-2xl max-w-lg w-full p-6 sm:p-7 border border-slate-100 transform transition-all my-8">
|
|
|
|
|
<!-- Header Modal -->
|
|
|
|
|
<div class="flex items-center justify-between pb-4 border-b border-slate-100">
|
|
|
|
|
<div class="flex items-center space-x-3">
|
|
|
|
|
<div class="w-9 h-9 rounded-full bg-slate-100 text-slate-700 flex items-center justify-center font-bold text-sm border border-slate-200">
|
|
|
|
|
<i class="fa-solid fa-info"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<h3 class="text-base font-bold text-slate-900 tracking-tight leading-tight">Panduan Halaman</h3>
|
|
|
|
|
<p class="text-xs text-slate-500">Log Aktivitas Kendaraan</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<button type="button"
|
|
|
|
|
onclick="closeGuideModal()"
|
|
|
|
|
class="text-slate-400 hover:text-slate-600 transition p-1.5 rounded-lg hover:bg-slate-100 cursor-pointer">
|
|
|
|
|
<i class="fa-solid fa-xmark text-lg"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mt-4 space-y-4">
|
|
|
|
|
<p class="text-xs text-slate-600 leading-relaxed">
|
|
|
|
|
Selamat datang di halaman <strong>Log Aktivitas Kendaraan</strong>! Halaman ini memuat seluruh riwayat operasional kendaraan yang telah terverifikasi oleh petugas pos gerbang. Di halaman ini Anda dapat:
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div class="space-y-3">
|
|
|
|
|
<!-- Fitur 1 (Hijau) -->
|
|
|
|
|
<div class="bg-slate-50/70 border border-slate-100 rounded-2xl p-3.5 flex items-start space-x-3.5">
|
|
|
|
|
<div class="w-9 h-9 rounded-xl bg-emerald-100/70 text-emerald-700 flex items-center justify-center flex-shrink-0 mt-0.5 text-sm border border-emerald-200/50">
|
|
|
|
|
<i class="fa-solid fa-clipboard-check"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="min-w-0 flex-1">
|
|
|
|
|
<h4 class="text-xs font-bold text-slate-900">Catatan Perjalanan Kendaraan</h4>
|
|
|
|
|
<p class="text-[11px] text-slate-500 mt-0.5 leading-relaxed">
|
|
|
|
|
Melihat log perjalanan setiap kendaraan operasional lengkap dengan tanggal, nomor plat, nama driver, serta tujuan penggunaan dinas.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Fitur 2 (Biru) -->
|
|
|
|
|
<div class="bg-slate-50/70 border border-slate-100 rounded-2xl p-3.5 flex items-start space-x-3.5">
|
|
|
|
|
<div class="w-9 h-9 rounded-xl bg-blue-100/70 text-blue-700 flex items-center justify-center flex-shrink-0 mt-0.5 text-sm border border-blue-200/50">
|
|
|
|
|
<i class="fa-solid fa-gauge"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="min-w-0 flex-1">
|
|
|
|
|
<h4 class="text-xs font-bold text-slate-900">Validasi Odometer Masuk & Keluar</h4>
|
|
|
|
|
<p class="text-[11px] text-slate-500 mt-0.5 leading-relaxed">
|
|
|
|
|
Memeriksa angka kilometer riil sebelum keluar dan saat kembali masuk untuk memantau jarak tempuh perjalanan unit.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Fitur 3 (Amber) -->
|
|
|
|
|
<div class="bg-slate-50/70 border border-slate-100 rounded-2xl p-3.5 flex items-start space-x-3.5">
|
|
|
|
|
<div class="w-9 h-9 rounded-xl bg-amber-100/70 text-amber-700 flex items-center justify-center flex-shrink-0 mt-0.5 text-sm border border-amber-200/50">
|
|
|
|
|
<i class="fa-solid fa-chart-pie"></i>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="min-w-0 flex-1">
|
|
|
|
|
<h4 class="text-xs font-bold text-slate-900">Analitik & Filter Real-time</h4>
|
|
|
|
|
<p class="text-[11px] text-slate-500 mt-0.5 leading-relaxed">
|
|
|
|
|
Gunakan kotak pencarian dan filter cepat, atau klik tombol 'Lihat Summary Aktivitas' untuk rekapitulasi data per unit dan driver.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Footer Tombol -->
|
|
|
|
|
<div class="pt-4 mt-5 border-t border-slate-100 flex items-center justify-end">
|
|
|
|
|
<button type="button"
|
|
|
|
|
onclick="closeGuideModal()"
|
|
|
|
|
class="px-6 py-2.5 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-bold text-xs transition cursor-pointer shadow-2xs">
|
|
|
|
|
Saya Mengerti
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-10-12 23:47:41 +07:00
|
|
|
@endsection
|