@extends('layouts.user') @section('title', 'حجوزاتي — دمشق باركينغ') @section('content') {{-- Page header --}}
العودة

حجوزاتي

سجل حجوزاتك في مواقف السيارات

{{-- ── Debt banner ─────────────────────────────────────────────────────────── --}} @if($pendingDebt > 0)
رصيد مستحق غير مدفوع
لديك رسوم إلغاء متراكمة بقيمة {{ number_format($pendingDebt) }} ل.س — ستُضاف تلقائياً إلى حجزك القادم.
{{ number_format($pendingDebt) }} ل.س
@endif {{-- ── Stats row ──────────────────────────────────────────────────────────── --}}
@php $statCards = [ ['label' => 'إجمالي الحجوزات', 'value' => $stats['total'], 'icon' => 'bi-calendar3', 'color' => '#6366f1', 'bg' => 'rgba(99,102,241,.1)'], ['label' => 'نشطة', 'value' => $stats['active'], 'icon' => 'bi-clock-history', 'color' => '#f59e0b', 'bg' => 'rgba(245,158,11,.1)'], ['label' => 'مكتملة', 'value' => $stats['completed'], 'icon' => 'bi-check-circle', 'color' => '#10b981', 'bg' => 'rgba(16,185,129,.1)'], ['label' => 'ملغاة', 'value' => $stats['cancelled'], 'icon' => 'bi-x-circle', 'color' => '#ef4444', 'bg' => 'rgba(239,68,68,.1)'], ]; @endphp @foreach($statCards as $s)
{{ $s['value'] }}
{{ $s['label'] }}
@endforeach
{{-- ── Bookings table ──────────────────────────────────────────────────────── --}}
قائمة الحجوزات {{ $stats['total'] }} حجز
@if($bookings->isEmpty())

لا توجد حجوزات بعد

ابدأ بالبحث عن موقف وحجز مكانك

تصفح المواقف
@else
@foreach($bookings as $booking) @php $canCancel = $booking->status === 'active' && $booking->source === 'reservation'; $hasDebt = $booking->status === 'cancelled' && $booking->total_fee > 0 && is_null($booking->paid_at); $isFree = $booking->status === 'cancelled' && ($booking->total_fee == 0 || is_null($booking->total_fee)); $isPaid = $booking->status === 'completed' || ($booking->status === 'cancelled' && !is_null($booking->paid_at) && $booking->total_fee > 0); @endphp {{-- Fee column --}} {{-- Status column --}} {{-- Action column --}} @endforeach
# الموقف بدء انتهاء الرسوم الحالة إجراء
{{ $booking->id }} {{ $booking->parkingLot?->name ?? '—' }}
{{ $booking->parkingLot?->address }}
{{ $booking->start_time->format('Y/m/d') }}
{{ $booking->start_time->format('H:i') }}
{{ $booking->end_time->format('Y/m/d') }}
{{ $booking->end_time->format('H:i') }}
@if($hasDebt) {{ number_format($booking->total_fee) }} ل.س
مستحق
@elseif($booking->total_fee > 0 && !is_null($booking->paid_at)) {{ number_format($booking->total_fee) }} ل.س
مدفوع
@elseif($booking->total_fee > 0) {{ number_format($booking->total_fee) }} ل.س @elseif($isFree && $booking->status === 'cancelled') مجاني @else @endif
@if($booking->status === 'active') @if($booking->source === 'reservation') حجز مسبق @else داخل الموقف @endif @elseif($booking->status === 'completed') مكتمل @else @if($hasDebt) ملغي — رسوم معلقة @else ملغي @endif @endif @if($canCancel) @else @endif
@endif
{{-- ══════════════════════════════════════════════════════════════════════════ CANCEL RESERVATION MODAL ══════════════════════════════════════════════════════════════════════════ --}} {{-- Toast container --}}
@push('scripts') @endpush @endsection