@extends('layouts.app') @section('title', 'Dashboard') @section('page_title', 'Dashboard') @section('page_subtitle', 'Hotel overview for ' . now()->format('F j, Y')) @section('nav_dashboard', 'bg-teal-50 text-teal-700 font-semibold') @section('content') @php $hour = now()->hour; $greeting = $hour < 12 ? 'Good morning' : ($hour < 18 ? 'Good afternoon' : 'Good evening'); $propName = \App\Models\Setting::get('property_name', 'Parkview Hotel CDO'); @endphp @if (session('success'))

{{ session('success') }}

@endif {{-- ===== WELCOME ROW ===== --}}

{{ $greeting }}, Front Desk

{{ $propName }} — {{ now()->format('l, F j, Y \a\t g:i A') }}

Check-in Check-out New Reservation
{{-- ===== KPI CARDS ===== --}}
{{-- Occupancy Rate --}}

Occupancy

{{ $stats['occupancy_rate'] }}%

of {{ $stats['total_rooms'] }} rooms

{{-- In-House --}}

In-House

{{ $stats['in_house'] }}

Guests staying

{{-- Available --}}

Available

{{ $stats['available'] }}

Ready to sell

{{-- Arrivals --}}

Arrivals Today

{{ $stats['arrivals_today'] }}

Process check-ins
{{-- Departures --}}

Departures Today

{{ $stats['departures_today'] }}

Process check-outs
{{-- Revenue Today --}}

Revenue Today

₱{{ number_format($stats['revenue_today'], 0) }}

MTD: ₱{{ number_format($stats['revenue_mtd'], 0) }}

{{-- END KPI --}} {{-- ===== MAIN + SIDEBAR LAYOUT ===== --}}
{{-- ===== LEFT COLUMN (span 2) ===== --}}
{{-- TODAY'S ARRIVALS --}}

Today's Arrivals

@if ($stats['arrivals_today'] > 0) {{ $stats['arrivals_today'] }} @endif
View all →
@if ($arrivalsToday->isEmpty())

No pending arrivals for today.

@else
@foreach ($arrivalsToday->take(5) as $res) @php $balance = $res->balanceDue(); @endphp
{{ strtoupper(substr($res->guest_name, 0, 1)) }}{{ strtoupper(substr(explode(' ', $res->guest_name)[1] ?? 'X', 0, 1)) }}

{{ $res->guest_name }}

Room {{ $res->room_no }} · {{ $res->nights }}N · {{ $res->pax }} pax

@if ($balance > 0)

₱{{ number_format($balance, 0) }} due

@else

Fully paid

@endif @if ($res->status === 'pending') Unconfirmed @endif
@csrf
@endforeach @if ($arrivalsToday->count() > 5) @endif
@endif
{{-- TODAY'S DEPARTURES --}}

Today's Departures

@if ($stats['departures_today'] > 0) {{ $stats['departures_today'] }} @endif
View all →
@if ($departuresToday->isEmpty())

No pending departures for today.

@else
@foreach ($departuresToday->take(5) as $res) @php $balance = $res->balanceDue(); $overdue = $res->check_out->lt(today()); @endphp
{{ strtoupper(substr($res->guest_name, 0, 1)) }}{{ strtoupper(substr(explode(' ', $res->guest_name)[1] ?? 'X', 0, 1)) }}

{{ $res->guest_name }}

Room {{ $res->room_no }} · {{ $res->nights }}N @if ($overdue) · Overdue @endif

@if ($balance > 0)

₱{{ number_format($balance, 0) }} due

@else

Settled

@endif

Total ₱{{ number_format($res->amount, 0) }}

@csrf
@endforeach @if ($departuresToday->count() > 5) @endif
@endif
{{-- END LEFT COLUMN --}} {{-- ===== RIGHT SIDEBAR ===== --}}
{{-- ROOM STATUS --}}

Room Status

Room Rack →
{{-- Stacked bar --}} @php $total = $stats['total_rooms'] ?: 1; $available = ($roomCounts['available'] ?? 0) + ($roomCounts['clean'] ?? 0); $occupied = $roomCounts['occupied'] ?? 0; $dirty = $roomCounts['dirty'] ?? 0; $maint = ($roomCounts['maintenance'] ?? 0) + ($roomCounts['out_of_order'] ?? 0); @endphp
@if ($available > 0)
@endif @if ($occupied > 0)
@endif @if ($dirty > 0)
@endif @if ($maint > 0)
@endif
@foreach ([ ['Available / Clean', $available, 'bg-green-500', 'text-green-700'], ['Occupied', $occupied, 'bg-teal-600', 'text-teal-700'], ['Dirty', $dirty, 'bg-amber-400', 'text-amber-700'], ['Maintenance / OOO', $maint, 'bg-orange-400','text-orange-700'], ] as [$label, $count, $bg, $text])
{{ $label }}
{{ $count }}
@endforeach
{{-- 7-DAY REVENUE --}}

Revenue — Last 7 Days

From checked-out reservations

@php $maxRev = $weekRevenue->max('amount') ?: 1; @endphp
@foreach ($weekRevenue as $day)
{{-- Tooltip on hover --}} @if ($day['amount'] > 0) @endif
@endforeach
@foreach ($weekRevenue as $day)
{{ $day['label'] }}
@endforeach
{{-- BOOKING SOURCES --}}

Booking Sources

@php $maxSource = $sourceBreakdown->max('total') ?: 1; @endphp @foreach ($sourceBreakdown as $src)
{{ $src->source }} {{ $src->total }}
@endforeach
{{-- END SIDEBAR --}}
{{-- END MAIN LAYOUT --}} {{-- ===== RECENT RESERVATIONS ===== --}}

Recent Reservations

View all →
@php $badges = [ 'pending' => 'bg-amber-50 text-amber-700 border-[0.5px] border-amber-200', 'confirmed' => 'bg-teal-50 text-teal-700 border-[0.5px] border-teal-200', 'checked_in' => 'bg-green-50 text-green-700 border-[0.5px] border-green-200', 'checked_out' => 'bg-gray-50 text-gray-500 border-[0.5px] border-gray-200', 'cancelled' => 'bg-red-50 text-red-600 border-[0.5px] border-red-200', 'no_show' => 'bg-orange-50 text-orange-600 border-[0.5px] border-orange-200', ]; $labels = [ 'pending' => 'Pending', 'confirmed' => 'Confirmed', 'checked_in' => 'Checked In', 'checked_out' => 'Checked Out', 'cancelled' => 'Cancelled', 'no_show' => 'No Show', ]; @endphp @foreach ($recentReservations as $res) @endforeach
Booking # Guest Room Check-in Check-out Status Amount
{{ $res->booking_no }}

{{ $res->guest_name }}

{{ $res->source }}

Room {{ $res->room_no }}

{{ $res->room_type }}

{{ $res->check_in->format('M j, Y') }}

{{ $res->check_out->format('M j, Y') }}

{{ $res->nights }}N

@if ($res->status === 'checked_in') @endif {{ $labels[$res->status] ?? $res->status }}

₱{{ number_format($res->amount, 0) }}

@endsection