| {{ $employee['name'] }} |
{{ $employee['position'] }} |
@for($i = 1; $i <= $daysInMonth; $i++)
@php
$dateKey = $year . '-' . str_pad($month, 2, '0', STR_PAD_LEFT) . '-' . str_pad($i, 2, '0', STR_PAD_LEFT);
$status = isset($employee['attendance'][$dateKey]) ? $employee['attendance'][$dateKey] : '';
// Logic Warna Cell (Hijau, Kuning, Biru, Merah)
$bgColor = '#ffffff'; // default putih
$textColor = '#000000';
if($status == 'H') { $bgColor = '#00b050'; $textColor = '#000000'; } // Hadir (Hijau)
elseif($status == 'I') { $bgColor = '#ffff00'; $textColor = '#000000'; } // Izin (Kuning)
elseif($status == 'C') { $bgColor = '#00b0f0'; $textColor = '#000000'; } // Cuti (Biru)
elseif($status == 'S') { $bgColor = '#ff0000'; $textColor = '#ffffff'; } // Sakit (Merah)
elseif($status == 'A') { $bgColor = '#d9d9d9'; $textColor = '#000000'; } // Absen (Abu-abu)
@endphp
{{ $status }}
|
@endfor
{{ $employee['total_hari_kerja'] ?? 0 }} |
{{ $employee['total_H'] ?? 0 }} |
{{ $employee['total_I'] ?? 0 }} |
{{ $employee['total_C'] ?? 0 }} |
{{ $employee['total_S'] ?? 0 }} |
{{ $employee['total_A'] ?? 0 }} |
@endforeach