@extends('layouts.admin')
@section('title', 'لوحة المشغّل — دمشق باركينغ')
@section('page-title', 'لوحة المشغّل')
@section('styles')
@endsection
@section('content')
{{-- ══════════════════════════════════════════════════════════════════════
LOT PICKER — no lot selected
══════════════════════════════════════════════════════════════════════ --}}
@if(!$selectedLot)
@php
$gradients = [
'linear-gradient(135deg,#1e1b4b 0%,#4338ca 100%)',
'linear-gradient(135deg,#064e3b 0%,#10b981 100%)',
'linear-gradient(135deg,#1e3a8a 0%,#3b82f6 100%)',
'linear-gradient(135deg,#7c2d12 0%,#f97316 100%)',
'linear-gradient(135deg,#4a044e 0%,#9333ea 100%)',
'linear-gradient(135deg,#0f172a 0%,#475569 100%)',
];
@endphp
{{-- Header + search bar --}}
اختر موقف السيارات
اضغط على الموقف للبدء في إدارة السيارات
{{ $parkingLots->count() }} موقف متاح
{{-- Portrait card grid --}}
@forelse($parkingLots as $lot)
@php
$pct = $lot['total'] > 0 ? round($lot['occupied'] / $lot['total'] * 100) : 0;
$avail = $lot['avail'];
$gradient = $gradients[$lot['id'] % 6];
$locked = $lot['locked'] ?? false;
if ($avail === 0) { $badgeColor='rgba(239,68,68,.82)'; $badgeTxt='ممتلئ'; $barCol='#ef4444'; }
elseif ($avail < $lot['total'] * 0.2) { $badgeColor='rgba(245,158,11,.82)'; $badgeTxt=$avail.' مكان'; $barCol='#f59e0b'; }
else { $badgeColor='rgba(16,185,129,.82)'; $badgeTxt=$avail.' متاح'; $barCol='#10b981'; }
@endphp
{{-- Image or gradient placeholder --}}
@if($lot['image'])
![{{ $lot['name'] }}]({{ $lot['image'] }})
@else
{{ $lot['name'] }}
@endif
@if($locked)
غير مخصص لك
@else
{{ $badgeTxt }}
@endif
{{-- Card body --}}
{{ $lot['name'] }}
{{ $lot['address'] }}
{{ $lot['total'] }} مكان
{{ number_format($lot['price']) }} ل.س/س
{{ $lot['hours'] }}
@if(!$locked)
@endif
@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 }} مشغول
@if(!$assignedLotId)
تغيير الموقف
@endif
{{-- Search container --}}
{{-- Section heading --}}
قائمة الحجوزات والسيارات النشطة
{{-- Cards grid --}}
{{-- Reservation cards --}}
@foreach($reservations as $res)
{{ $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
══════════════════════════════════════════════════════════════════════ --}}
{{-- Plate + duration --}}
{{-- Times --}}
{{-- Fee breakdown --}}
{{-- Payment method --}}
{{-- ══════════════════════════════════════════════════════════════════════
CANCEL RESERVATION MODAL
══════════════════════════════════════════════════════════════════════ --}}
{{-- ══════════════════════════════════════════════════════════════════════
ACTIVATE RESERVATION CONFIRM MODAL
══════════════════════════════════════════════════════════════════════ --}}
🚗
هل تريد تفعيل هذا الحجز؟
سيتم تسجيل وقت الدخول الآن وفتح البوابة للسيارة.
@push('scripts')
@endpush
@endsection