<?php $pageTitle='Tổng quan Spa - PET SPA'; $pageStyles=['customer.css']; $activeCustomerPage='dashboard'; require_once BASE_PATH . '/app/helpers/Status.php';require_once BASE_PATH.'/app/helpers/Status.php'; require BASE_PATH.'/app/views/layouts/header.php'; require BASE_PATH.'/app/views/layouts/navbar.php'; ?>
<main class="customer-area"><div class="container-fluid"><div class="row g-4"><div class="col-xl-2 col-lg-3"><?php require BASE_PATH.'/app/views/layouts/customer-sidebar.php'; ?></div><section class="col-xl-10 col-lg-9"><div class="customer-page-header d-flex flex-wrap justify-content-between gap-3"><div><h1>Xin chào, <?=htmlspecialchars($_SESSION['user']['full_name']??'')?></h1><p>Theo dõi lịch chăm sóc thú cưng của bạn.</p></div><a class="btn btn-primary" href="<?=BASE_URL?>/?url=customer/booking/create"><i class="bi bi-calendar-plus"></i> Đặt lịch Spa</a></div><div class="row g-3 mb-4"><div class="col-md-6"><div class="customer-card"><small class="text-muted">Lịch đang xử lý</small><strong class="d-block fs-3"><?= (int)($summary['active_count']??0) ?></strong><a href="<?=BASE_URL?>/?url=customer/bookings">Xem lịch hẹn</a></div></div><div class="col-md-6"><div class="customer-card"><small class="text-muted">Hoàn tất</small><strong class="d-block fs-3"><?= (int)($summary['completed_count']??0) ?></strong><a href="<?=BASE_URL?>/?url=customer/notifications">Xem thông báo</a></div></div></div><section class="customer-card"><h2 class="h5">Lịch gần đây</h2><div class="table-responsive"><table class="table align-middle mb-0"><tbody><?php foreach($recentBookings as $item):?><tr><td><?=htmlspecialchars($item['service_name_snapshot'])?></td><td><span class="badge rounded-pill <?= booking_status_badge_class($item['status']) ?>">
    <?= htmlspecialchars(
        status_label(
            'booking',
            $item['status']
        )
    ) ?>
</span> <?=htmlspecialchars(substr($item['start_time'],0,5))?></td><td><span class="badge rounded-pill <?= booking_status_badge_class($item['status']) ?>">
    <?= htmlspecialchars(
        status_label(
            'booking',
            $item['status']
        )
    ) ?>
</span></td><td><a href="<?=BASE_URL?>/?url=customer/booking&id=<?=$item['id']?>">Xem</a></td></tr><?php endforeach;?><?php if(!$recentBookings):?><tr><td class="text-muted">Chưa có lịch hẹn.</td></tr><?php endif;?></tbody></table></div></section></section></div></div></main><?php require BASE_PATH.'/app/views/layouts/footer.php'; ?>
