@extends(\Auth::user()->role != 10 ? 'layout' : 'layoutfrontdesk') @section('title', 'Quick Report') @section('css') @endsection @section('content') @php // $this_total_rev = 0; // $this_total_occ = 0; // $this_total_guest = 0; // $this_total_arr = 0; // $this_total_revpar = 0; // $this_total_room_ava = 0; // $this_total_room_occupancy = 0; @endphp @php switch ($type_detail) { case 'roomnumber': $this_total_array = []; foreach ($periods as $key => $period) { foreach ($rooms as $k=>$room) { if (isset($this_total_array[$room->no_kamar])) { $this_total_array[$room->no_kamar]['this_total_rev'] += (array_key_exists($room->no_kamar, $revenue) ? (array_key_exists($period, $revenue[$room->no_kamar]) ? ($revenue[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_occ'] += (array_key_exists($room->no_kamar, $room_occ) ? (array_key_exists($period, $room_occ[$room->no_kamar]) ? ($room_occ[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_guest'] += (array_key_exists($room->no_kamar, $guest) ? (array_key_exists($period, $guest[$room->no_kamar]) ? ($guest[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_arr'] += (array_key_exists($room->no_kamar, $arr) ? (array_key_exists($period, $arr[$room->no_kamar]) ? ($arr[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_revpar'] += (array_key_exists($room->no_kamar, $total_room_ava) ? (array_key_exists($period, $total_room_ava[$room->no_kamar]) ? ($total_room_ava[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_room_ava'] += (array_key_exists($room->no_kamar, $room_occupancy) ? (array_key_exists($period, $room_occupancy[$room->no_kamar]) ? ($room_occupancy[$room->no_kamar][$period]) : 0) : 0); }else{ $this_total_array[$room->no_kamar]['this_total_rev'] = (array_key_exists($room->no_kamar, $revenue) ? (array_key_exists($period, $revenue[$room->no_kamar]) ? ($revenue[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_occ'] = (array_key_exists($room->no_kamar, $room_occ) ? (array_key_exists($period, $room_occ[$room->no_kamar]) ? ($room_occ[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_guest'] = (array_key_exists($room->no_kamar, $guest) ? (array_key_exists($period, $guest[$room->no_kamar]) ? ($guest[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_arr'] = (array_key_exists($room->no_kamar, $arr) ? (array_key_exists($period, $arr[$room->no_kamar]) ? ($arr[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_revpar'] = (array_key_exists($room->no_kamar, $total_room_ava) ? (array_key_exists($period, $total_room_ava[$room->no_kamar]) ? ($total_room_ava[$room->no_kamar][$period]) : 0) : 0); $this_total_array[$room->no_kamar]['this_total_room_ava'] = (array_key_exists($room->no_kamar, $room_occupancy) ? (array_key_exists($period, $room_occupancy[$room->no_kamar]) ? ($room_occupancy[$room->no_kamar][$period]) : 0) : 0); } } } foreach ($periods as $key => $period) { foreach ($rooms as $k=>$room) { if (isset($this_total_array[$room->no_kamar])) { $this_total_array[$room->no_kamar]['this_total_room_occupancy'] = (@$this_total_array[$room->no_kamar]['this_total_room_ava'] > 0) ? ((@$this_total_array[$room->no_kamar]['this_total_occ']/$this_total_array[$room->no_kamar]['this_total_room_ava'])*100) : 0; } } } // $this_total_array['this_total_room_occupancy'] = (@$this_total_room_ava > 0) ? ((@$this_total_occ/$this_total_room_ava)*100) : 0; break; case 'roomtype': $this_total_array = []; foreach ($periods as $key => $period) { foreach ($roomtypes as $k=>$roomtype) { if (isset($this_total_array[$roomtype->id])) { $this_total_array[$roomtype->id]['this_total_rev'] += (array_key_exists($roomtype->id, $revenue) ? (array_key_exists($period, $revenue[$roomtype->id]) ? ($revenue[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_occ'] += (array_key_exists($roomtype->id, $room_occ) ? (array_key_exists($period, $room_occ[$roomtype->id]) ? ($room_occ[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_guest'] += (array_key_exists($roomtype->id, $guest) ? (array_key_exists($period, $guest[$roomtype->id]) ? ($guest[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_arr'] += (array_key_exists($roomtype->id, $arr) ? (array_key_exists($period, $arr[$roomtype->id]) ? ($arr[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_revpar'] += (array_key_exists($roomtype->id, $total_room_ava) ? (array_key_exists($period, $total_room_ava[$roomtype->id]) ? ($total_room_ava[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_room_ava'] += (array_key_exists($roomtype->id, $room_occupancy) ? (array_key_exists($period, $room_occupancy[$roomtype->id]) ? ($room_occupancy[$roomtype->id][$period]) : 0) : 0); }else{ $this_total_array[$roomtype->id]['this_total_rev'] = (array_key_exists($roomtype->id, $revenue) ? (array_key_exists($period, $revenue[$roomtype->id]) ? ($revenue[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_occ'] = (array_key_exists($roomtype->id, $room_occ) ? (array_key_exists($period, $room_occ[$roomtype->id]) ? ($room_occ[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_guest'] = (array_key_exists($roomtype->id, $guest) ? (array_key_exists($period, $guest[$roomtype->id]) ? ($guest[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_arr'] = (array_key_exists($roomtype->id, $arr) ? (array_key_exists($period, $arr[$roomtype->id]) ? ($arr[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_revpar'] = (array_key_exists($roomtype->id, $total_room_ava) ? (array_key_exists($period, $total_room_ava[$roomtype->id]) ? ($total_room_ava[$roomtype->id][$period]) : 0) : 0); $this_total_array[$roomtype->id]['this_total_room_ava'] = (array_key_exists($roomtype->id, $room_occupancy) ? (array_key_exists($period, $room_occupancy[$roomtype->id]) ? ($room_occupancy[$roomtype->id][$period]) : 0) : 0); } } } foreach ($periods as $key => $period) { foreach ($roomtypes as $k=>$roomtype) { if (isset($this_total_array[$roomtype->id])) { $this_total_array[$roomtype->id]['this_total_room_occupancy'] = (@$this_total_array[$roomtype->id]['this_total_room_ava'] > 0) ? ((@$this_total_array[$roomtype->id]['this_total_occ']/$this_total_array[$roomtype->id]['this_total_room_ava'])*100) : 0; } } } // $this_total_array['this_total_room_occupancy'] = (@$this_total_room_ava > 0) ? ((@$this_total_occ/$this_total_room_ava)*100) : 0; break; default: $this_total_rev = 0; $this_total_occ = 0; $this_total_guest = 0; $this_total_arr = 0; $this_total_revpar = 0; $this_total_room_ava = 0; $this_total_room_occupancy = 0; foreach ($periods as $key => $period) { $this_total_rev += (array_key_exists($period, $revenue) ? ($revenue[$period]) : 0); $this_total_occ += (array_key_exists($period, $room_occ) ? ($room_occ[$period]) : 0); $this_total_guest += (array_key_exists($period, $guest) ? ($guest[$period]) : 0); // $this_total_arr += (array_key_exists($period, $arr) ? ($arr[$period]) : 0); // $this_total_revpar += (array_key_exists($period, $revpar) ? ($revpar[$period]) : 0); $this_total_room_ava += (array_key_exists($period, $total_room_ava) ? ($total_room_ava[$period]) : 0); } $this_total_room_occupancy = (@$this_total_room_ava > 0) ? ((@$this_total_occ/$this_total_room_ava)*100) : 0; $this_total_revpar = (@$this_total_room_ava > 0) ? ((@$this_total_rev/$this_total_room_ava)) : 0; $this_total_arr = (@$this_total_occ > 0) ? ((@$this_total_rev/$this_total_occ)) : 0; break; } @endphp
@if ($this_page == 'quickreport')
@endif
{{-- --}} @if ($this_page == 'quickreport') @if ($type_period != 1)  PDF  EXCEL @else
 EXCEL
