@extends('layouts.admin', ['title' => 'إدارة العملاء']) @php $summary = $data['summary']; $customers = $data['customers']; $filters = $data['filters']; $fmt = fn ($minor) => number_format(($minor ?? 0) / 100, 2).' EGP'; @endphp @section('content')

بطاقات العملاء

بطاقات عملاء قابلة للتعديل: حالة العميل، درجة المخاطر، الهاتف، وتجميد المحفظة تلقائيًا عند الإيقاف.

إجمالي العملاء{{ number_format($summary['total']) }}
جدد بالفترة{{ number_format($summary['new']) }}
نشطون{{ number_format($summary['active']) }}
محافظ مجمدة{{ number_format($summary['frozenWallets']) }}
@csrf
@forelse($customers as $customer)
{{ mb_strtoupper(mb_substr($customer->display_name ?: $customer->name, 0, 1)) }}

{{ $customer->display_name ?: $customer->name }}

{{ $customer->email }}
{{ $customer->status === 'active' ? 'نشط' : 'موقوف' }}
الإنفاق{{ $fmt($customer->total_spent_minor ?: $customer->total_spent_range) }}
الطلبات{{ number_format($customer->orders_count) }}
الرصيد{{ $fmt($customer->wallet?->balance_minor) }}
درجة المخاطر{{ $customer->risk_score }}/100{{ $customer->wallet?->is_frozen ? 'المحفظة مجمدة' : 'المحفظة نشطة' }}
آخر دخول{{ $customer->last_login_at?->diffForHumans() ?: 'لم يدخل' }}{{ $customer->locale }}
فتح ملف 360
@csrf @method('PATCH')
@empty
لا يوجد عملاء بعد.
@endforelse
{{ $customers->links() }}
@endsection