@extends('layouts.app') @section('content') @php $locale = app()->getLocale(); $customer = $profile['customer']; $rental_summary = $profile['rental_summary']; $payment_summary = $profile['payment_summary']; $status_info = $profile['status_info']; $rating_info = $profile['rating_info']; @endphp
← {{ $locale == 'ar' ? 'العودة' : 'Back' }} @if($profile['status_info']['status'] === 'blacklisted') 🚫 {{ $locale == 'ar' ? 'محظور' : 'Blacklisted' }} @else @php $colorMap = [ 'danger' => 'bg-red-500/20 text-red-400', 'warning' => 'bg-yellow-500/20 text-yellow-400', 'info' => 'bg-blue-500/20 text-blue-400', 'success' => 'bg-green-500/20 text-green-400', ]; @endphp {{ $status_info['icon'] }} {{ $status_info['label'] }} @endif

{{ $customer->name }}

📱 {{ $customer->phone }} 📧 {{ $customer->email ?? '—' }} 📅 {{ $customer->created_at->format('Y-m-d') }}
{{ $locale == 'ar' ? 'إجمالي العقود' : 'Total Contracts' }}
{{ $rental_summary['total_contracts'] }}
{{ $rental_summary['active_contracts'] }} {{ $locale == 'ar' ? 'نشط' : 'active' }}, {{ $rental_summary['completed_contracts'] }} {{ $locale == 'ar' ? 'منتهية' : 'completed' }}
{{ $locale == 'ar' ? 'إجمالي المدفوع' : 'Total Paid' }}
{{ number_format($payment_summary['total_paid'], 0) }}
{{ $payment_summary['payment_percentage'] }}% {{ $locale == 'ar' ? 'من الإجمالي' : 'of total' }}
{{ $locale == 'ar' ? 'إجمالي التأخير' : 'Total Outstanding' }}
{{ number_format($payment_summary['overdue_amount'], 0) }}
{{ $locale == 'ar' ? 'ر.س' : 'SAR' }}
{{ $locale == 'ar' ? 'تقييم' : 'Rating' }}
{{ $rating_info['average_rating'] }}/5
{{ $rating_info['violation_count'] }} {{ $locale == 'ar' ? 'مخالفات' : 'violations' }}

{{ $locale == 'ar' ? '💰 ملخص الدفع' : '💰 Payment Summary' }}

{{ $locale == 'ar' ? 'إجمالي المبلغ' : 'Total Amount' }}
{{ number_format($payment_summary['total_amount'], 0) }}
{{ $locale == 'ar' ? 'المدفوع' : 'Paid' }}
{{ number_format($payment_summary['total_paid'], 0) }}
{{ $locale == 'ar' ? 'المتبقي' : 'Remaining' }}
{{ number_format($payment_summary['total_remaining'], 0) }}
{{ $locale == 'ar' ? 'رسوم التأخير' : 'Late Fees' }}
{{ number_format($payment_summary['total_late_fees'], 0) }}
{{ $locale == 'ar' ? 'نسبة السداد' : 'Payment Progress' }} {{ $payment_summary['payment_percentage'] }}%
@if($payment_summary['total_delays'] > 0)
⚠️ {{ $locale == 'ar' ? 'تأخيرات قائمة' : 'Pending Delays' }}
{{ $locale == 'ar' ? 'عدد التأخيرات:' : 'Count:' }} {{ $payment_summary['pending_delays'] }}
{{ $locale == 'ar' ? 'المبلغ المتأخر:' : 'Amount:' }} {{ number_format($payment_summary['total_delay_amount'], 0) }}
@endif

{{ $locale == 'ar' ? '📋 سجل العقود' : '📋 Contract History' }}

