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

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

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

{{ $parkingLots->count() }} موقف متاح
@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
خريطة المواقف اضغط على الموقف للتحديد
{{-- ══════════════════════════════════════════════════════════════════════ OPERATOR PANEL — lot selected ══════════════════════════════════════════════════════════════════════ --}} @else @php $pct = $selectedLot->usage_percentage; $barColor = $pct >= 90 ? '#ef4444' : ($pct >= 60 ? '#f59e0b' : '#10b981'); @endphp {{-- Slim lot info bar --}}
{{ $selectedLot->name }} {{ $selectedLot->address }}
{{ $selectedLot->available_spaces }} متاح {{ $selectedLot->occupied_spaces }} مشغول تغيير الموقف
{{-- Search container --}}
{{-- Section heading --}}
قائمة الحجوزات والسيارات النشطة
{{-- Cards grid --}}
{{-- Reservation cards --}} @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 --}} @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 ?? 'غير محدد' }}

دخل {{ $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($activeCars->isEmpty() && $reservations->isEmpty())

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

@endif {{-- No search results --}}
@endif {{-- end selectedLot --}} {{-- ══════════════════════════════════════════════════════════════════════ DIRECT ENTRY MODAL ══════════════════════════════════════════════════════════════════════ --}} {{-- ══════════════════════════════════════════════════════════════════════ CHECKOUT / RECEIPT MODAL ══════════════════════════════════════════════════════════════════════ --}} @push('scripts') @endpush @endsection