@extends('backEnd.layouts.master') @section('title','Incomplete Orders') @push('styles') @endpush @section('content')
{{-- Stats --}}
@foreach([ ['label'=>'TOTAL INCOMPLETE','key'=>'all','color'=>'#6366f1','icon'=>'fa-exclamation-circle','active'=>'primary'], ['label'=>'TODAY', 'key'=>'today','color'=>'#22c55e','icon'=>'fa-calendar-day','active'=>'success'], ['label'=>'THIS WEEK', 'key'=>'week','color'=>'#06b6d4','icon'=>'fa-calendar-week','active'=>'info'], ['label'=>'THIS MONTH', 'key'=>'month','color'=>'#f59e0b','icon'=>'fa-calendar','active'=>'warning'], ] as $stat)
{{ $stat['label'] }}
{{ $counts[$stat['key']] }}
@endforeach
Incomplete Orders List
@csrf @method('DELETE')
@foreach([ ['all','All','#6366f1'], ['today','Today','#22c55e'], ['week','This Week','#06b6d4'], ['month','This Month','#f59e0b'], ] as [$k,$l,$color]) {{ $l }} ({{ $counts[$k] }}) @endforeach
@if(request('start_date'))@endif @if(request('end_date'))@endif
@php $sourceMap = [ 'facebook' => ['class'=>'is-facebook','label'=>'F'], 'fb' => ['class'=>'is-facebook','label'=>'F'], 'google' => ['class'=>'is-google','label'=>'G'], 'direct' => ['class'=>'is-direct','label'=>'D'], 'organic' => ['class'=>'is-organic','label'=>'S'], ]; @endphp @forelse($orders as $order) @php $thumb = $order->items->first()?->product_thumbnail ?? $order->items->first()?->product?->thumbnail; $src = strtolower($order->utm_source ?? 'direct'); $srcInfo = $sourceMap[$src] ?? ['class'=>'is-unknown','label'=>'?']; @endphp @empty @endforelse
ID Customer Location Products Date / Note Action
#{{ $order->id }}
{{ $srcInfo['label'] }}
{{ $order->customer_name }}
{{ $order->customer_phone }} @if($order->ip_address)
{{ $order->ip_address }}
@endif
@if($order->district || $order->upazila)
{{ $order->district ?: '—' }}
@if($order->upazila)
{{ $order->upazila }}
@endif @elseif($order->shipping_address && $order->shipping_address !== '—')
{{ Str::limit($order->shipping_address, 40) }}
@else Not specified @endif
@if($thumb)@endif
৳{{ number_format($order->amount) }}
{{ $order->items->count() }} Items
{{ $order->created_at->format('d M Y g:i A') }}
@if($order->admin_note) @include('backEnd.order.partials.order-note-list', ['noteText' => $order->admin_note]) @endif
Create
@csrf @method('DELETE')
No incomplete orders!
@if($orders->hasPages())
{{ $orders->links() }}
@endif
{{-- Note Modal --}} @endsection @push('scripts') @endpush