Arrastrá invitados confirmados a las mesas
Invitados confirmados {{ count($unassigned) }}
@forelse($unassigned as $item)
avatar {{ $item['label'] }}
@empty
No hay invitados confirmados pendientes de ubicar
@endforelse
Volver atrás
{{-- Exportar PDF oculto temporalmente según solicitud --}}
@forelse($tables as $name => $meta) @php $capacity = is_array($meta) ? ($meta['capacity'] ?? 8) : (int) $meta; $type = is_array($meta) ? ($meta['type'] ?? 'round') : 'round'; $assigned = $byTable[$name] ?? []; $posX = is_array($meta) ? (int)($meta['x'] ?? 40) : 40; $posY = is_array($meta) ? (int)($meta['y'] ?? 40) : 40; $pxPerCm = (float)($this->pxPerCm ?? 0.92); // Seats: fixed 50cm diameter $seatDiameterCm = 50; $seatSize = (int) round($seatDiameterCm * $pxPerCm); @endphp @if($type === 'round') @php $diameterCm = (int)($meta['dims']['diameter_cm'] ?? 160); $diameterPx = (int) round($diameterCm * $pxPerCm); $radiusTable = $diameterPx / 2; $radiusSeats = (int) round($radiusTable + ($seatSize / 1.35)); $container = (int) ceil(($radiusSeats + ($seatSize/2) + 16) * 2); $center = $container / 2; @endphp
{{ $name }}
{{ count($assigned) }}/{{ $capacity }}
@php // Build seat map from assigned list $seatMap = array_fill(0, max(1,$capacity), null); $pending = []; foreach ($assigned as $it) { $s = $it['seat'] ?? null; if ($s !== null && is_numeric($s) && (int)$s >= 0 && (int)$s < $capacity && $seatMap[(int)$s] === null) { $seatMap[(int)$s] = $it; } else { $pending[] = $it; } } for ($fi=0,$pi=0; $fi<$capacity && $pi @if($occ)
avatar
@php $nameWords = preg_split('/\s+/', (string)($occ['label'] ?? ''), -1, PREG_SPLIT_NO_EMPTY); @endphp @if(!empty($nameWords))
@foreach($nameWords as $w) {{ $w }} @endforeach
@endif @else {{ $i+1 }} @endif
@endfor
@else @php // Rectangular canvas geometry using cm→px $widthCm = (int)($meta['dims']['width_cm'] ?? 200); $heightCm = (int)($meta['dims']['height_cm'] ?? 90); $rectW = (int) round($widthCm * $pxPerCm); $rectH = (int) round($heightCm * $pxPerCm); $edgePad = 20; // visual padding around $rows = ($type === 'rect-2') ? 2 : 1; $containerW = (int) max($rectW + 2*($seatSize + $edgePad), 300); $containerH = (int) max($rectH + ($rows * ($seatSize + $edgePad)) + 60, 220); $rectX = ($containerW - $rectW) / 2; $rectY = ($containerH - $rectH) / 2; // Build seat map similar to round $seatMap = array_fill(0, max(1,$capacity), null); $pending = []; foreach ($assigned as $it) { $s = $it['seat'] ?? null; if ($s !== null && is_numeric($s) && (int)$s >= 0 && (int)$s < $capacity && $seatMap[(int)$s] === null) { $seatMap[(int)$s] = $it; } else { $pending[] = $it; } } for ($fi=0,$pi=0; $fi<$capacity && $pi single side (top) $topCount = $capacity; $bottomCount = 0; } // Helper to compute evenly spaced X positions along the rectangle width (relative to rect origin) $computeRowXs = function($n) use($rectW,$seatSize){ if ($n <= 0) return []; if ($n === 1) { return [ ($rectW - $seatSize)/2 ]; } $gap = ($rectW - $seatSize) / max(1, ($n-1)); $xs = []; for ($i=0; $i<$n; $i++) { $xs[] = $i*$gap; } return $xs; }; $topXs = $computeRowXs($topCount); $bottomXs = $computeRowXs($bottomCount); // Rows relative to rect origin: top sits above rect (negative), bottom below rect $topRowYRel = (int) -($seatSize + 10); $bottomRowYRel = (int) ($rectH + 10); @endphp
@php $angleDeg = (int)($meta['angle_deg'] ?? 0); @endphp
{{ $name }}
{{ count($assigned) }}/{{ $capacity }}
@for($i=0; $i<$topCount; $i++) @php $globalIndex = $i; $x = $topXs[$i] ?? 0; $occ = $seatMap[$globalIndex] ?? null; @endphp
@if($occ)
avatar
@php $nameWords = preg_split('/\s+/', (string)($occ['label'] ?? ''), -1, PREG_SPLIT_NO_EMPTY); @endphp @if(!empty($nameWords))
@foreach($nameWords as $w) {{ $w }} @endforeach
@endif
@else {{ $i+1 }} @endif
@endfor @for($j=0; $j<$bottomCount; $j++) @php $globalIndex = $topCount + $j; $x = $bottomXs[$j] ?? 0; $occ = $seatMap[$globalIndex] ?? null; @endphp
@if($occ)
avatar
@php $nameWords = preg_split('/\s+/', (string)($occ['label'] ?? ''), -1, PREG_SPLIT_NO_EMPTY); @endphp @if(!empty($nameWords))
@foreach($nameWords as $w) {{ $w }} @endforeach
@endif
@else {{ $globalIndex+1 }} @endif
@endfor
@endif @empty
No hay mesas creadas. Usá "Añadir mesa" para empezar.
@endforelse
{{ (int)round($this->zoom*100) }}%
@push('styles') @endpush @push('scripts') @endpush