{{-- resources/views/admin/conveyance/exports/employee_month_summary.blade.php --}} @php // Use the first selected month to calculate weekday labels in the header, // same logic as UI grid. $firstMonth = $monthsData[0] ?? null; @endphp {{-- HEADER ROW: Month | 1 (Sun) | 2 (Mon) | ... --}} @for($d = 1; $d <= $maxDays; $d++) @php $dayLabel = $d; $dowLabel = ''; if ($firstMonth && $d <= $firstMonth['days_in_month']) { /** @var \Carbon\Carbon $start */ $start = $firstMonth['start']; $date = $start->copy()->day($d); $dowLabel = $date->format('D'); // Sun, Mon, Tue... } @endphp @endfor {{-- DATA ROWS PER MONTH --}} @foreach($monthsData as $month) @php /** @var \Carbon\Carbon $start */ $start = $month['start']; $daysInMonth = $month['days_in_month']; @endphp {{-- Month name --}} {{-- Day cells --}} @for($d = 1; $d <= $maxDays; $d++) @php if ($d > $daysInMonth) { $info = null; } else { $date = $start->copy()->day($d); $dateKey = $date->toDateString(); $info = $month['daily'][$dateKey] ?? null; } @endphp @endfor @endforeach
Employee Conveyance – Month Summary ({{ $employee->name }})
Month {{ $dayLabel }} @if($dowLabel) ({{ $dowLabel }}) @endif
{{ $month['label'] }} @if($info) {{ (int) $info['total'] }} @if($info['return_diff']) R* @endif @endif