@extends('layouts.admin') @section('title', 'لوحة المشغّل — دمشق باركينغ') @section('page-title', 'لوحة المشغّل') @push('styles') @endpush @section('content') {{-- ══════════════════════════════════════════════════════════════════════ LOT PICKER — shown when no lot is selected ══════════════════════════════════════════════════════════════════════ --}} @if(!$selectedLot)

اختر موقف السيارات

ابحث عن موقفك وابدأ إدارة السيارات

{{ $parkingLots->count() }} موقف متاح
{{-- Search bar --}}
{{-- ── Cards column ──────────────────────────────────────────────── --}}
@forelse($parkingLots as $lot) @php $pct = $lot['total'] > 0 ? round($lot['occupied'] / $lot['total'] * 100) : 0; $avail = $lot['avail']; if ($avail === 0) { $badgeCls = 'badge-soft-danger'; $badgeTxt = 'ممتلئ'; $barCol = '#ef4444'; } elseif ($avail < $lot['total'] * 0.2) { $badgeCls = 'badge-soft-warning'; $badgeTxt = $avail.' محدود'; $barCol = '#f59e0b'; } else { $badgeCls = 'badge-soft-success'; $badgeTxt = $avail.' متاح'; $barCol = '#10b981'; } @endphp
{{ $lot['name'] }}
{{ $lot['address'] }}
{{ $badgeTxt }}
{{ $lot['total'] }} مكان {{ number_format($lot['price']) }}/ساعة {{ $lot['hours'] }}
@empty
لا توجد مواقف نشطة
@endforelse
{{-- ── Map column ─────────────────────────────────────────────────── --}}
خريطة المواقف اضغط على الموقف للتحديد
{{-- Mobile tab toggle --}}
{{-- ══════════════════════════════════════════════════════════════════════ OPERATOR PANEL — shown after lot is selected ══════════════════════════════════════════════════════════════════════ --}} @else @php $pct = $selectedLot->usage_percentage; $barColor = $pct >= 90 ? '#ef4444' : ($pct >= 60 ? '#f59e0b' : '#10b981'); $totalCards = $activeCars->count() + $reservations->count(); @endphp {{-- ── Selected lot header ─────────────────────────────────────────── --}}
{{ $selectedLot->name }}
{{ $selectedLot->address }}
{{ $selectedLot->available_spaces }}
متاح
{{ $selectedLot->occupied_spaces }}
مشغول
{{ $selectedLot->total_capacity }}
إجمالي
الإشغال{{ round($pct) }}%
تغيير الموقف
{{-- ── Toolbar: search + new entry ─────────────────────────────────── --}}
{{ $reservations->count() }} حجز مسبق {{ $activeCars->count() }} داخل الآن
{{-- ── Booking cards grid ───────────────────────────────────────────── --}}
{{-- Reservation cards (not yet arrived) --}} @foreach($reservations as $res)
حجز مسبق #{{ $res->id }}
{{ $res->vehicle_plate ?? '—' }}
{{ $res->customer_name ?? 'غير محدد' }} @if($res->phone)
{{ $res->phone }}
@endif
{{ $res->start_time->format('H:i') }} — {{ $res->end_time->format('H:i') }} {{ $res->start_time->format('d/m') }}

@endforeach {{-- Walk-in cards (already inside) --}} @foreach($activeCars as $car) @php $elapsedMin = $car->start_time->diffInMinutes(now()); $remainMins = now()->diffInMinutes($car->end_time, false); $isOverdue = $remainMins < 0; @endphp
داخل الموقف
{{ $car->vehicle_plate ?? '—' }}
{{ $car->customer_name ?? 'غير محدد' }} @if($car->phone)
{{ $car->phone }}
@endif
دخل {{ $car->start_time->format('H:i') }}  ·  {{ floor($elapsedMin/60) }}س {{ $elapsedMin%60 }}د
@if($isOverdue)
تجاوز {{ floor(abs($remainMins)/60) }}س {{ abs($remainMins)%60 }}د
@else
متبقي {{ floor($remainMins/60) }}س {{ $remainMins%60 }}د
@endif
@endforeach {{-- Empty state --}} @if($totalCards === 0)

لا توجد سيارات أو حجوزات نشطة

سجّل دخول سيارة جديدة للبدء

@endif {{-- No search results --}}
{{-- Auto-refresh countdown --}}
@endif {{-- end selectedLot --}} {{-- ══════════════════════════════════════════════════════════════════════ DIRECT ENTRY MODAL ══════════════════════════════════════════════════════════════════════ --}} {{-- ══════════════════════════════════════════════════════════════════════ RECEIPT & PAYMENT MODAL ══════════════════════════════════════════════════════════════════════ --}} @push('scripts') @endpush @endsection