<div class="card">
    <div class="card-body">
        <h4 class="card-title">Roles Created</h4>
        <table id="example11" class="table display table-bordered table-striped">
            <thead>
                <tr  class="text-center">
                    <th scope="col">ID</th>
                    <th scope="col">Controller Name</th>
                    <th scope="col">Method Name</th>
                    <th scope="col">Action</th>
                </tr>
            </thead>
            <tbody>
                <?php if (!empty($permissions)): ?>
                    <?php foreach ($permissions as $permission): ?>
               <tr  class="text-center">
                    <td><?= $permission->id ?></td>
                    <td><?= $permission->controller ?></td>
                    <td><?= $permission->method ?></td>
                    <td>
                        <!-- EDIT MODAL TRIGGER -->
                        <a href="javascript:void(0);" 
                           class="permission-edit-modal" 
                           data-id="<?= $permission->id ?>" 
                           data-controller="<?= $permission->controller ?>" 
                           data-method="<?= $permission->method ?>" 
                           data-label="<?= $permission->label ?>">
                            <i class="fa fa-edit text-warning"></i>
                        </a>

                        <!-- DELETE CONFIRMATION -->
                        <a href="javascript:void(0);" 
                           class="delete-confirmation-modal" 
                           data-url="<?= base_url('admin/rolepermissions/delete_permission/' . $permission->id) ?>">
                            <i class="fa fa-trash text-danger"></i>
                        </a>
                    </td>
                </tr>
                    <?php endforeach; ?>
                <?php else: ?>
                <tr>
                    <td colspan="4" class="text-center">No Permissions found.</td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>



     