@extends('layouts.app') @section('page-title')| Order History @endsection @section('content') @php $resto = \App\Restaurants::find(\App\Helpers\CommonMethods::getRestuarantID()); $lang = $resto->default_lang; app()->setLocale($lang); if(session('app_lang') !==null){ $lang = session('app_lang'); app()->setLocale($lang); } $restuarant1 = $resto ; $resto_meta = isset($restuarant1->resto_metas)?$restuarant1->resto_metas:null; //dump($resto_meta); $resto_metas = []; $billing = []; if(isset($resto_meta)){ foreach($resto_meta as $meta){ if($meta->outlet_id!=""){ continue; } $index_name = isset($meta->resto_meta_defs->parents)?$meta->resto_meta_defs->parents->meta_def_name:$meta->resto_meta_defs->meta_def_name; // dump($meta->resto_meta_defs); if($index_name=="BILLING_GATEWAY"){ // dump($meta->resto_meta_defs->meta_def_name); // $resto_metas['BILLING_GATEWAY'][] = $meta->meta_val; $billing[] = array('id'=>$meta->meta_id,'value'=>$meta->meta_val); } $resto_metas[$index_name] = $meta->meta_val; } } $resto_metas['BILLING_GATEWAY'] = $billing; $currency = isset($resto_metas['BUSSINESS_CCY'])?$resto_metas['BUSSINESS_CCY']:"IQD"; $business_type = isset($resto_metas['BUSSINESS_TYPE'])?$resto_metas['BUSSINESS_TYPE']:"Restaurants"; @endphp

{{__('label.order_history')}}

@if(isset($orders) && $orders->count() > 0) @php $custom_status['Placed'] = ['Accepted'=>'Accepted','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User']; $custom_status['Send_to_Kitchen'] = ['On_Road'=>'On the Way','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User']; $custom_status['On_Road'] = ['Has_Delivered'=>'Delivered','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User']; $custom_statuses = ['Rejected_by_User'=>'Rejected by User','Accepted'=>'Accepted','Rejected'=>'Rejected','Placed'=>'Placed','Send_to_Kitchen'=>'Send to Kitchen','On_Road'=>'On the Way', 'Has_Delivered'=>'Delivered','Served'=>"Served","Cancelled_by_Customer"=>"Cancelled","Close"=>"Close"]; $custom_status['Accepted'] = ['On_Road'=>'On the Way','Rejected'=>'Rejected', 'Rejected_by_User'=>'Rejected by User']; @endphp @foreach($orders as $order) @php $new_phone = ""; if(isset($order->customers)){ $pos = strpos($order->customers->users->email, env('COUNTRY_CODE')); if ($pos !== false) { $new_phone = substr_replace($order->customers->users->email, '', $pos, strlen(env('COUNTRY_CODE'))); } } @endphp @endforeach @endif
{{__('label.id')}} {{__('label.status')}} {{__('label.customer')}} {{__('label.mobile_no')}} {{__('label.type')}} {{__('label.payment_mode')}} {{__('label.total')}} {{__('label.channel')}} {{__('label.order_at')}} {{__('label.rating')}}
{!! $order->order_ref !!} {!! isset($custom_statuses[$order->status])?$custom_statuses[$order->status]:"" !!} {!! isset($order->customers)?$order->customers->name:$order->customer_name !!}{!! $new_phone !!} {!! $order->order_type !!} {!! $order->payment_mode=="COD"?__('label.cash'):__('label.card') !!} {!! $currency !!} {!! number_format($order->total_price+$order->delivery_fee) !!} {!! $order->campaign_type!!} {!! \App\Helpers\CommonMethods::formatDateTime($order->created_at) !!}
@endsection @section('js') {{-- --}} @endsection