| Participant Name |
@foreach ($client_name as $code => $name)
{!! nl2br($name) !!}
@endforeach
|
| Week Start From |
{{ $week_start }} |
Week End From |
{{ $week_end }} |
| Date |
Shift |
Staff |
Start Time |
End Time |
Total Hours |
Holiday Hours |
@foreach ($roster_data as $row)
@php
// $row = ['date','shift','shift_id','allocations'=>[...]]
$dateLabel = $row['date'] ?? '';
$shiftLabel = $row['shift'] ?? '';
$allocs = $row['allocations'] ?? [];
@endphp
@foreach ($allocs as $alloc)
@php
// $alloc = ['allocation_id','staff_name','start_time','end_time','hours','ph_hours','shared'=>[]]
$aid = $alloc['allocation_id'];
$staffName = $alloc['staff_name'] ?? '';
$startTime = $alloc['start_time'] ?? '';
$endTime = $alloc['end_time'] ?? '';
$hours = number_format((float)($alloc['hours'] ?? 0), 2);
$phHours = number_format((float)($alloc['ph_hours'] ?? 0), 2);
$sharedRows = $alloc['shared'] ?? [];
@endphp
| {{ $dateLabel }} |
{{ $shiftLabel }} |
{!! nl2br(e($staffName)) !!} |
{{ $startTime }} |
{{ $endTime }} |
{{-- Total Hours cell: if shared splits exist, show a mini table (Client / Hours / Time); else plain total --}}
@if (!empty($sharedRows))
| Participant |
Hours |
Time |
@php $sumShared = 0; @endphp
@foreach ($sharedRows as $s)
@php
$cName = $s['client'] ?? '';
$cHrs = number_format((float)($s['hours'] ?? 0), 2);
$cTime = $s['time'] ?? '';
$sumShared += (float)($s['hours'] ?? 0);
@endphp
| {{ $cName }} |
{{ $cHrs }} |
{{ $cTime }} |
@endforeach
| Total |
{{ number_format($sumShared, 2) }} |
|
@else
{{ $hours }}
@endif
|
{{ $phHours }} |
{{-- If this allocation created a "child" next-day segment (midnight split, not roster-end date), render it as a separate row --}}
@if (!empty($roster_next_day_data[$aid]))
@php
$child = $roster_next_day_data[$aid];
$cDate = $child['date'] ?? '';
$cStart = $child['start_time'] ?? '';
$cEnd = $child['end_time'] ?? '';
$cHours = number_format((float)($child['hours'] ?? 0), 2);
$cPH = number_format((float)($child['ph_hours'] ?? 0), 2);
$cShared = $child['shared'] ?? [];
@endphp
| {{ $cDate }} |
{{ $shiftLabel }} |
{!! nl2br(e($staffName)) !!} |
{{ $cStart }} |
{{ $cEnd }} |
@if (!empty($cShared))
| Participant |
Hours |
Time |
@php $sumC = 0; @endphp
@foreach ($cShared as $s)
@php
$cn = $s['client'] ?? '';
$ch = number_format((float)($s['hours'] ?? 0), 2);
$ct = $s['time'] ?? '';
$sumC += (float)($s['hours'] ?? 0);
@endphp
| {{ $cn }} |
{{ $ch }} |
{{ $ct }} |
@endforeach
| Total |
{{ number_format($sumC, 2) }} |
|
@else
{{ $cHours }}
@endif
|
{{ $cPH }} |
@endif
@endforeach
@endforeach