|
{{ $schedule->date->format('Y-m-d') }}
|
{{ Str::title($schedule->user?->first_name) }} |
#{{ $schedule->user?->username }} |
@php
$shiftStart = \Carbon\Carbon::parse($schedule->Shift->from)->subHour();
$shiftEnd = \Carbon\Carbon::parse($schedule->Shift->to);
$date_from_0 = \Carbon\Carbon::parse('00:00:00')->subHour();
$date_to_23 = \Carbon\Carbon::parse('23:00:00');
if ($shiftEnd < $shiftStart) {
$shiftEnd->addDay();
}
$currentShiftStart = clone $shiftStart;
@endphp
@while ($currentShiftStart < $shiftEnd)
@if ($currentShiftStart->format('H:i') == $date_from_0->format('H:i'))
@php($currentShiftStart->format('H:i'))
|
{{ $schedule->user?->first_name }} |
#{{ $schedule->user?->username }} |
@php
$shiftFrom = \Carbon\Carbon::parse($schedule->Shift->from)->subHours('1');
$shiftTo = \Carbon\Carbon::parse($schedule->Shift->to);
$emptyTdCount = $shiftFrom->diffInHours($shiftTo);
$date_from_0 = \Carbon\Carbon::parse('00:00:00')->subHour();
$date_to_23 = \Carbon\Carbon::parse('23:00:00');
@endphp
@while ($shiftFrom < $shiftTo)
@while ($date_from_0 < $date_to_23)
@if ($shiftFrom->format('H:i') == $date_from_0->format('H:i'))
@php
$shiftFrom->addHour()->format('H');
@endphp
|
@else
|
@endif
@if ($shiftTo == $shiftFrom)
@php
$empty_td = $date_to_23->diffInHours($shiftTo);
@endphp
@for ($i = 0; $i < $empty_td; $i++)
|
@endfor
@break
@endif
@endwhile
@endwhile
@php
$date_from_0->addHour();
@endphp
@endif
@endwhile
@empty
{{-- Handle the case when there are no schedules --}}
@endforelse