@foreach($rooms as $room)
{{ $room->room_number }}
{{ $room->typeRoom->name ?? 'Unknown' }}
{{ ucfirst($room->status ?? 'available') }}
@for($day = 1; $day <= $daysInMonth; $day++)
@php
$currentDateLoop = Carbon\Carbon::create($currentDate->year, $currentDate->month, $day);
$booking = $roomBookings[$room->id][$currentDateLoop->format('Y-m-d')] ?? null;
$cellClass = 'calendar-cell';
$cellData = '';
$cellContent = '';
$isToday = $currentDateLoop->isToday();
if ($booking) {
$cellClass .= ' has-booking status-' . $booking['status'];
$cellData = "data-booking-id='{$booking['booking_id']}' data-guest='{$booking['guest_name']}'";
// Check if this is start or end of booking
if ($booking['is_start']) {
$cellClass .= ' booking-start';
$cellContent = '
' . Str::limit($booking['guest_name'], 8) . '
';
} elseif ($booking['is_end']) {
$cellClass .= ' booking-end';
$cellContent = '
';
} else {
$cellClass .= ' booking-middle';
$cellContent = '
';
}
} else {
$cellClass .= ' available';
$cellContent = '
';
}
if ($isToday) {
$cellClass .= ' today';
}
@endphp
{!! $cellContent !!}
@if($isToday)
@endif
@endfor
@endforeach