{{-- resources/views/admin/bookings/index.blade.php --}} @extends('admin.layouts.app') @section('title', $pageTitle ?? 'الحجوزات') @push('styles') @endpush @section('content') @php $c = $cols ?? []; $F = $filters ?? []; @endphp

{{ $pageTitle ?? 'الحجوزات' }}

تحديث
{{-- KPIs --}}
إجمالي السجلات
{{ number_format($bookings->total()) }}
@if(!empty($c['amount']))
@php $pageSum = $bookings->getCollection()->sum(fn($row)=> (float)($row->{$c['amount']} ?? 0)); @endphp
إجمالي المبالغ (صفحة)
{{ number_format($pageSum, 2) }}
@endif @if(!empty($c['payment_status']))
@php $paidCount = $bookings->getCollection()->filter(function($row) use($c){ $v = $row->{$c['payment_status']} ?? null; return in_array((string)$v, ['1','true','paid','Paid','PAID'], true); })->count(); @endphp
مدفوع (صفحة)
{{ number_format($paidCount) }}
@endif @if(!empty($c['status']))
أحدث حالة ظاهرة
{{ optional($bookings->first())?->{$c['status'] ?? ''} ?? '—' }}
@endif
{{-- فلاتر البحث --}}
@if(!empty($c['status']))
@endif @if(!empty($c['payment_status']))
@php $ps = $F['payment_status'] ?? ''; @endphp
@endif @if(!empty($c['package_id']))
@endif @php $dateCol = $c['booking_date'] ?? $c['created_at'] ?? null; @endphp @if($dateCol)
@endif
@php $pp = (int)($F['per_page'] ?? 20); @endphp
{{-- جدول الحجوزات --}}
@if(!empty($c['reference'])) @endif @if(!empty($c['customer_name'])) @endif @if(empty($c['customer_name']) && !empty($c['email'])) @endif @if(!empty($c['phone'])) @endif @if(!empty($c['amount'])) @endif @if(!empty($c['payment_status'])) @endif @if(!empty($c['status'])) @endif @if(!empty($c['booking_date']) || !empty($c['created_at'])) @endif @forelse($bookings as $row) @if(!empty($c['reference'])) @endif @if(!empty($c['customer_name'])) @elseif(!empty($c['email'])) @endif @if(!empty($c['phone'])) @endif @if(!empty($c['amount'])) @endif @if(!empty($c['payment_status'])) @php $pv = $row->{$c['payment_status']} ?? null; $paid = in_array((string)$pv, ['1','true','paid','Paid','PAID'], true); $pTxt = $paid ? 'مدفوع' : ( ($pv==='pending'||$pv==='Pending') ? 'قيد الانتظار' : (in_array((string)$pv,['0','false','unpaid'],'true')?'غير مدفوع':(string)$pv) ); $pCls = $paid ? 'bg-success' : ( ($pv==='pending'||$pv==='Pending') ? 'bg-warning text-dark' : 'bg-danger'); @endphp @endif @if(!empty($c['status'])) @php $sv = (string)($row->{$c['status']} ?? ''); $sCls = str_contains(strtolower($sv),'confirm') ? 'bg-info' : (str_contains(strtolower($sv),'cancel') ? 'bg-danger' : (str_contains(strtolower($sv),'pend') ? 'bg-warning text-dark' : 'badge-soft')); @endphp @endif @php $dateCol = $c['booking_date'] ?? $c['created_at'] ?? null; @endphp @if($dateCol) @endif @empty @endforelse
#المرجعالعميلالإيميلالهاتفالمبلغالدفعالحالةالتاريخإجراءات
{{ $row->{$c['id'] ?? 'id'} ?? '—' }}{{ $row->{$c['reference']} }}{{ $row->{$c['customer_name']} }}{{ $row->{$c['email']} }}{{ $row->{$c['phone']} }}{{ number_format((float)($row->{$c['amount']} ?? 0), 2) }}{{ $pTxt }}{{ $sv !== '' ? $sv : '—' }} {{ optional($row->{$dateCol} ?? null)->format('Y-m-d') ?? (is_string($row->{$dateCol} ?? null) ? \Illuminate\Support\Str::substr($row->{$dateCol},0,10) : '—') }}
@if(!empty($c['status']) || !empty($c['payment_status'])) @endif
@if(!empty($c['status']) || !empty($c['payment_status'])) @endif
لا توجد نتائج حالياً.
عرض {{ $bookings->firstItem() }}–{{ $bookings->lastItem() }} من أصل {{ $bookings->total() }}
@endsection @push('scripts') @endpush