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

<?= $this->section('content') ?>

<div class="d-flex justify-content-between mb-3">

    <h3>Manajemen Role</h3>

    <a href="<?= base_url('superadmin/role/create') ?>"
        class="btn btn-primary">

        Tambah Role

    </a>

</div>

<table class="table table-bordered table-striped">

    <thead>

        <tr>

            <th width="80">ID</th>

            <th>Nama Role</th>

            <th width="220">Aksi</th>

        </tr>

    </thead>

    <tbody>

    <?php if(empty($roles)): ?>

        <tr>

            <td colspan="3" class="text-center">

                Tidak ada data.

            </td>

        </tr>

    <?php endif; ?>

    <?php foreach($roles as $role): ?>

        <tr>

            <td><?= $role['id_role'] ?></td>

            <td><?= esc($role['nama_role']) ?></td>

            <td>

                <a
                    href="<?= base_url('superadmin/role/detail/'.$role['id_role']) ?>"
                    class="btn btn-info btn-sm">

                    Detail

                </a>

                <a
                    href="<?= base_url('superadmin/role/edit/'.$role['id_role']) ?>"
                    class="btn btn-warning btn-sm">

                    Edit

                </a>

                <a
                    href="<?= base_url('superadmin/role/delete/'.$role['id_role']) ?>"
                    class="btn btn-danger btn-sm">

                    Hapus

                </a>

            </td>

        </tr>

    <?php endforeach; ?>

    </tbody>

</table>

<?= $this->endSection() ?>