@php
$totalTableCount = 0;
$availableTableCount = 0;
$reservationTableCount = 0;
$occupiedTableCount = 0;
@endphp
@if (count($tables) != 0)
@foreach ($tables as $table)
@php
$totalTableCount++;
$occupied = false;
$reserved = false;
foreach ($occupiedTables as $occupiedTable) {
if ($table['table_id'] == $occupiedTable['table_id']) {
$occupied = true;
$occupiedTableCount++;
break;
}
}
foreach ($reservationTables as $reservationTable) {
if ($table['table_id'] == $reservationTable['table_id']) {
$reserved = true;
$reservationTableCount++;
break;
}
}
$disabled = $occupied ? 'disabled' : '';
$backgroundColor = $occupied ? 'red' : ($reserved ? 'orange' : 'white');
$textColor = $occupied ? 'white' : ($reserved ? 'white' : 'black');
@endphp
@endforeach
@php
$availableTableCount =
$totalTableCount - ($occupiedTableCount + $reservationTableCount);
@endphp
@endif