@extends('layouts.admin.app') @section('title', translate('Order List')) @push('css_or_js') @endpush @section('content')

{{ translate($status) }} {{ translate('Orders') }}

{{ $orders->total() }}
{{-- --}}

{{ translate('order filter') }}

@foreach ($orders as $key => $order) @endforeach
{{ translate('SL') }} {{ translate('Order_ID') }} {{ translate('Vehicle') }} {{ translate('Ordered Date') }} {{ translate('Customer_Info') }} {{ translate('Total_Amout') }} {{ translate('Order_Status') }} {{ translate('Delivered Date') }} {{ translate('actions') }}
{{ $orders->firstitem() + $key }} {{ $order['id'] }}
{{ $order['delivery_man']['vehicle_name'] ?? 'N/A' }}
{{ $order['delivery_man']['vehicle_number'] ?? 'N/A'}}
{{ date('d M Y', strtotime($order['created_at'])) }}
{{ date('h:i A', strtotime($order['created_at'])) }}
@if ($order->customer)
{{ $order->customer['f_name'] . ' ' . $order->customer['l_name'] }}
{{ $order->customer->phone }}
Block: {{ $order->deliveryAddress->block ?? 'N/A' }},{{ isset($order->deliveryAddress->house) ? 'House' : 'Building'}} {{ $order->deliveryAddress->house ?? $order->deliveryAddress->building }},Road: {{ $order->deliveryAddress->road ?? 'N/A' }} @else {{ translate('Customer_Unavailable') }} @endif
{{ \App\CentralLogics\Helpers::set_symbol($order['order_amount'] + $order['delivery_charge']) }}
@if ($order->payment_status == 'paid') {{ translate('paid') }} @else {{ translate('unpaid') }} @endif
@if ($order['order_status'] == 'pending') {{ translate('pending') }} @elseif($order['order_status'] == 'confirmed') {{ translate('confirmed') }} @elseif($order['order_status'] == 'processing') {{ translate('processing') }} @elseif($order['order_status'] == 'out_for_delivery') {{ translate('out_for_delivery') }} @elseif($order['order_status'] == 'delivered') {{ translate('delivered') }} @elseif($order['order_status'] == 'failed') {{ translate('failed_to_deliver') }} @else {{ str_replace('_', ' ', $order['order_status']) }} @endif @if (isset($order['order_note']))
@endif
@if (isset($order['order_status']) && $order['order_status'] == 'completed') {{ date('d M Y H:m:s', strtotime($order['updated_at'])) }} @else N/A @endif
@if ($order['order_status'] == 'pending' || $order['order_status'] == 'confirmed' || $order['order_status'] == 'processing') @endif {{-- --}}
{!! $orders->links() !!}
@endsection @push('script_2') @endpush