@extends('layouts.regent') @section('title', 'House Use Report') @push('styles') @endpush @section('content') @php // Process house use data if($month === 'all') { $rooms = []; $monthlyCount = []; foreach($houseUseData as $monthName => $data) { foreach($data as $record) { $rooms[$record->Room] = true; $day = date('Y-m-d', strtotime($record->Posting_Date)); if(!isset($monthlyCount[$record->Room][$monthName])) { $monthlyCount[$record->Room][$monthName] = []; } $monthlyCount[$record->Room][$monthName][$day] = true; } } foreach($monthlyCount as $room => $months) { foreach($months as $monthName => $days) { $monthlyCount[$room][$monthName] = count($days); } } $rooms = array_keys($rooms); sort($rooms); $totalDays = 0; foreach($monthlyCount as $roomData) { $totalDays += array_sum($roomData); } } else { $rooms = []; $dailyData = []; foreach($houseUseData as $record) { $rooms[$record->Room] = true; $day = (int) date('d', strtotime($record->Posting_Date)); $dailyData[$record->Room][$day] = true; } $rooms = array_keys($rooms); sort($rooms); $totalDays = 0; foreach($dailyData as $roomData) { $totalDays += count($roomData); } } @endphp

House Use Report

Track and monitor house use occupancy by room and date

Total Days
{{ number_format($totalDays) }}
Rooms
{{ number_format(count($rooms)) }}
Usage Rate
{{ count($rooms) > 0 ? number_format(($totalDays / (count($rooms) * 31)) * 100, 1) : 0 }}%
@if(count($rooms) === 0)

No House Use Data

No house use data found for this period.

@else
@if($month === 'all') @foreach(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] as $monthName) @endforeach @else @for($day = 1; $day <= 31; $day++) @endfor @endif @foreach($rooms as $room) @if($month === 'all') @foreach(['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'] as $monthName) @php $count = $monthlyCount[$room][$monthName] ?? 0; @endphp @if($count > 0) @else @endif @endforeach @else @for($day = 1; $day <= 31; $day++) @if(isset($dailyData[$room][$day])) @else @endif @endfor @endif @endforeach
Room{{ $monthName }}{{ $day }}
Room {{ $room }} {{ $count }}--
@endif
@endsection @push('scripts') @endpush