@extends('layout.admin') @section('head') @extends('layout.header') @section('header_title', 'Appointments') @endsection @section('content')

Schedule

Pick a time slot to add an appointment · Drag the grid horizontally to see all stylists

@if(session('auth_kind') === 'user') @endif
Working date
Hours shown: 8:0021:00 · each row is 15 minutes

How to book: choose a stylist column, then click an empty white cell for the start time. Coloured blocks are existing bookings — click one to open invoice or update.

Colours Pending Confirmed In progress Late Done
@if($dayend===1)
@php $ahQuarterMins = [15, 30, 45]; @endphp @for ($hour = 8; $hour <= 21; $hour++) @foreach ($ahQuarterMins as $min) @endforeach @endfor
Time
{{ sprintf('%02d:00', $hour) }}
{{ sprintf('%02d:%02d', $hour, $min) }}
@foreach ($employees as $employee) @php $isDisabled = $dayenddate == \Carbon\Carbon::today()->toDateString(); @endphp
idEmployee}', '{$employee->Full_Name}')" : '' }}" style="position: relative; {{ $employee->idEmployee == 10 ? "left: 67px; max-width:25%; min-width:25%;" : "max-width:20%; min-width:20%;" }}">
@for ($i = 1; $i <= 56; $i++) @endfor
{{ $employee->Full_Name }}
@endforeach
@else
@php $ahQuarterMins = [15, 30, 45]; @endphp @for ($hour = 8; $hour <= 21; $hour++) @foreach ($ahQuarterMins as $min) @endforeach @endfor
Time
{{ sprintf('%02d:00', $hour) }}
{{ sprintf('%02d:%02d', $hour, $min) }}
@php $halfDayMap = collect($halfDayLeaves)->keyBy('id_employee'); @endphp @foreach ($employees as $employee) @php $isFullDay = in_array($employee->idEmployee, $checkleaves); $halfDayData = $halfDayMap->get($employee->idEmployee); $isHalfDay = $halfDayData !== null; $halfDayType = $halfDayData['half_day_type'] ?? null; @endphp
@for ($i = 1; $i <= 56; $i++) @php $disableRow = false; if ($isFullDay) { $disableRow = true; } elseif ($isHalfDay) { // 1–28 = Morning, 29–56 = Afternoon if ($halfDayType === 'morning' && $i <= 28) $disableRow = true; if ($halfDayType === 'afternoon' && $i > 28) $disableRow = true; } @endphp @endfor
{{ $employee->Full_Name }}
@endforeach
@endif
@endsection @section('script') @endsection