<?= $this->extend('layouts/admin') ?><?= $this->section('content') ?>
<div class="d-flex gap-2 mb-3"><a class="btn <?= !$filter?'btn-emerald':'btn-light' ?>" href="<?= base_url('admin/rsvp') ?>">Semua</a><a class="btn <?= $filter==='hadir'?'btn-emerald':'btn-light' ?>" href="?status=hadir">Hadir</a><a class="btn <?= $filter==='tidak_hadir'?'btn-emerald':'btn-light' ?>" href="?status=tidak_hadir">Tidak Hadir</a></div>
<div class="panel table-responsive"><table class="table"><thead><tr><th>Nama</th><th>Status</th><th>Jumlah</th><th>Pesan</th><th>Tanggal</th></tr></thead><tbody><?php foreach($items as $item): ?><tr><td><?= esc($item['nama']) ?></td><td><span class="badge <?= $item['status']==='hadir'?'text-bg-success':'text-bg-secondary' ?>"><?= str_replace('_',' ',esc($item['status'])) ?></span></td><td><?= $item['jumlah_tamu'] ?></td><td><?= esc($item['pesan']) ?></td><td><?= date('d/m/Y H:i',strtotime($item['created_at'])) ?></td></tr><?php endforeach ?></tbody></table></div>
<?= $this->endSection() ?>
