@extends('layouts.main-layout') @section('title') History Report | Dashboard @endsection @section('styles') {{-- --}} @endsection @section('content')

History Report

Date Controls

{{--
--}} {{--
--}}
@if($bookingDetail->count() > 0) @foreach ($bookingDetail as $booking) @php $bookings = null; if( request()->source == null && request()->travel_agent == null && request()->company == null ){ $bookings = $booking->whereBetween('BeginDate', array(request()->start_date, request()->end_date)) ->where('BeginDate', $booking->BeginDate) ->whereIn('BookingStatusId', [6,7]) ->get(); } else if(request()->source != null && request()->travel_agent != null ){ $bookings = $booking->whereBetween('BeginDate', array(request()->start_date, request()->end_date)) ->where('BeginDate', $booking->BeginDate) ->whereIn('BookingStatusId', [6,7]) ->where('BookingSource', request()->source ) ->where('AgentId', request()->travel_agent ) ->get(); } else if(request()->source != null && request()->company != null ){ $bookings = $booking->whereBetween('BeginDate', array(request()->start_date, request()->end_date)) ->where('BeginDate', $booking->BeginDate) ->whereIn('BookingStatusId', [6,7]) ->where('BookingSource', request()->source ) ->where('CompanyId', request()->company ) ->get(); } else if(request()->travel_agent != null && request()->company != null ){ $bookings = $booking->whereBetween('BeginDate', array(request()->start_date, request()->end_date)) ->where('BeginDate', $booking->BeginDate) ->whereIn('BookingStatusId', [6,7]) ->where('CompanyId', request()->company ) ->where('AgentId', request()->travel_agent ) ->get(); } else if(request()->source != null ){ $bookings = $booking->whereBetween('BeginDate', array(request()->start_date, request()->end_date)) ->where('BeginDate', $booking->BeginDate) ->whereIn('BookingStatusId', [6,7]) ->where('BookingSource', request()->source ) ->get(); } else if(request()->company != null){ $bookings = $booking->whereBetween('BeginDate', array(request()->start_date, request()->end_date)) ->where('BeginDate', $booking->BeginDate) ->whereIn('BookingStatusId', [6,7]) ->where('CompanyId', request()->company ) ->get(); } else if(request()->travel_agent != null){ $bookings = $booking->whereBetween('BeginDate', array(request()->start_date, request()->end_date)) ->where('BeginDate', $booking->BeginDate) ->whereIn('BookingStatusId', [6,7]) ->where('AgentId', request()->travel_agent ) ->get(); } $date = strtotime($booking->BeginDate); $final_date = date('d-m-Y', $date); @endphp @endforeach @else

No record found.

@endif
Date Total Rooms Occupied Available Occupancy(%) Revenue ADR Rev Par
{{ $final_date }} {{ $totalRooms }} @php $occupiedRooms = $bookings->count(); echo $occupiedRooms; @endphp {{ $totalRooms - $occupiedRooms }} {{ number_format((float) ($occupiedRooms/$totalRooms)*100, 2, '.', '' ) }} @php $perDateTotal = null; foreach($bookings as $booking){ $perDateTotal += $booking->TotalPrice; } echo $perDateTotal; @endphp @if ($perDateTotal != '' && $occupiedRooms != '') {{ number_format((float) $perDateTotal/$occupiedRooms, 2, '.', '' ) }} @else No rooms. @endif @if ($perDateTotal != '' && $totalRooms != '') {{ number_format((float) $perDateTotal/$totalRooms, 2, '.', '' ) }} @else No rooms. @endif
@component('admin.includes.loader') @endcomponent @endsection @section('scripts') @endsection