@endif @else @if ($type_period != 1)  PDF  EXCEL @else
 EXCEL
@endif @endif
{{--  Excel --}}
{{-- @if( isset($_GET['from']) ) --}} @if ($this_page == 'quickreport')
@csrf
@if ($type_detail == 'roomtype') @elseif ($type_detail == 'roomnumber') @else @endif @foreach($periods as $key=>$period) @if ($type_period == 1) @else @endif @endforeach {{-- --}} @switch($type_detail) @case('roomtype') @foreach ($roomtypes as $key=>$roomtype) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($roomtypes as $key=>$roomtype) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($roomtypes as $key=>$roomtype) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($roomtypes as $key=>$roomtype) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($roomtypes as $key=>$roomtype) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($roomtypes as $key=>$roomtype) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($roomtypes as $key=>$roomtype) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @break @case('roomnumber') @foreach ($rooms as $key=>$room) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($rooms as $key=>$room) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($rooms as $key=>$room) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($rooms as $key=>$room) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($rooms as $key=>$room) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($rooms as $key=>$room) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @foreach ($rooms as $key=>$room) @if ($key === 0) @endif @foreach($periods as $period) @endforeach @endforeach @break @default @foreach($periods as $period) @endforeach @foreach($periods as $period) @endforeach @foreach($periods as $period) @endforeach @foreach($periods as $period) @endforeach @foreach($periods as $period) @endforeach @foreach($periods as $period) @endforeach @foreach($periods as $period) @endforeach @endswitch
RoomTypeRoom NumberSummary{{date('d-m-Y',strtotime($period))}}{{date('F, Y', strtotime(date('Y-d-m', strtotime('01/' . str_replace('-', '/', $period)))))}}Total Period
 
