@extends('layouts.app')
@section('title', 'My Calendar — ' . $periodStart->format('F Y'))
@section('nav_calendar', 'bg-teal-50 text-teal-700 font-semibold')
@section('page_title', 'My Calendar')
@section('page_subtitle', $periodStart->format('F Y'))
@section('content')
@php
$CELL = 40; // px per day column
$ROOM = 160; // px for room label column
$statusClasses = [
'pending' => 'bg-amber-100 border-[0.5px] border-amber-300 text-amber-800',
'confirmed' => 'bg-teal-100 border-[0.5px] border-teal-300 text-teal-800',
'checked_in' => 'bg-green-100 border-[0.5px] border-green-300 text-green-800',
'checked_out' => 'bg-gray-100 border-[0.5px] border-gray-300 text-gray-400',
];
$statusLabels = [
'pending' => 'Pending',
'confirmed' => 'Confirmed',
'checked_in' => 'In House',
'checked_out' => 'Checked Out',
];
$floors = $roomsByFloor->keys()->toArray();
@endphp
@if(session('success'))
@endif
@if(session('error'))
@endif
{{-- ===== TOP BAR: month nav ===== --}}
{{-- ===== FILTER TOOLBAR ===== --}}
{{-- Search --}}
{{-- Separator --}}
{{-- Status filter --}}
Status
{{-- Separator --}}
{{-- Floor filter --}}
Floor
@foreach($floors as $f)
@endforeach
{{-- Separator + Hide empty (pushed right) --}}
{{-- ===== CALENDAR GRID ===== --}}
{{-- ── HEADER ROW ── --}}
{{-- Corner --}}
Room
{{-- Day columns --}}
@foreach($days as $i => $day)
@php $isToday = $todayOffset === $i; $isWeekend = in_array($day->dayOfWeek, [0, 6]); @endphp
{{ $day->format('D') }}
{{ $day->format('j') }}
@endforeach
{{-- ── FLOOR + ROOM ROWS ── --}}
@foreach($roomsByFloor as $floor => $floorRooms)
{{-- Wrap the whole floor section so x-show hides both divider + rooms --}}
{{-- Floor divider row --}}
Floor {{ $floor }}
@foreach($days as $i => $day)
@php $isToday = $todayOffset === $i; $isWeekend = in_array($day->dayOfWeek, [0, 6]); @endphp
@endforeach
{{-- Room rows --}}
@foreach($floorRooms as $room)
@php $roomHasRes = count($bars[$room->no] ?? []) > 0; @endphp
{{-- Sticky room label --}}
{{ $room->no }}
{{ $room->type }}
@php
$dot = match($room->status) {
'occupied' => 'bg-green-400',
'dirty' => 'bg-orange-400',
'maintenance' => 'bg-red-400',
'out_of_order'=> 'bg-red-600',
'clean' => 'bg-teal-400',
default => 'bg-gray-200',
};
@endphp
{{-- Timeline cell --}}
{{-- Day gridlines + weekend/today shading --}}
@foreach($days as $i => $day)
@php $isToday = $todayOffset === $i; $isWeekend = in_array($day->dayOfWeek, [0, 6]); @endphp
@endforeach
{{-- SortableJS drop zone — contains only bars (not gridlines) --}}
{{-- end .cal-drop-zone --}}
@endforeach
{{-- end floor group --}}
@endforeach
{{-- ===== FLOATING TOOLTIP ===== --}}
{{-- end calendarData() --}}
{{-- ===== ROOM TRANSFER MODAL ===== --}}
{{-- Backdrop --}}
{{-- Panel --}}
{{-- Header --}}
{{-- Body --}}
{{-- Guest info --}}
{{-- Room arrows --}}
{{-- Warning if room not clean/available --}}
Room is and cannot accept a transfer. Drop the guest onto a different room.
{{-- Transfer form --}}
@endsection