@extends('layouts.hirbc') @section('title', 'House Use Report - HIRBC') @push('styles') @endpush @section('content') @php // Process data if($month === 'all') { $rooms = []; $monthlyCount = []; foreach($houseUseData as $monthName => $data) { foreach($data as $record) { $rooms[$record->Room] = true; if(!isset($monthlyCount[$record->Room][$monthName])) { $monthlyCount[$record->Room][$monthName] = 0; } $monthlyCount[$record->Room][$monthName]++; } } $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 = count($houseUseData); } @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 }}%
Period
{{ $month === 'all' ? 'All' : ucfirst($month) }}
@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