@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', [1,4,5,6])
->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', [1,4,5,6])
->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', [1,4,5,6])
->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', [1,4,5,6])
->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', [1,4,5,6])
->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', [1,4,5,6])
->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', [1,4,5,6])
->where('AgentId', request()->travel_agent )
->get();
}
$date = strtotime($booking->BeginDate);
$final_date = date('d-m-Y', $date);
@endphp
{{ $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
|
@endforeach
@endif
@else