<?php
$db = Database::getInstance();
$todayBookings = (int) $db->fetchColumn("SELECT COUNT(*) FROM facility_bookings WHERE booking_date = CURDATE() AND status NOT IN ('cancelled','no_show')");
$checkedIn = (int) $db->fetchColumn("SELECT COUNT(*) FROM facility_bookings WHERE booking_date = CURDATE() AND status = 'checked_in'");
?>
<div class="card border-primary h-100">
    <div class="card-body">
        <div class="d-flex justify-content-between">
            <div>
                <h6 class="text-muted mb-1"><?= lang('facilities.today_bookings') ?></h6>
                <h3 class="mb-0"><?= $todayBookings ?></h3>
                <small class="text-success"><?= $checkedIn ?> checked in</small>
            </div>
            <div class="align-self-center"><i class="fas fa-calendar-check fa-2x text-primary opacity-50"></i></div>
        </div>
    </div>
    <div class="card-footer bg-transparent border-0 pt-0"><a href="/bookings" class="small text-primary">View all bookings →</a></div>
</div>