@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
Track and monitor house use occupancy by room and date
No house use data found for this period.
| Room | @if($month === 'all') @foreach(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] as $monthName){{ $monthName }} | @endforeach @else @for($day = 1; $day <= 31; $day++){{ $day }} | @endfor @endif||
|---|---|---|---|---|
| Room {{ $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){{ $count }} | @else- | @endif @endforeach @else @for($day = 1; $day <= 31; $day++) @if(isset($dailyData[$room][$day]))@else | - | @endif @endfor @endif