@can('hr.attendance.manage')
@csrf
@endcan
@for($d=1;$d<=$daysInMonth;$d++) @endfor @forelse($employees as $emp) @php $empRecords = ($records[$emp->id] ?? collect())->keyBy(fn($r)=>$r->date->day); @endphp @for($d=1;$d<=$daysInMonth;$d++) @php $rec = $empRecords[$d] ?? null; $map = ['present'=>['P','bg-green-100 text-green-700'],'late'=>['L','bg-amber-100 text-amber-700'],'absent'=>['A','bg-red-100 text-red-700'],'leave'=>['V','bg-blue-100 text-blue-700']]; $cell = $rec ? ($map[$rec->status] ?? ['?','bg-gray-100']) : null; @endphp @endfor @empty @endforelse
Employee{{ $d }}
{{ $emp->full_name }} @if($cell) {{ $cell[0] }} @else · @endif
No active employees.
P Present L Late A Absent V Leave