<table class="table table-bordered table-striped">
    <thead class="table-dark">
        <tr>
            <th>No</th>
            <th>No Daftar</th>
            <th>Nama</th>
            <th>NISN</th>
            <th>Status</th>
            <th width="140">Aksi</th>
        </tr>
    </thead>

    <tbody>
        <?php
        $perPage = 10;
        $currentPage = $pager->getCurrentPage('default') ?? 1;
        $no = 1 + ($perPage * ($currentPage - 1));
        ?>

        <?php foreach ($list as $row): ?>
        <tr>
            <td><?= $no++ ?></td>
            <td><?= $row['reg_no'] ?></td>
            <td><?= $row['name'] ?></td>
            <td><?= $row['nisn'] ?></td>
            <td>
                <span class="badge 
                    <?= $row['status'] == 'PENDING' ? 'bg-warning text-dark' : '' ?>
                    <?= $row['status'] == 'APPROVED' ? 'bg-success' : '' ?>
                    <?= $row['status'] == 'REJECTED' ? 'bg-danger' : '' ?>">
                    <?= $row['status'] ?>
                </span>
            </td>
            <td>
                <a href="<?= site_url('ppdb/admin/detail/'.$row['id']) ?>"
                   class="btn btn-info btn-sm text-white">
                   Detail
                </a>
            </td>
        </tr>
        <?php endforeach ?>
    </tbody>
</table>

<div class="d-flex justify-content-end mt-3">
    <?= $pager->links() ?>
</div>
