@extends('admin.layout') @section('content')

{{ __('Total Bookings') }}

{{ $totalBookings }}

{{ __('Earnings') }}: {{ displayCurrency($totalEarnings, $settings) }}

{{ __('Hourly Bookings') }}

{{ $hourlyBookings }}

{{ __('Earnings') }}: {{ displayCurrency($hourlyEarnings, $settings) }}

{{ __('Timeslot Bookings') }}

{{ $timeslotBookings }}

{{ __('Earnings') }}: {{ displayCurrency($timeslotEarnings, $settings) }}

{{ __('Multiday Bookings') }}

{{ $multidayBookings }}

{{ __('Earnings') }}: {{ displayCurrency($multidayEarnings, $settings) }}

@if (count($orders) == 0)

{{ __('NO BOOKING RECORDS FOUND') . '!' }}

@else
@foreach ($orders as $order) @php $stageServices = json_decode($order->service_stage_info, true); $otherServices = json_decode($order->other_service_info, true); $services = []; if (is_array($stageServices)) { $services = array_merge($services, $stageServices); } if (is_array($otherServices)) { $services = array_merge($services, $otherServices); } $servicesBySpaceService = []; foreach ($services as $service) { if (isset($service['spaceServiceId'])) { $spaceServiceId = $service['spaceServiceId']; if (!isset($servicesBySpaceService[$spaceServiceId])) { $servicesBySpaceService[$spaceServiceId] = [ 'spaceServiceId' => $spaceServiceId, 'subServices' => [], ]; } if (isset($service['subServiceId'])) { $servicesBySpaceService[$spaceServiceId][ 'subServices' ][] = $service['subServiceId']; } } } $lang = \App\Models\Language::where('is_default', 1)->first(); $services = []; foreach ($servicesBySpaceService as $spaceServiceInfo) { $spaceServiceId = $spaceServiceInfo['spaceServiceId']; $subServiceIds = $spaceServiceInfo['subServices']; $spaceService = \App\Models\SpaceService::query() ->select( 'space_services.id as service_id', 'space_services.price_type', 'space_services.price as service_price', 'space_services.has_sub_services', 'space_service_contents.title as service_title', ) ->join( 'space_service_contents', 'space_services.id', '=', 'space_service_contents.space_service_id', ) ->where('space_service_contents.language_id', $lang->id) ->where('space_services.id', $spaceServiceId) ->first(); if ($spaceService) { $subServices = \App\Models\SubService::query() ->whereIn('sub_services.id', $subServiceIds) ->join( 'sub_service_contents', 'sub_services.id', '=', 'sub_service_contents.sub_service_id', ) ->where( 'sub_service_contents.language_id', $lang->id, ) ->select( 'sub_services.id as sub_service_id', 'sub_services.price as sub_service_price', 'sub_service_contents.title as sub_service_title', ) ->get(); $spaceService->subServices = $subServices; $services[] = $spaceService; } } @endphp @php $bookingDate = Carbon\Carbon::parse($order->created_at)->format( 'M d, Y', ); @endphp @endforeach
{{ __('Booking No.') }} {{ __('Customer Name') }} {{ __('Customer Email Address') }} {{ __('Spaces') }} {{ __('Services') }} {{ __('Tax') }} {{ __('Total Price') }} {{ __('Paid via') }} {{ __('Payment Status') }} {{ __('Booking Status') }} {{ __('Booking Date') }}
{{ '#' . $order->booking_number }} {{ $order->customer_name }} {{ $order->customer_email }} {{ strlen($order->space_title) > 20 ? mb_substr($order->space_title, 0, 20, 'UTF-8') . '...' : $order->space_title }} {{ __('view') }} @if (is_null($order->tax)) {{ '-' }} @else {{ $order->currency_symbol_position == 'left' ? $order->currency_symbol : '' }}{{ $order->tax }}{{ $order->currency_symbol_position == 'right' ? $order->currency_symbol : '' }} @endif @if (is_null($order->grand_total)) {{ __('Requested') }} @else {{ $order->currency_symbol_position == 'left' ? $order->currency_symbol : '' }}{{ $order->grand_total }}{{ $order->currency_symbol_position == 'right' ? $order->currency_symbol : '' }} @endif {{ is_null($order->payment_method) ? '-' : $order->payment_method }} @if ($order->payment_status == 'completed') {{ __('Completed') }} @elseif ($order->payment_status == 'pending') {{ __('Pending') }} @else {{ __('Rejected') }} @endif @if ($order->booking_status == 'pending') {{ __('Pending') }} @elseif ($order->booking_status == 'approved') {{ __('Approved') }} @else {{ __('Rejected') }} @endif {{ $bookingDate }}
@endif
@include('admin.booking-management.report-details') @endsection