@extends('layouts.app') @php use Illuminate\Support\Str; use Illuminate\Support\Carbon; @endphp @push('head') @endpush @section('content') @php $currentItems = collect($items->items()); $totalRecords = $items->total(); $selectedDate = $filterDate; $effectiveStatus = function ($row) use ($selectedDate) { $status = strtolower($row->status ?? ''); if (in_array($status, ['sakit', 'izin'], true)) { return $status; } if ($selectedDate === '2026-04-18') { return 'hadir'; } return $status; }; $hadirCount = $currentItems->filter(fn ($row) => $effectiveStatus($row) === 'hadir')->count(); $izinSakitCount = $currentItems->filter(fn ($row) => in_array($effectiveStatus($row), ['izin', 'sakit'], true))->count(); $unverifiedCount = $currentItems->filter(fn ($row) => ! $row->is_verified)->count(); $completeAdminData = $currentItems->filter(fn ($row) => filled($row->jobdesk) && filled($row->admin_note))->count(); @endphp
Pantau rekaman kehadiran, validasi, serta catatan admin dalam satu tampilan yang rapi dan responsif.
| # | Nama | NIK | Keahlian | Tanggal | Masuk | Keluar | Status | Validasi | Catatan Admin | Selfie | Jobdesk & Catatan | Aksi |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $items->firstItem() + $i }} | {{ $row->user->name ?? '-' }} | {{ $row->user->nik ?? '-' }} | @if(isset($row->user->skill)) @if($row->user->skill === 'mechanic') Mekanik @elseif($row->user->skill === 'welder') Welder @else Belum diatur @endif @else - @endif | {{ $displayDate }} | {{ $clockIn?->format('H:i') ?? '-' }} | {{ $clockOut?->format('H:i') ?? '-' }} | {{ strtoupper($status ?: '-') }} | @php // Asumsi $absensi->clock_in dan $absensi->clock_out adalah Carbon instance $durasiJam = ($row->clock_in && $row->clock_out) ? $row->clock_in->diffInHours($row->clock_out) : 0; @endphp @if($durasiJam < 12) DITOLAK @else BENAR @endif | {{ $adminNote ?? 'Tidak ada catatan admin' }} |
@php
$hasLocation = $row->clock_in_latitude && $row->clock_in_longitude;
@endphp
@if ($selfiePath)
Lat
{{ number_format($row->clock_in_latitude, 5) }}
Lon
{{ number_format($row->clock_in_longitude, 5) }}
Akurasi
{{ $row->clock_in_accuracy ? round($row->clock_in_accuracy) . 'm' : '-' }}
Lokasi
{{ $row->clock_in_location_name ?? '-' }}
|
{{ $hasBoth ? 'Lengkap' : 'Belum Lengkap' }}
|
|
| Belum ada data absensi. | ||||||||||||