@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_guest > 0) ? ((@$this_total_rev/$this_total_guest)) : 0; break; } @endphp @if ($this_page == 'quickreport')
RoomType | @elseif ($type_detail == 'roomnumber')Room Number | @elseSummary | @endif @foreach($periods as $key=>$period) @if ($type_period == 1){{date('d-m-Y',strtotime($period))}} | @else {{--{{date('F, Y', strtotime(date('Y-d-m', strtotime('01/' . str_replace('-', '/', $period)))))}} | --}}{{date('F, Y', strtotime(date('Y-d-m', strtotime('01/' . str_replace('-', '/', $period)))))}} | @endif @endforeachTotal Period | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Revenue | |||||||||||||
{{$roomtype->nama}} {{$key == 0}} | @foreach($periods as $period){{ array_key_exists($roomtype->id, $revenue) ? (array_key_exists($period, $revenue[$roomtype->id]) ? number_format($revenue[$roomtype->id][$period], 2) : 0) : 0}} | @endforeach{{number_format($this_total_array[$roomtype->id]['this_total_rev'], 2)}} | |||||||||||
Occupancy(%) | |||||||||||||
{{$roomtype->nama}} | @foreach($periods as $period){{ 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}} | @endforeach{{number_format($this_total_array[$roomtype->id]['this_total_room_occupancy'], 2)}} | |||||||||||
Room Occupied | |||||||||||||
{{$roomtype->nama}} | @foreach($periods as $period){{ array_key_exists($roomtype->id, $room_occ) ? (array_key_exists($period, $room_occ[$roomtype->id]) ? number_format($room_occ[$roomtype->id][$period]) : 0) : 0}} | @endforeach{{number_format($this_total_array[$roomtype->id]['this_total_occ'])}} | |||||||||||
Room Available | |||||||||||||
{{$roomtype->nama}} | @foreach($periods as $period){{ 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]) : 0) : 0}} | @endforeach{{number_format($this_total_array[$roomtype->id]['this_total_room_ava'])}} | |||||||||||
Guest in house | |||||||||||||
{{$roomtype->nama}} | @foreach($periods as $period){{ array_key_exists($roomtype->id, $guest) ? (array_key_exists($period, $guest[$roomtype->id]) ? number_format($guest[$roomtype->id][$period]) : 0) : 0}} | @endforeach{{number_format($this_total_array[$roomtype->id]['this_total_guest'])}} | |||||||||||
Average Room Rate | |||||||||||||
{{$roomtype->nama}} | @foreach($periods as $period){{ array_key_exists($roomtype->id, $arr) ? (array_key_exists($period, $arr[$roomtype->id]) ? number_format($arr[$roomtype->id][$period], 2) : 0) : 0}} | @endforeach{{number_format($this_total_array[$roomtype->id]['this_total_arr'], 2)}} | |||||||||||
RevPAR | |||||||||||||
{{$roomtype->nama}} | @foreach($periods as $period){{ array_key_exists($roomtype->id, $arr) ? (array_key_exists($period, $arr[$roomtype->id]) ? number_format($arr[$roomtype->id][$period], 2) : 0) : 0}} | @endforeach{{number_format($this_total_array[$roomtype->id]['this_total_revpar'], 2)}} | |||||||||||
Revenue | |||||||||||||
{{$room->no_kamar}} | @foreach($periods as $period){{ 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}} | @endforeach{{number_format($this_total_array[$room->no_kamar]['this_total_rev'], 2)}} | |||||||||||
Occupancy(%) | |||||||||||||
{{$room->no_kamar}} | @foreach($periods as $period){{ 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}} | @endforeach{{number_format($this_total_array[$room->no_kamar]['this_total_room_occupancy'], 2)}} | |||||||||||
Room Occupied | |||||||||||||
{{$room->no_kamar}} | @foreach($periods as $period){{ 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]) : 0) : 0}} | @endforeach{{number_format($this_total_array[$room->no_kamar]['this_total_occ'])}} | |||||||||||
Room Available | |||||||||||||
{{$room->no_kamar}} | @foreach($periods as $period){{ 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]) : 0) : 0}} | @endforeach{{number_format($this_total_array[$room->no_kamar]['this_total_room_ava'])}} | |||||||||||
Guest in house | |||||||||||||
{{$room->no_kamar}} | @foreach($periods as $period){{ array_key_exists($room->no_kamar, $guest) ? (array_key_exists($period, $guest[$room->no_kamar]) ? number_format($guest[$room->no_kamar][$period]) : 0) : 0}} | @endforeach{{number_format($this_total_array[$room->no_kamar]['this_total_guest'])}} | |||||||||||
Average Room Rate | |||||||||||||
{{$room->no_kamar}} | @foreach($periods as $period){{ 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}} | @endforeach{{number_format($this_total_array[$room->no_kamar]['this_total_arr'], 2)}} | |||||||||||
RevPAR | |||||||||||||
{{$room->no_kamar}} | @foreach($periods as $period){{ 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}} | @endforeach{{number_format($this_total_array[$room->no_kamar]['this_total_revpar'], 2)}} | |||||||||||
Revenue | @foreach($periods as $period){{ array_key_exists($period, $revenue) ? number_format($revenue[$period], 2) : 0}} | @endforeach{{number_format($this_total_rev, 2)}} | |||||||||||
Occupancy(%) | @foreach($periods as $period){{ array_key_exists($period, $room_occupancy) ? number_format($room_occupancy[$period], 2) : 0}} | @endforeach{{number_format($this_total_room_occupancy, 2)}}% | |||||||||||
Room Occupied | @foreach($periods as $period){{ array_key_exists($period, $room_occ) ? number_format($room_occ[$period]) : 0}} | @endforeach{{number_format($this_total_occ)}} | |||||||||||
Room Available | @foreach($periods as $period){{ array_key_exists($period, $total_room_ava) ? number_format($total_room_ava[$period]) : 0}} | @endforeach{{number_format($this_total_room_ava)}} | |||||||||||
Guest in house | @foreach($periods as $period){{ array_key_exists($period, $guest) ? number_format($guest[$period]) : 0}} | @endforeach{{number_format($this_total_guest)}} | |||||||||||
Average room rates | @foreach($periods as $period){{ array_key_exists($period, $arr) ? number_format($arr[$period], 2) : 0}} | @endforeach{{number_format($this_total_arr, 2)}} | |||||||||||
RevPAR | @foreach($periods as $period){{ array_key_exists($period, $total_room_ava) ? number_format($revpar[$period], 2) : 0}} | @endforeach{{number_format($this_total_revpar, 2)}} |
OTA | @foreach($periods as $key=>$period) @if ($type_period == 1){{date('d-m-Y',strtotime($period))}} | @else {{--{{date('F, Y', strtotime(date('Y-d-m', strtotime('01/' . str_replace('-', '/', $period)))))}} | --}} {{--{{date('F, Y', strtotime(date('Y-d-m', strtotime('01/' . str_replace('-', '/', $period)))))}} | --}}{{date('F, Y', strtotime(date('Y-d-m', strtotime('01/' . str_replace('-', '/', $period)))))}} | @endif @endforeachTotal Period |
---|---|---|---|---|---|
NETT | GROSS | @endforeachTOTAL NETT | TOTAL GROSS | ||
{{$ota->name}} | @foreach($periods as $period){{ 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}} | --}} @endforeach{{ 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'}} | --}}