Compare commits
3 Commits
18a754add7
...
442cd25aa6
Author | SHA1 | Date |
---|---|---|
tracer | 442cd25aa6 | |
tracer | 63d4f339e3 | |
tracer | 2cd75e4694 |
|
@ -0,0 +1,6 @@
|
||||||
|
<?php include dirname(path: __DIR__) . '/_header.html.php'; ?>
|
||||||
|
|
||||||
|
<h1>Address Book - Admin</h1>
|
||||||
|
<a href="/admin/users">👱Users</a>
|
||||||
|
|
||||||
|
<?php include dirname(path: __DIR__) . '/_footer.html.php' ?>
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?php include dirname(path: __DIR__) . '/_header.html.php'; ?>
|
||||||
|
|
||||||
|
<h2>User list</h2>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Nick</th>
|
||||||
|
<th>First</th>
|
||||||
|
<th>Last</th>
|
||||||
|
<th>Is Admin</th>
|
||||||
|
<th> </th>
|
||||||
|
</tr>
|
||||||
|
<?php foreach ($users as $userLine): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?= $userLine->getNick() ?></td>
|
||||||
|
<td><?= $userLine->getFirst() ?></td>
|
||||||
|
<td><?= $userLine->getLast() ?></td>
|
||||||
|
<td style="text-align: center;">
|
||||||
|
<?php if ($userLine->isAdmin()): ?>
|
||||||
|
☑️
|
||||||
|
<?php else: ?>
|
||||||
|
👎
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="/admin/users/<?= $userLine->getNick(); ?>">edit</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
<a href="/admin/users/add">Add User</a>
|
||||||
|
|
||||||
|
<?php include dirname(path: __DIR__) . '/_footer.html.php' ?>
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php include dirname(path: __DIR__) . '/_header.html.php'; ?>
|
||||||
|
|
||||||
|
<form method="POST">
|
||||||
|
<input type="hidden" name="id" value="<?= $user->getId() ?>">
|
||||||
|
|
||||||
|
<label for="nick">Username</label>
|
||||||
|
<input type="text" name="nick" id="nick" value="<?= $user->getNick() ?>">
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<label for="password">Password (leave empty to keep the current one)</label>
|
||||||
|
<input type="password" name="password" id="password">
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<label for="first">First</label>
|
||||||
|
<input type="text" name="first" id="first" value="<?= $user->getFirst() ?>">
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<label for="last">Last</label>
|
||||||
|
<input type="text" name="last" id="last" value="<?= $user->getLast() ?>">
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<label for="is-admin">Is Admin</label>
|
||||||
|
<input type="checkbox" name="is-admin" id="is-admin" <?= $user->isAdmin()?'checked':'' ?>>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<!-- maybe later -->
|
||||||
|
<!-- <input type="hidden" name="_csrf" value="csrf_token" -->
|
||||||
|
<input type="submit" value="Save">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<?php include dirname(path: __DIR__) . '/_footer.html.php' ?>
|
Loading…
Reference in New Issue