@extends('layouts.admin.master') @section('title') Bulk Orders @endsection @section('body')
{{-- TOP BAR --}}
Dashboard β€Ί Bulk Orders
⬇ Export CSV

πŸ“¦ Bulk Orders

All orders from the AI Bot, Order Form & WhatsApp
{{-- STATS --}}
{{ $orders->total() }}
Total Orders
{{ $orders->getCollection()->where('status','new')->count() }}
🟑 New
{{ $orders->getCollection()->where('status','confirmed')->count() }}
πŸ”΅ Confirmed
{{ $orders->getCollection()->where('status','processed')->count() }}
🟒 Processed
{{ $orders->getCollection()->where('status','cancelled')->count() }}
πŸ”΄ Cancelled
{{-- FILTER BAR --}}
@if(request('search') || request('status') || request('source')) βœ• Clear @endif
{{-- TABLE --}}

πŸ“¦ All Bulk Orders

{{ $orders->total() }} order{{ $orders->total() !== 1 ? 's' : '' }} Β· Page {{ $orders->currentPage() }} of {{ $orders->lastPage() }}
@if($orders->isEmpty())
πŸ“¦
No bulk orders yet
Orders placed via the AI Bot, Form or WhatsApp will appear here.
@else
@foreach($orders as $order) {{-- ID --}} {{-- CUSTOMER --}} {{-- BOOKS --}} {{-- GIFTING --}} {{-- SOURCE --}} {{-- DATE --}} {{-- STATUS --}} {{-- DETAILS --}} @endforeach
# Customer Books Ordered Gifting Source Date Status Details
#{{ $order->id }}
{{ $order->customer_name }}
@if($order->customer_email) πŸ“§ {{ $order->customer_email }}
@endif @if($order->customer_phone) πŸ“ž {{ $order->customer_phone }}@endif
@foreach($items as $item)
πŸ“– {{ $item['title'] ?? 'β€”' }} Γ—{{ $item['qty'] ?? 1 }}
@endforeach
Total: {{ $totalQty }} copies
@if($order->gifting) 🎁 Gift @if($order->gift_note)
"{{ Str::limit($order->gift_note, 40) }}"
@endif @else β€” @endif
@if($order->source === 'ai_bot') πŸ€– AI Bot @elseif($order->source === 'form') πŸ“‹ Form @elseif($order->source === 'whatsapp') πŸ’¬ WhatsApp @else {{ $order->source }} @endif {{ $order->created_at->format('d M Y') }}
{{ $order->created_at->format('h:i A') }}
{{-- PAGINATION --}} @if($orders->hasPages())
Showing {{ $orders->firstItem() }}–{{ $orders->lastItem() }} of {{ $orders->total() }} orders
{{ $orders->appends(request()->query())->links() }}
@endif @endif
{{-- ORDER DETAIL MODAL --}}
@endsection