@forelse($contracts as $contract) @empty @endforelse
{{ $locale == 'ar' ? 'رقم العقد' : 'Contract #' }} {{ $locale == 'ar' ? 'السيارة' : 'Car' }} {{ $locale == 'ar' ? 'التاريخ' : 'Date' }} {{ $locale == 'ar' ? 'المبلغ' : 'Amount' }} {{ $locale == 'ar' ? 'المدفوع' : 'Paid' }} {{ $locale == 'ar' ? 'الحالة' : 'Status' }}
#{{ $contract['contract_number'] }} {{ $contract['car'] }} {{ $contract['start_date']->format('M d, Y') }} - {{ $contract['end_date']->format('M d, Y') }}
{{ $contract['days'] }} {{ $locale == 'ar' ? 'أيام' : 'days' }}
{{ number_format($contract['total_amount'], 0) }} {{ number_format($contract['paid_amount'], 0) }} @if($contract['status'] === 'active') ⏳ {{ $locale == 'ar' ? 'نشط' : 'Active' }} @elseif($contract['status'] === 'completed') ✅ {{ $locale == 'ar' ? 'منتهية' : 'Completed' }} @else ❌ {{ $locale == 'ar' ? 'ملغاة' : 'Cancelled' }} @endif
{{ $locale == 'ar' ? 'لا توجد عقود' : 'No contracts' }}

⚠️ {{ $locale == 'ar' ? 'المخالفات' : 'Violations' }}

@if($violations->count() > 0)
@foreach($violations->take(5) as $violation)
{{ $violation->description ?? '—' }}
{{ $violation->created_at->format('Y-m-d H:i') }}
@endforeach @if($violations->count() > 5)
+{{ $violations->count() - 5 }} {{ $locale == 'ar' ? 'مخالفات أخرى' : 'more violations' }}
@endif
@else
✅ {{ $locale == 'ar' ? 'لا توجد مخالفات' : 'No violations' }}
@endif

📅 {{ $locale == 'ar' ? 'تأخيرات السداد' : 'Payment Delays' }}

@if($paymentDelays->count() > 0)
@foreach($paymentDelays->take(5) as $delay)
{{ number_format($delay->delayed_amount, 0) }} {{ $locale == 'ar' ? 'ر.س' : 'SAR' }} {{ $delay->status }}
{{ $locale == 'ar' ? 'مستحق:' : 'Due:' }} {{ $delay->due_date->format('Y-m-d') }}
@endforeach @if($paymentDelays->count() > 5)
+{{ $paymentDelays->count() - 5 }} {{ $locale == 'ar' ? 'تأخيرات أخرى' : 'more delays' }}
@endif
@else
✅ {{ $locale == 'ar' ? 'لا توجد تأخيرات' : 'No delays' }}
@endif

{{ $locale == 'ar' ? '📊 الحالة الحالية' : '📊 Current Status' }}

{{ $status_info['icon'] }}
{{ $status_info['label'] }}
{{ $locale == 'ar' ? 'الحالة:' : 'Status:' }} {{ $status_info['status'] }}
@if($status_info['status'] === 'blacklisted' && isset($status_info['reason']))
{{ $locale == 'ar' ? 'سبب الحظر:' : 'Blacklist Reason:' }}
{{ $status_info['reason'] }}
@if($status_info['until'])
{{ $locale == 'ar' ? 'حتى:' : 'Until:' }} {{ $status_info['until']->format('Y-m-d') }}
@endif
@endif

{{ $locale == 'ar' ? '⭐ التقييم' : '⭐ Rating' }}

{{ $rating_info['average_rating'] }}
{{ $locale == 'ar' ? 'من 5 نقاط' : 'out of 5' }}
{{ $locale == 'ar' ? 'المخالفات:' : 'Violations:' }} {{ $rating_info['violation_count'] }}
{{ $locale == 'ar' ? 'التأخيرات:' : 'Late Payments:' }} {{ $rating_info['late_payment_count'] }}
{{ $locale == 'ar' ? 'العقود:' : 'Contracts:' }} {{ $rating_info['rental_count'] }}
{{ $locale == 'ar' ? 'مستوى الخطر:' : 'Risk Level:' }} {{ $rating_info['risk_level'] }}

{{ $locale == 'ar' ? '📅 ملخص العقود' : '📅 Rental Summary' }}

{{ $locale == 'ar' ? 'إجمالي العقود:' : 'Total Contracts:' }} {{ $rental_summary['total_contracts'] }}
{{ $locale == 'ar' ? 'نشطة:' : 'Active:' }} {{ $rental_summary['active_contracts'] }}
{{ $locale == 'ar' ? 'منتهية:' : 'Completed:' }} {{ $rental_summary['completed_contracts'] }}
{{ $locale == 'ar' ? 'عدد أيام الإيجار:' : 'Total Rental Days:' }} {{ $rental_summary['total_rental_days'] }}
📄 {{ $locale == 'ar' ? 'تحميل الملف' : 'Export Profile' }}
@endsection