@foreach ($tables as $area)
{{ $area->area_name }}
{{ $area->tables->count() }} @lang('modules.table.table')
@foreach ($area->tables as $item) @php $isLocked = $item->tableSession?->isLocked() ?? false; $isLockedByCurrentUser = $isLocked && $item->tableSession?->locked_by_user_id === auth()->id(); $isLockedByOtherUser = $isLocked && $item->tableSession?->locked_by_user_id !== auth()->id(); $isActive = $item->status == 'active'; $isInactive = $item->status == 'inactive'; @endphp
$isInactive, 'bg-white hover:bg-gray-50' => $isActive && !$isLocked, 'bg-orange-50 border-orange-200' => $isLockedByOtherUser, 'bg-blue-50 border-blue-200' => $isLockedByCurrentUser ])> @if($isLocked)
@if(user()->hasRole('Admin_' . user()->restaurant_id))
$isLockedByCurrentUser, 'bg-red-500 hover:bg-red-600' => !$isLockedByCurrentUser, ]) title="{{ $isLockedByCurrentUser ? __('modules.table.lockedByYou') : __('modules.table.forceUnlock') }} at {{ $item->tableSession->locked_at->format('H:i') }}">
@elseif($isLockedByCurrentUser)
@else
@endif
@endif
@if ($isInactive)
@lang('app.inactive')
@endif @php $statusClasses = [ 'p-2 rounded-lg tracking-wide', 'bg-green-100 text-green-600' => $item->available_status == 'available' && !$isLocked, 'bg-red-100 text-red-600' => $item->available_status == 'reserved', 'bg-blue-100 text-blue-600' => $item->available_status == 'running', 'bg-orange-100 text-orange-600' => $isLockedByOtherUser, 'bg-blue-100 text-blue-600' => $isLockedByCurrentUser ]; @endphp
{{ $item->table_code }}
{{ $item->seating_capacity }} @lang('modules.table.seats')
@endforeach
@endforeach
@lang('modules.reservation.todayReservations')
@forelse ($reservations as $item)
{{ $item->table->table_code }}
{{ $item->party_size }} @lang('modules.reservation.guests')
{{ $item->reservation_date_time->translatedFormat('h:i A') }}
@empty
@lang('messages.noTableReserved')
@endforelse