<?= $this->extend("layouts/default") ?>
<?= $this->section("title") ?>User Access<?= $this->endSection() ?>
<?= $this->section("content") ?>


<div class="index-div">
    <h1>User Access</h1>

    <a class="button" href="<?= url_to("Useraccess::new") ?>">New</a>

    <table>
        <tr>
            <th></th>
            <th>ID</th>
            <th>User</th>
            <th>Area</th>
            <th>Can Access</th>
            <th>Can Edit</th>
            <th>Last Updated</th>
            <th>Updated By</th>

            <?php foreach ($useraccesses as $useraccess): ?>
        <tr>
            <td>
                <a href="<?= site_url('/useraccess/' . $useraccess->uaid) ?>">
                    <button>View</button>
                </a>
            </td>
            <td>
                <?= $useraccess->uaid ?>
            </td>
            <td>
                <?= esc($useraccess->username) ?>
            </td>
            <td>
                <?= $useraccess->level ?>
            </td>
            <td>
                <?= $useraccess->can_access ?>
            </td>
            <td>
                <?= $useraccess->can_edit ?>
            </td>
            <td>
                <?= $useraccess->lastupdated ?>
            </td>
            <td>
                <?= esc($useraccess->lastuser) ?>
            </td>
        </tr>
    <?php endforeach; ?>


    </table>
</div>
<?= $this->endSection() ?>