@extends('layouts.admin') @section('content') @php // cek apakah sedang mode PDF $isPdf = $isPdf ?? false; $reportType = $reportType ?? 'loan_requests'; @endphp @if(!$isPdf)
@if($reportType === 'loan_requests') Rekap lengkap peminjaman kendaraan untuk analisis dan arsip perusahaan @elseif($reportType === 'vehicles') Data lengkap kendaraan perusahaan untuk manajemen inventaris @elseif($reportType === 'users') Data pengguna sistem peminjaman kendaraan @endif
| No | Peminjam | Kendaraan | Supir | Tanggal Pinjam | Tanggal Kembali | Status |
|---|---|---|---|---|---|---|
| {{ $loop->iteration }} | {{-- COLUMN: PEMINJAM --}}
{{ $item->user->name ?? '-' }}
{{ $item->user->email ?? '-' }}
|
{{-- COLUMN: KENDARAAN --}}
@if($item->vehicle)
{{ $item->vehicle->jenis ?? '-' }}
{{ $item->vehicle->plat ?? '-' }}
Tidak Ada Kendaraan
@endif
|
{{-- COLUMN: SUPIR --}}
@if($item->driver)
{{ $item->driver->name ?? '-' }}
{{ $item->driver->license_number ?? '-' }}
Tanpa Supir
@endif
|
{{-- COLUMN: TANGGAL PINJAM --}}
{{ \Carbon\Carbon::parse($item->tanggal_pinjam)->format('d M Y') }}
|
{{-- COLUMN: TANGGAL KEMBALI --}}
@if($item->tanggal_kembali)
{{ \Carbon\Carbon::parse($item->tanggal_kembali)->format('d M Y') }}
@else
-
@endif
|
{{-- COLUMN: STATUS --}}
@php $status = strtolower(trim($item->status ?? '')); $statusMapping = [ 'selesai' => ['icon' => 'fa-check-circle', 'color' => 'bg-success text-white', 'text' => 'Selesai'], 'diproses' => ['icon' => 'fa-hourglass-half', 'color' => 'bg-warning text-dark', 'text' => 'Diproses'], 'ditolak' => ['icon' => 'fa-times-circle', 'color' => 'bg-danger text-white', 'text' => 'Ditolak'], 'disetujui' => ['icon' => 'fa-check', 'color' => 'bg-info text-white', 'text' => 'Disetujui'], 'pending' => ['icon' => 'fa-clock', 'color' => 'bg-secondary text-white', 'text' => 'Pending'], 'dipakai' => ['icon' => 'fa-car-side', 'color' => 'bg-primary text-white', 'text' => 'Dipakai'], 'dikembalikan' => ['icon' => 'fa-undo', 'color' => 'bg-success text-white', 'text' => 'Dikembalikan'], 'approved' => ['icon' => 'fa-check', 'color' => 'bg-info text-white', 'text' => 'Disetujui'], 'rejected' => ['icon' => 'fa-times-circle', 'color' => 'bg-danger text-white', 'text' => 'Ditolak'], 'completed' => ['icon' => 'fa-check-circle', 'color' => 'bg-success text-white', 'text' => 'Selesai'], 'in_progress' => ['icon' => 'fa-hourglass-half', 'color' => 'bg-warning text-dark', 'text' => 'Diproses'], 'in progress' => ['icon' => 'fa-hourglass-half', 'color' => 'bg-warning text-dark', 'text' => 'Diproses'], ]; $config = $statusMapping[$status] ?? [ 'icon' => 'fa-question-circle', 'color' => 'bg-secondary text-white', 'text' => ucfirst($status ?: 'Unknown') ]; @endphp {{ $config['text'] }} |
Tidak ada data peminjaman ditemukanCoba ubah filter pencarian Anda |
||||||
| No | Jenis Kendaraan | Plat Nomor | Warna | Stok | Foto |
|---|---|---|---|---|---|
| {{ $loop->iteration }} | {{-- COLUMN: JENIS KENDARAAN --}}
{{ $vehicle->jenis ?? '-' }}
|
{{-- COLUMN: PLAT NOMOR --}}
{{ $vehicle->plat ?? '-' }} | {{-- COLUMN: WARNA --}}
{{ $vehicle->warna ?? '-' }}
|
{{-- COLUMN: STOK --}}
{{ $vehicle->stock ?? 0 }} | {{-- COLUMN: FOTO --}}
@if($vehicle->foto)
|
Tidak ada data kendaraan ditemukanCoba ubah filter pencarian Anda |
|||||
| No | Nama User | Role | Tanggal Dibuat | |
|---|---|---|---|---|
| {{ $loop->iteration }} | {{-- COLUMN: NAMA USER --}}
{{ $user->name ?? '-' }}
|
{{-- COLUMN: EMAIL --}}
{{ $user->email ?? '-' }} | {{-- COLUMN: ROLE --}}@php $roleConfig = [ 'admin' => ['color' => 'bg-danger text-white', 'text' => 'Admin'], 'ga' => ['color' => 'bg-info text-dark', 'text' => 'GA'], 'manager_ga' => ['color' => 'bg-primary text-white', 'text' => 'Manager GA'], 'supir' => ['color' => 'bg-secondary text-white', 'text' => 'Supir'], 'karyawan' => ['color' => 'bg-success text-white', 'text' => 'Karyawan'], ]; $config = $roleConfig[$user->role] ?? ['color' => 'bg-warning text-dark', 'text' => ucfirst($user->role)]; @endphp {{ $config['text'] }} | {{-- COLUMN: TANGGAL DIBUAT --}}{{ $user->created_at ? \Carbon\Carbon::parse($user->created_at)->format('d M Y') : '-' }} |
Tidak ada data users ditemukanCoba ubah filter pencarian Anda |
||||