<?= $this->extend('layouts/main') ?>

<?= $this->section('title') ?>
    Verifikator Dashboard
<?= $this->endSection() ?>

<?= $this->section('page_title') ?>
    Panel Verifikasi Pengajuan
<?= $this->endSection() ?>

<?= $this->section('content') ?>
<div class="row">
    <div class="col-lg-12">
        <div class="glass-card">
            <h4 class="mb-4">Daftar Tunggu Verifikasi</h4>

            <div class="table-responsive">
                <table class="table table-hover">
                    <thead>
                        <tr class="text-secondary small fw-bold opacity-75">
                            <th>ID</th>
                            <th>NIP & NAMA</th>
                            <th>JENIS KP</th>
                            <th>TANGGAL</th>
                            <th>AKSI</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if(empty($pending_list)): ?>
                            <tr>
                                <td colspan="5" class="text-center py-4 text-muted">Belum ada pengajuan baru.</td>
                            </tr>
                        <?php else: ?>
                            <?php foreach($pending_list as $row): ?>
                                <tr>
                                    <td>#<?= $row['id'] ?></td>
                                    <td>
                                        <div class="fw-bold"><?= $row['pegawai_name'] ?></div>
                                        <span class="small text-muted"><?= $row['pegawai_nip'] ?></span>
                                    </td>
                                    <td><?= $row['jenis_kp'] ?></td>
                                    <td><?= date('d/m/Y', strtotime($row['created_at'])) ?></td>
                                    <td>
                                        <a href="<?= base_url('verifikator/detail/' . $row['id']) ?>" class="btn btn-primary btn-sm rounded-pill px-3">Review Dokumen</a>
                                    </td>
                                </tr>
                            <?php endforeach; ?>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<?= $this->endSection() ?>
