<?php
if (!empty($users_info)) {
    ?>
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="<?= lang('close') ?>"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><?= lang('users') . ' ' . lang('list') . ' ' . lang('by') . ' ' . lang('designation') . ': ' . $designation_info->designations ?></h4>
    </div>
    <div class="modal-body">
        <div id="scroll-500" class="rounded-xl border border-border bg-card">
            <table class="table">
                <?php foreach ($users_info as $key => $v_user) { ?>
                    <tr>
                        <td class="text-sm">
                            <?= ($key + 1) . '. ' ?>
                            <a class="text-indigo-600 hover:underline" href="<?= base_url('admin/user/user_details/' . $v_user->user_id) ?>">
                                <?= fullname($v_user->user_id) ?>
                            </a>
                        </td>
                    </tr>
                <?php } ?>
            </table>
        </div>
        <div class="flex items-center justify-end gap-2 pt-4">
            <button type="button" class="inline-flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-semibold text-foreground hover:bg-muted" data-dismiss="modal">
                <i data-lucide="x" class="h-4 w-4"></i>
                <?= lang('close') ?>
            </button>
        </div>
    </div>
<?php } ?>
<script type="text/javascript">
    $(document).ready(function () {
        initScrollbar("#scroll-500", {setHeight: 500});
    });
</script>
