<?php
$db = Database::getInstance();
$todayEntries = (int)$db->fetchColumn("SELECT COUNT(*) FROM member_access_log WHERE DATE(access_time) = CURDATE() AND direction='entry' AND granted=1");
?>
<div class="card border-success h-100">
    <div class="card-body">
        <div class="d-flex justify-content-between">
            <div>
                <h6 class="text-muted mb-1"><?= lang('cards.today_entries') ?></h6>
                <h3 class="mb-0 text-success"><?= number_format($todayEntries) ?></h3>
                <small class="text-muted">Entries recorded today</small>
            </div>
            <div class="align-self-center"><i class="fas fa-door-open fa-2x text-success opacity-50"></i></div>
        </div>
        <a href="/access/log" class="stretched-link"></a>
    </div>
</div>