Revenue
{{$roomtype->nama}} {{$key == 0}}{{ array_key_exists($roomtype->id, $revenue) ? (array_key_exists($period, $revenue[$roomtype->id]) ? number_format($revenue[$roomtype->id][$period], 2) : 0) : 0}}{{number_format($this_total_array[$roomtype->id]['this_total_rev'], 2)}}
Occupancy(%)
{{$roomtype->nama}} {{ array_key_exists($roomtype->id, $room_occupancy) ? (array_key_exists($period, $room_occupancy[$roomtype->id]) ? number_format($room_occupancy[$roomtype->id][$period], 2) : 0) : 0}}{{number_format($this_total_array[$roomtype->id]['this_total_room_occupancy'], 2)}}
Room Occupied
{{$roomtype->nama}} {{ array_key_exists($roomtype->id, $room_occ) ? (array_key_exists($period, $room_occ[$roomtype->id]) ? number_format($room_occ[$roomtype->id][$period], 2) : 0) : 0}}{{number_format($this_total_array[$roomtype->id]['this_total_occ'], 2)}}
Room Available
{{$roomtype->nama}} {{ array_key_exists($roomtype->id, $total_room_ava) ? (array_key_exists($period, $total_room_ava[$roomtype->id]) ? number_format($total_room_ava[$roomtype->id][$period], 2) : 0) : 0}}{{number_format($this_total_array[$roomtype->id]['this_total_room_ava'], 2)}}
Guest in house
{{$roomtype->nama}} {{ array_key_exists($roomtype->id, $guest) ? (array_key_exists($period, $guest[$roomtype->id]) ? number_format($guest[$roomtype->id][$period], 2) : 0) : 0}}{{number_format($this_total_array[$roomtype->id]['this_total_guest'], 2)}}
Average Room Rate
{{$roomtype->nama}} {{ array_key_exists($roomtype->id, $arr) ? (array_key_exists($period, $arr[$roomtype->id]) ? number_format($arr[$roomtype->id][$period], 2) : 0) : 0}}{{number_format($this_total_array[$roomtype->id]['this_total_arr'], 2)}}
RevPAR
{{$roomtype->nama}} {{ array_key_exists($roomtype->id, $arr) ? (array_key_exists($period, $arr[$roomtype->id]) ? number_format($arr[$roomtype->id][$period], 2) : 0) : 0}}{{number_format($this_total_array[$roomtype->id]['this_total_revpar'], 2)}}
Revenue
{{$room->no_kamar}}{{ array_key_exists($room->no_kamar, $revenue) ? (array_key_exists($period, $revenue[$room->no_kamar]) ? number_format($revenue[$room->no_kamar][$period], 2) : 0) : 0}}{{number_format($this_total_array[$room->no_kamar]['this_total_rev'], 2)}}
Occupancy(%)
{{$room->no_kamar}} {{ array_key_exists($room->no_kamar, $room_occupancy) ? (array_key_exists($period, $room_occupancy[$room->no_kamar]) ? number_format($room_occupancy[$room->no_kamar][$period], 2) : 0) : 0}}{{number_format($this_total_array[$room->no_kamar]['this_total_room_occupancy'], 2)}}
Room Occupied
{{$room->no_kamar}} {{ array_key_exists($room->no_kamar, $room_occ) ? (array_key_exists($period, $room_occ[$room->no_kamar]) ? number_format($room_occ[$room->no_kamar][$period], 2) : 0) : 0}}{{number_format($this_total_array[$room->no_kamar]['this_total_occ'], 2)}}
Room Available
{{$room->no_kamar}} {{ array_key_exists($room->no_kamar, $total_room_ava) ? (array_key_exists($period, $total_room_ava[$room->no_kamar]) ? number_format($total_room_ava[$room->no_kamar][$period], 2) : 0) : 0}}{{number_format($this_total_array[$room->no_kamar]['this_total_room_ava'], 2)}}
Guest in house
{{$room->no_kamar}} {{ array_key_exists($room->no_kamar, $guest) ? (array_key_exists($period, $guest[$room->no_kamar]) ? number_format($guest[$room->no_kamar][$period], 2) : 0) : 0}}{{number_format($this_total_array[$room->no_kamar]['this_total_guest'], 2)}}
Average Room Rate
{{$room->no_kamar}} {{ array_key_exists($room->no_kamar, $arr) ? (array_key_exists($period, $arr[$room->no_kamar]) ? number_format($arr[$room->no_kamar][$period], 2) : 0) : 0}}{{number_format($this_total_array[$room->no_kamar]['this_total_arr'], 2)}}
RevPAR
{{$room->no_kamar}} {{ array_key_exists($room->no_kamar, $arr) ? (array_key_exists($period, $arr[$room->no_kamar]) ? number_format($arr[$room->no_kamar][$period], 2) : 0) : 0}}{{number_format($this_total_array[$room->no_kamar]['this_total_revpar'], 2)}}
Revenue{{ array_key_exists($period, $revenue) ? number_format($revenue[$period], 2) : 0}}{{number_format($this_total_rev, 2)}}
Occupancy(%){{ array_key_exists($period, $room_occupancy) ? number_format($room_occupancy[$period], 2) : 0}}{{number_format($this_total_room_occupancy, 2)}}%
Room Occupied{{ array_key_exists($period, $room_occ) ? number_format($room_occ[$period]) : 0}}{{number_format($this_total_occ)}}
Room Available{{ array_key_exists($period, $total_room_ava) ? number_format($total_room_ava[$period]) : 0}}{{number_format($this_total_room_ava)}}
Guest in house{{ array_key_exists($period, $guest) ? number_format($guest[$period]) : 0}}{{number_format($this_total_guest)}}
Average room rates{{ array_key_exists($period, $arr) ? number_format($arr[$period], 2) : 0}}{{number_format($this_total_arr, 2)}}
RevPAR{{ array_key_exists($period, $revpar) ? number_format($revpar[$period], 2) : 0}}{{number_format($this_total_revpar, 2)}}
@endif {{-- @endif --}} @if ($this_page == 'quickota')
@foreach($periods as $key=>$period) @if ($type_period == 1) @else @endif @endforeach {{-- @foreach($periods as $key=>$period) @endforeach --}} @foreach ($otas as $key=>$ota) @foreach($periods as $period) {{-- --}} @endforeach {{-- --}} @endforeach
OTA{{date('d-m-Y',strtotime($period))}}{{date('F, Y', strtotime(date('Y-d-m', strtotime('01/' . str_replace('-', '/', $period)))))}}Total Period
NETT GROSSTOTAL NETT TOTAL GROSS
{{$ota->name}} {{ array_key_exists($ota->id, $data_ota) ? (array_key_exists($period, $data_ota[$ota->id]['per_period_nett']) ? number_format($data_ota[$ota->id]['per_period_nett'][$period], 2) : 0) : 0}}{{ array_key_exists($ota->id, $data_ota) ? (array_key_exists($period, $data_ota[$ota->id]['per_period_gross']) ? number_format($data_ota[$ota->id]['per_period_gross'][$period], 2) : 0) : 0}}{{ array_key_exists($ota->id, $data_ota) ? (array_key_exists($ota->id, $data_ota) ? number_format($data_ota[$ota->id]['total_nett'], 2) : '0') : '0'}}{{ array_key_exists($ota->id, $data_ota) ? (array_key_exists($ota->id, $data_ota) ? number_format($data_ota[$ota->id]['total_gross'], 2) : '0') : '0'}}
@endif {{--
Report List    
Report name Action
Daily Revenue Report
Guest Account Balance
In house Guest List report
Departed Guest List Report
Room Revenue Breakdown
Booking Journal By Article
Booking Journal By Bill Number
FO Transaction Journal
FO Turn Over Department
FO Payment Journal By User(s)
FO Journal List Transaction
Competitor Report
Hot Com Report
Room Statistic By Guest Segment
Walkin List
Compliment Guest List
Room Production Report
Reservation Cancellation List
Guest Room Change List
Monthly Room Occupancy Forecast
Room Usage and Turnover
--}}
@endsection @section('js') @endsection