@extends('admin.layout') @section('title', 'إدارة الحجوزات') @section('page-title', 'إدارة الحجوزات') @section('content')
@php // Sample statistics - replace with actual data $stats = [ ['icon' => 'fas fa-calendar-check', 'value' => '156', 'label' => 'إجمالي الحجوزات', 'color' => '#FFD700'], ['icon' => 'fas fa-clock', 'value' => '23', 'label' => 'في الانتظار', 'color' => '#FFA500'], ['icon' => 'fas fa-check-circle', 'value' => '89', 'label' => 'مؤكدة', 'color' => '#28a745'], ['icon' => 'fas fa-car', 'value' => '44', 'label' => 'نشطة', 'color' => '#007bff'], ]; @endphp @foreach($stats as $stat)
{{ $stat['value'] }}
{{ $stat['label'] }}
@endforeach

فلترة النتائج

@php // Sample data - replace with actual data from controller $bookings = collect([ (object)[ 'id' => 1, 'booking_number' => 'BK-2024-001', 'customer_name' => 'أحمد محمد', 'customer_phone' => '+968 9123 4567', 'vehicle_name' => 'تويوتا كامري 2023', 'start_date' => '2024-02-01', 'end_date' => '2024-02-05', 'total_amount' => 450.00, 'status' => 'confirmed', 'created_at' => '2024-01-25' ], (object)[ 'id' => 2, 'booking_number' => 'BK-2024-002', 'customer_name' => 'فاطمة علي', 'customer_phone' => '+968 9876 5432', 'vehicle_name' => 'نيسان التيما 2022', 'start_date' => '2024-02-03', 'end_date' => '2024-02-07', 'total_amount' => 380.00, 'status' => 'pending', 'created_at' => '2024-01-26' ] ]); @endphp @if($bookings->count() > 0) @foreach($bookings as $booking) @endforeach
رقم الحجز العميل المركبة تاريخ البداية تاريخ النهاية المبلغ الحالة الإجراءات
{{ $booking->booking_number }}
{{ $booking->customer_name }}
{{ $booking->customer_phone }}
{{ $booking->vehicle_name }} {{ $booking->start_date }} {{ $booking->end_date }} {{ number_format($booking->total_amount, 2) }} ر.ع @php $statusColors = [ 'pending' => ['bg' => 'rgba(255, 193, 7, 0.2)', 'color' => '#ffc107', 'text' => 'في الانتظار'], 'confirmed' => ['bg' => 'rgba(40, 167, 69, 0.2)', 'color' => '#28a745', 'text' => 'مؤكدة'], 'active' => ['bg' => 'rgba(0, 123, 255, 0.2)', 'color' => '#007bff', 'text' => 'نشطة'], 'completed' => ['bg' => 'rgba(108, 117, 125, 0.2)', 'color' => '#6c757d', 'text' => 'مكتملة'], 'cancelled' => ['bg' => 'rgba(220, 53, 69, 0.2)', 'color' => '#dc3545', 'text' => 'ملغية'] ]; $status = $statusColors[$booking->status] ?? $statusColors['pending']; @endphp {{ $status['text'] }}
@else

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

لم يتم إنشاء أي حجوزات بعد

@endif
@endsection @push('styles') @endpush @push('scripts') @endpush @forelse($bookings as $booking) {{ $booking->id }}
{{ $booking->user->first_name }} {{ $booking->user->last_name }}
{{ $booking->user->email }}
{{ $booking->vehicle->make }} {{ $booking->vehicle->model }}
{{ $booking->vehicle->year }}
{{ $booking->start_date->format('Y-m-d') }} {{ $booking->end_date->format('Y-m-d') }} {{ number_format($booking->total_amount, 2) }} ر.ع @switch($booking->status) @case('pending') في الانتظار @break @case('confirmed') مؤكدة @break @case('active') نشطة @break @case('completed') مكتملة @break @case('cancelled') ملغية @break @default {{ $booking->status }} @endswitch
@if($booking->status == 'pending') @endif @if(in_array($booking->status, ['pending', 'confirmed'])) @endif
@empty

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

@endforelse @if(isset($bookings) && method_exists($bookings, 'links'))
{{ $bookings->links() }}
@endif @endsection