<section class="content-header">
    <h1><?= __('Users') ?></h1>

    <div class="actions">
        <a data-ajax class="btn btn-success btn-sm" href="<?= admin_url_to('/users/add') ?>"><?= __('Add') ?></a>
    </div>
</section>

<section class="content">

    <?php if (empty($users)): ?>
        <div class="callout callout-warning">
            <h4>Ops!</h4>
            <p><?= __('No users found') ?></p>
        </div>
    <?php else: ?>

        <div class="box box-default table-responsive">
            <table data-table class="table table-condensed table-hover table-striped">
                <thead>
                    <tr>
                        <th><?= __('Name') ?></th>
                        <th><?= __('User') ?></th>
                        <th><?= __('Email') ?></th>
                        <th><?= __('Group') ?></th>
                        <th width="10"></th>
                    </tr>
                </thead>

                <tbody>
                    <?php foreach ($users as $user): ?>
                        <tr>
                            <td><?= $user['name'] ?></td>
                            <td><?= $user['username'] ?></td>
                            <td><?= $user['email'] ?></td>
                            <td><?= $user['grupo'] ?></td>
                            <td class="record-actions">
                                <a data-ajax class="btn btn-xs btn-default" href="<?= admin_url_to('/users/edit/' . $user['id']) ?>"><?= __('Edit') ?></a>
                                <a data-ajax-delete class="btn btn-xs btn-danger" href="<?= admin_url_to('/users/delete/' . $user['id']) ?>"><?= __('Delete') ?></a>
                            </td>
                        </tr>
                    <?php endforeach ?>
                </tbody>
            </table>
        </div>
    <?php endif ?>
</section>