@extends('manage.layouts') @section('content')
ڕاپۆرتی کڕیارەکان
@if($filter_type == 'monthly' || $filter_type == 'yearly' || ($filter_type == 'customer' && $customer_id))

@if($filter_type == 'customer' && $selected_customer) ڕاپۆرتی مانگانەی {{$selected_customer->name}} @else چارتی باشترین کڕیارەکان @endif

@endif @if($filter_type == 'customer' && $customer_id && $selected_customer)

{{$selected_customer->name}}

@if($selected_customer->phone)
{{$selected_customer->phone}}
@endif @if($selected_customer->location)
{{$selected_customer->location}}
@endif
هەموو داواکاریەکان
{{number_format($customer_details['total_orders'])}}
کۆی داواکاریەکان
{{number_format($customer_details['total_amount'], 0)}} د.ع
کۆی کڕین
{{number_format($customer_details['avg_order'], 0)}} د.ع
مامناوەندی داواکاری
@if($customer_details['first_order'])
{{date('Y-m-d', strtotime($customer_details['first_order']->created_at))}}
یەکەم داواکاری
@endif @if($customer_details['last_order'])
{{date('Y-m-d', strtotime($customer_details['last_order']->created_at))}}
دوا داواکاری
@endif

ئامارەکانی مانگانە بۆ ساڵی {{$year}}

@foreach($customer_monthly_stats as $stat) @endforeach
مانگ ژمارەی داواکاریەکان کۆی کڕین
{{$stat['month']}} {{$stat['orders']}} {{number_format($stat['total'], 0)}} د.ع
@if(count($customer_top_products) > 0)

کاڵا زۆرترین کڕینەکان

@foreach($customer_top_products as $index => $product)
{{ $index + 1 }}
@if($product->image) @else
@endif
{{$product->kurdish}}
{{number_format($product->total_qty)}} دانە لە {{number_format($product->order_count)}} داواکاری
{{number_format($product->total_amount, 0)}} د.ع
@endforeach
@endif @if($customer_orders->count() > 0)

داواکاریە دواییەکان

@foreach($customer_orders as $order) @endforeach
ژمارە بەروار کۆی نرخ دۆخ کردار
#{{$order->id}} {{date('Y-m-d H:i', strtotime($order->created_at))}} {{number_format($order->total, 0)}} د.ع @if($order->status == 'new') نوێ @elseif($order->status == 'processing') لە ژێر پرۆسەدا @elseif($order->status == 'completed') تەواو بووە @else هەڵوەشێنراوە @endif
{{ $customer_orders->appends(request()->query())->links() }}
@endif
@endif @if($filter_type != 'customer')

باشترین 10 کڕیار (هەموو کاتەکان)

@foreach($top_customers_all_time as $index => $customer)
@if($index < 3) ژمارە {{$index + 1}} @endif {{$customer->name}} @if($customer->phone)
{{$customer->phone}}
@endif
{{number_format($customer->order_count)}}
ژمارەی داواکاریەکان
{{number_format($customer->total_amount, 0)}} د.ع
کۆی کڕین
{{number_format($customer->total_amount / $customer->order_count, 0)}} د.ع
مامناوەندی
@if($customer->last_order)
{{date('Y-m-d', strtotime($customer->last_order))}}
دوا داواکاری
@endif
@endforeach
@endif @if(($filter_type == 'monthly' || $filter_type == 'yearly') && count($top_customers_monthly) > 0)

لیستی باشترین کڕیارەکان بەپێی {{ $filter_type == 'monthly' ? 'مانگ' : 'ساڵ' }}

@foreach($chart_labels as $index => $label) @if($top_customers_monthly[$index]) @else @endif @endforeach
{{ $filter_type == 'monthly' ? 'مانگ' : 'ساڵ' }} ناوی کڕیار ژمارەی داواکاریەکان کۆی کڕین کردار
{{$label}}{{$top_customers_monthly[$index]->name}} {{$top_customers_monthly[$index]->order_count}} {{number_format($top_customers_monthly[$index]->total_amount, 0)}} د.ع هیچ داواکاریەک نییە
@endif
@endsection