PHP Classes

File: app/Views/Admin/Users/index.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   Task App   app/Views/Admin/Users/index.php   Download  
File: app/Views/Admin/Users/index.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Task App
Create and manage tasks to be done
Author: By
Last change:
Date: 1 month ago
Size: 1,341 bytes
 

Contents

Class file image Download
<?= $this->extend("base"); ?>

<?= $this->section("title"); ?>Users<?= $this->endSection(); ?>

<?= $this->section("content"); ?>

<h1 class="title">Users</h1>

<a class="button is-link" href="<?= site_url('/admin/users/new'); ?>">Add a User</a>

<?php if ($users) : ?>
<table class="table">
        <thead>
            <tr>
                <th>Username</th>
                <th>Email</th>
                <th>Administrator</th>
                <th>Created at</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($users as $user) : ?>
<tr>
                    <td>
                        <a href="<?= site_url('/admin/users/show/' . $user->id); ?>">
                            <?= $user->username; ?>
</a>
                    </td>
                    <td>
                        <?= $user->email; ?>
</td>
                    <td>
                        <?= $user->is_admin ? 'yes' : 'no'; ?>
</td>
                    <td>
                        <?= $user->created_at->humanize(); ?>
</td>
                </tr>
            <?php endforeach; ?>
</tbody>
    </table>

    <?= $pages->simpleLinks(); ?>
<?php
else : ?>
<p>There are no users</p>
<?php endif; ?>

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