@extends('layouts.admin', ['title' => 'ملف العميل']) @php $fmt = fn ($minor) => number_format(($minor ?? 0) / 100, 2).' ج.م'; $name = $customer->display_name ?: $customer->name; $statusLabels = ['active' => 'نشط', 'suspended' => 'موقوف', 'frozen' => 'مجمد', 'banned' => 'محظور', 'deleted' => 'محذوف']; $tierLabels = ['general' => 'عام', 'silver' => 'سلفر', 'vip_silver' => 'VIP فضي', 'merchant_gold' => 'تاجر ذهبي']; @endphp @section('content')
{{ mb_strtoupper(mb_substr($name, 0, 1)) }}

{{ $name }}

ID: {{ $customer->public_id ?: $customer->id }}

{{ $statusLabels[$customer->status] ?? $customer->status }} {{ $tierLabels[$customer->customer_tier ?? 'general'] ?? 'عام' }}
إجمالي الإنفاق{{ $fmt($customer->total_spent_minor) }}
الطلبات{{ number_format($customer->orders_count) }}
الرصيد{{ $fmt($customer->wallet?->balance_minor) }}
نقاط مكتسبة{{ number_format($customer->loyalty_points) }}

تحكم العميل

@csrf @method('PATCH')

تعديل المحفظة

@csrf

طلبات العميل

@forelse($orders as $order) @empty @endforelse
الطلبالمنتجاتالمبلغالحالةالتاريخ
{{ $order->order_number }} {{ $order->items->pluck('name_snapshot')->join('، ') }} {{ $fmt($order->total_minor) }} {{ $order->fulfillment_status }} {{ $order->created_at->format('Y-m-d H:i') }}
لا توجد طلبات بعد.

سجل المحفظة

@forelse($walletEntries as $entry)
{{ $entry->description ?: $entry->type }}{{ $fmt($entry->amount_minor) }}{{ $entry->created_at->diffForHumans() }}
@empty
لا توجد حركات محفظة.
@endforelse

تذاكر الدعم

@forelse($tickets as $ticket) {{ $ticket->subject }}{{ $ticket->status }}{{ $ticket->created_at->diffForHumans() }} @empty
لا توجد تذاكر دعم.
@endforelse
@endsection