Notes Therapist Momkind.id

{{ $date->format('F Y') }}

@php $groupedTherapists = $therapists->groupBy('order_no'); $parseStart = function($slot) { $slot = preg_replace('/\s+/', '', $slot); $parts = explode('-', $slot); $start = $parts[0] ?? '00.00'; $start = str_replace('.', ':', $start); try { return \Carbon\Carbon::createFromFormat('H:i', $start)->format('H:i'); } catch (\Exception $e) { return $start; } }; $days1 = range(1, min(10, $daysInMonth)); $days2 = ($daysInMonth >= 11) ? range(11, min(20, $daysInMonth)) : []; $days3 = ($daysInMonth >= 21) ? range(21, $daysInMonth) : []; @endphp @foreach($groupedTherapists as $orderNo => $therapistGroup) @php $sortedGroup = $therapistGroup->sortBy(function($t) use ($parseStart) { return $parseStart($t->time_slot); })->values(); $rowCount = $sortedGroup->count(); @endphp
{{-- Chunk 1: Hari 1–10 --}} @if(!empty($days1))
Hari 1 – {{ max($days1) }}
@foreach($days1 as $d) @endforeach @foreach($sortedGroup as $index => $therapist) @if($index === 0) @endif @foreach($days1 as $d) @php $scheduleDate = \Carbon\Carbon::create($date->year, $date->month, $d); $entry = $therapist->getScheduleEntry($scheduleDate); $bgColor = $entry ? $entry->bg_color : '#ffffff'; $content = $entry ? $entry->content : ''; @endphp @endforeach @endforeach
NO TERAPIS DOMISILI TRANSPORTASI JAM{{ $d }}
{{ $orderNo }} {{ $therapist->name }} {{ $therapist->domicile }} {{ $therapist->transportation }}{{ $therapist->time_slot }}{{ $content }}
@endif {{-- Chunk 2: Hari 11–20 --}} @if(!empty($days2))
Hari 11 – {{ max($days2) }}
@foreach($days2 as $d) @endforeach @foreach($sortedGroup as $index => $therapist) @if($index === 0) @endif @foreach($days2 as $d) @php $scheduleDate = \Carbon\Carbon::create($date->year, $date->month, $d); $entry = $therapist->getScheduleEntry($scheduleDate); $bgColor = $entry ? $entry->bg_color : '#ffffff'; $content = $entry ? $entry->content : ''; @endphp @endforeach @endforeach
NO TERAPIS DOMISILI TRANSPORTASI JAM{{ $d }}
{{ $orderNo }} {{ $therapist->name }} {{ $therapist->domicile }} {{ $therapist->transportation }}{{ $therapist->time_slot }}{{ $content }}
@endif {{-- Chunk 3: Hari 21–Akhir --}} @if(!empty($days3))
Hari 21 – {{ max($days3) }}
@foreach($days3 as $d) @endforeach @foreach($sortedGroup as $index => $therapist) @if($index === 0) @endif @foreach($days3 as $d) @php $scheduleDate = \Carbon\Carbon::create($date->year, $date->month, $d); $entry = $therapist->getScheduleEntry($scheduleDate); $bgColor = $entry ? $entry->bg_color : '#ffffff'; $content = $entry ? $entry->content : ''; @endphp @endforeach @endforeach
NO TERAPIS DOMISILI TRANSPORTASI JAM{{ $d }}
{{ $orderNo }} {{ $therapist->name }} {{ $therapist->domicile }} {{ $therapist->transportation }}{{ $therapist->time_slot }}{{ $content }}
@endif
@endforeach @if($memos->count() > 0)

📝 Catatan:

@foreach($memos as $memo)
{{ $memo->memo_date->format('d/m/Y') }}: {{ $memo->content }}
@endforeach
@endif