@extends('layouts.app') @section('title', __('messages.tables_zones')) @section('content')
@if(session('success')) @endif @if(!$selectedBranch) {{-- Search and Branch Selection --}}

Select a Branch

Choose a branch to view and manage its tables and zones.

@forelse($branches as $branch)
{{ $branch->name }}

{{ $branch->address ?? 'No Address' }}

Manage Tables
@empty
No branches found matching your search.
@endforelse
@else {{-- Branch Header with Back Button --}}

{{ $selectedBranch->name }} - Tables & Zones

Managing zones and table performance statistics.


{{-- Date Range Filter --}}
{{-- Zones and Tables --}} @forelse($zones as $zone)
{{ $zone->name }}
{{ $zone->tables->count() }} Tables
@forelse($zone->tables as $table) @php $stats = $tableStats[$table->id] ?? null; @endphp
{{ ucfirst($table->status) }}
Table {{ $table->number }}
@csrf @method('DELETE')
{{-- Stats Section --}}
Orders {{ $stats['total_orders'] ?? 0 }}
Revenue ${{ number_format($stats['total_revenue'] ?? 0, 2) }}
@if($stats && $stats['avg_order_value'] > 0)
Avg. Order: ${{ number_format($stats['avg_order_value'], 2) }}
@endif
{{-- Edit Table Modal --}} @empty

No tables found in this zone.

@endforelse
{{-- Edit Zone Modal --}} {{-- Add Table Modal --}} @empty

No zones created for this branch yet.

Start by adding a zone to organize your tables.

@endforelse @endif
{{-- Universal Add Zone Modal --}} @if($selectedBranch) @endif @endsection