{{ __('Attendance Records') }}

@if($activeTab === 'attendance') @can('attendances create') @endcan @endif
@if(session()->has('message'))
{{ session('message') }}
@endif
@if($this->canManageAttendance()) @endif
@if($activeTab === 'pending_review' && $this->canManageAttendance())

{{ __('Attendance sessions pending HR review') }}

{{ __('These sessions do not block new check-ins and are excluded from attendance calculations until reviewed.') }}

{{ count($pendingReviewSessions) }}
@if(!$employee_id)
@endif
@forelse($pendingReviewSessions as $pendingSession) @empty @endforelse
{{ __('Employee') }} {{ __('Attendance Date') }} {{ __('Check In') }} {{ __('Pending Since') }} {{ __('Action') }}
{{ $pendingSession->attendance?->employee?->name ?? '-' }} {{ $pendingSession->attendance?->date?->format('Y-m-d') }} {{ $pendingSession->check_in?->format('Y-m-d H:i:s') }} {{ $pendingSession->review_required_at?->format('Y-m-d H:i:s') }}
{{ __('No Records') }}
@else
@if(!$employee_id)
@endif
@forelse($attendances as $index => $att) @php $firstCheckIn = $att->first_check_in; $lastCheckOut = $att->last_check_out_display; $totalSeconds = $att->total_worked_seconds; $h = floor($totalSeconds / 3600); $m = floor(($totalSeconds % 3600) / 60); $s = $totalSeconds % 60; @endphp @empty @endforelse
{{ '#' }} {{ __('Name') }} {{ __('Work Shift') }} {{ __('Required hours') }} {{ __('Date') }} {{ __('Check In') }} {{ __('Check Out') }} {{ __('Duration') }} {{ __('Action') }}
{{ $index + 1 }} {{ $att->employee->name }} {{ $att->shift_name }} {{ $att->scheduled_hours }} {{ $att->date }} {{ $firstCheckIn ?? '-' }} {{ $lastCheckOut }} {{ str_pad($h, 2, '0', STR_PAD_LEFT) }}h {{ str_pad($m, 2, '0', STR_PAD_LEFT) }}m {{ str_pad($s, 2, '0', STR_PAD_LEFT) }}s
{{ __('View') }} @can('attendances edit') @endcan
{{ __('No Records') }}
@endif