{{ __('form.Presences') }}

{{-- ===================== MAIN CONTENT ===================== --}}
{{-- Legend --}}
{{ __('form.Description') }}: @foreach([ ['color' => '#22c55e', 'label' => __('form.On-Time')], ['color' => '#fc1f1f', 'label' => __('form.Late')], ['color' => '#650000', 'label' => __('form.Early-Leave')], ['color' => '#FF66CC', 'label' => __('form.Time-Off')], ['color' => '#eab308', 'label' => __('form.Sick')], ['color' => '#3b82f6', 'label' => __('form.Permit')], ['color' => '#A32CC4', 'label' => __('form.Late-Permission')], ['color' => '#047857', 'label' => __('form.Out-of-town-duty')], ['color' => '#01796F', 'label' => __('form.Pending')], ] as $item)
{{ $item['label'] }}
@endforeach
{{-- Table --}}
@foreach($dates as $date) @endforeach @foreach($employees as $employee) @foreach($dates as $date) @php $dateStr = $date->format('Y-m-d'); $key = $employee->id . '_' . $dateStr; $attendance = $indexedAttendance[$key] ?? null; if ($attendance) { $bgColor = $attendance->bg_color; $textColor = 'text-white'; } else { $bgColor = 'transparent'; $textColor = 'text-gray-900 dark:text-white'; } $shiftDisplay = null; if (!$attendance) { $pattern = $indexedSchedule[$key] ?? null; $shiftDisplay = $pattern?->shift?->code ?? null; } $requestStatuses = ['CT','CM','CMA','CKA','CBA','CIM','CKM','CAK','CIH','CH','S','I','IT','DLK','DLN']; $isRequest = $attendance && in_array($attendance->status, $requestStatuses); $isIT = $attendance && $attendance->status === 'IT' && $attendance->clock_in; $isRequestOnly = $isRequest && !$isIT; @endphp @endforeach @endforeach
{{ __('table.Code') }} {{ __('table.Employee-Name') }} {{ $date->format('d M') }} {{ $date->format('D') }}
{{ $employee->code }} user photo {{ $employee?->fullname ?? '-' }}
@if($attendance) @if($isRequestOnly) - - - @if($attendance->shift_code) {{ $attendance->shift_code }} @endif @else
@if($attendance->has_photo_in && $attendance->clock_in) @else {{ $attendance->clock_in ?? '- - -' }} @endif @if($attendance->clock_in || $attendance->clock_out) - @endif @if($attendance->has_photo_out && $attendance->clock_out) @else {{ $attendance->clock_out ?? ($attendance->clock_in ? '-' : '') }} @endif
@if($attendance->shift_code) {{ $attendance->shift_code }} @endif @endif @else - - - @if($shiftDisplay) {{ $shiftDisplay }} @endif @endif
{{-- ─────────────── MOBILE CARD LIST (hidden on desktop) ─────────────── --}}
{{-- ===================== MODAL FOTO ===================== --}} {{-- ===================== MODAL INSERT ATTENDANCE ===================== --}} {{-- ===================== MODAL EXPORT ===================== --}} {{-- Load presence.js setelah config di-set --}} @vite('resources/js/presence.js') @if(session('error')) @endif