@extends('layouts.hirbc') @section('title', "Room {$room} - OOO Detail - HIRBC") @section('page-title', "Room {$room} - OOO Detail") @push('styles') @endpush @section('content') Back to OOO Report

Room {{ $room }} - OOO Detail Matrix

Full year view (January - December 2025) showing all OOO dates for this room

How to Read:

Orange cells with ● indicate dates when this room is Out of Order. Gray dash (-) indicates the room is available. Light gray indicates invalid dates for that month (e.g., Feb 30).

@php // Build yearly matrix: 12 months x 31 days $yearlyMatrix = []; $months = [ 'january' => 1, 'february' => 2, 'march' => 3, 'april' => 4, 'may' => 5, 'june' => 6, 'july' => 7, 'august' => 8, 'september' => 9, 'october' => 10, 'november' => 11, 'december' => 12 ]; foreach ($months as $monthName => $monthNumber) { $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $monthNumber, 2025); $yearlyMatrix[$monthName] = []; for ($day = 1; $day <= 31; $day++) { if ($day > $daysInMonth) { $yearlyMatrix[$monthName][$day] = null; // Invalid date continue; } $hasOOO = false; $currentDate = \Carbon\Carbon::create(2025, $monthNumber, $day); foreach ($oooData as $ooo) { try { $beginDate = \Carbon\Carbon::parse($ooo->Begin_Date); // ✅ NOW CLEAN: End_Date column exists! if ($ooo->End_Date && $ooo->End_Date !== '0001-01-01') { $endDate = \Carbon\Carbon::parse($ooo->End_Date); } else { $endDate = \Carbon\Carbon::now()->endOfYear(); } if ($currentDate->gte($beginDate) && $currentDate->lte($endDate)) { $hasOOO = true; break; } } catch (\Exception $e) { continue; } } $yearlyMatrix[$monthName][$day] = $hasOOO; } } @endphp
@for($day = 1; $day <= 31; $day++) @endfor @foreach(['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'] as $monthName) @for($day = 1; $day <= 31; $day++) @php $cellData = $yearlyMatrix[$monthName][$day] ?? null; @endphp @if($cellData === null) @elseif($cellData) @else @endif @endfor @endforeach
Month{{ $day }}
{{ ucfirst(substr($monthName, 0, 3)) }}--

OOO Records for Room {{ $room }}

@foreach($oooData as $ooo) @endforeach
Begin Date End Date Repair Remark Reason Status
{{ $ooo->Begin_Date ? \Carbon\Carbon::parse($ooo->Begin_Date)->format('d M Y') : '-' }} @if(property_exists($ooo, 'End_Date') && $ooo->End_Date && $ooo->End_Date !== '0001-01-01') {{ \Carbon\Carbon::parse($ooo->End_Date)->format('d M Y') }} @else Ongoing @endif {{ $ooo->Repair_Remark ?? '-' }} {{ $ooo->Reason_Desc ?? $ooo->Reason_Code ?? '-' }} @if($ooo->Completed_On === '0001-01-01') Active @else Completed @endif
@endsection