@if (empty($data))

No data available for this report.

@else @php $monthInWord = request()->month ? \Carbon\Carbon::createFromDate(null, request()->month, 1)->format('F') : ''; @endphp

Thane Municipal Corporation

Garden Cleaning Muster Report For {{ $monthInWord }} {{ $data[array_key_first($data)]->year }}

Generated On: {{ now()->format('d-m-Y H:i A') }}

@foreach ($data as $index => $garden)
{{-- #{{$garden->id}} --}}
Prabhag: {{ $garden->prabhag_name }} Garden: {{ $garden->garden_name }} Cleaner Name: {{ $garden->clean_by }}
Month: {{ $monthInWord }}
@php $firstDay = \Carbon\Carbon::createFromDate($garden->year, $garden->month, 1); $lastDay = $firstDay->copy()->endOfMonth(); $allDates = []; while ($firstDay->lte($lastDay)) { $allDates[] = $firstDay->format('d-m-Y'); $firstDay->addDay(); } @endphp @foreach ($allDates as $d) @php $dateObj = \Carbon\Carbon::createFromFormat('d-m-Y', $d); @endphp @endforeach @foreach ($allDates as $dateStr) @php $record = $garden->dates[$dateStr] ?? null; $before = $record['before'] ?? null; $cellClass = $before ? 'bg-green' : 'bg-red'; @endphp @endforeach @foreach ($allDates as $dateStr) @php $record = $garden->dates[$dateStr] ?? null; $after = $record['after'] ?? null; $cellClass = $after ? 'bg-green' : 'bg-red'; @endphp @endforeach
DATE
{{ $dateObj->format('d') }}
{{ $dateObj->format('D') }}
BEFORE {{ $before ?? '-' }}
AFTER {{ $after ?? '-' }}
@endforeach @endif