{{-- Example: admin/orders/index.blade.php --}} @extends('layouts.app') {{-- Or your admin layout --}} @section('title', __('orders.index.title')) @section('content')

{{ __('orders.index.header') }}

{{-- Export Section with Advanced Options --}}
{{-- The form now wraps the export button and includes date inputs --}}
{{-- Hidden by default, shown by Alpine toggle --}}
{{-- Display applied filters if any --}} @if (request()->filled('start_date') || request()->filled('end_date'))
{{ __('orders.index.filters_active_notice') }} @if (request()->filled('start_date')) {{ __('orders.index.start_date') }}: {{ request('start_date') }} @endif @if (request()->filled('end_date')) @if (request()->filled('start_date')) | @endif{{ __('orders.index.end_date') }}: {{ request('end_date') }} @endif ({{ __('orders.index.clear_filters_button') }})
@endif {{-- Your existing table or list of orders --}} @if ($orders->count() > 0)
@foreach ($orders as $order) @endforeach
{{ __('orders.table.order_id') }} {{ __('orders.table.status') }} {{ __('orders.table.contact_email') }} {{ __('orders.table.total_value') }} {{ __('orders.table.date') }} {{ __('orders.table.actions') }}
#{{ $order->id }} {{ ucfirst(__($order->status)) }} {{ $order->contact_email }} ${{ number_format($order->total_product_value + $order->donation_amount, 2) }} {{ $order->created_at->format('M d, Y') }} {{ __('orders.index.view_button') }}
{{-- Append existing query parameters (like page) to pagination links, but not export-specific ones if they conflict --}} {{ $orders->appends(request()->except(['start_date', 'end_date']))->links() }}
@else

{{ __('orders.index.no_orders_found') }}

@endif
@endsection