Compare commits

...

4 Commits

Author SHA1 Message Date
tracer ed1e795941 renamed template 2022-10-24 18:40:37 +02:00
tracer 7559651447 initial commit 2022-10-24 18:37:32 +02:00
tracer bf5425737b added required to fields 2022-10-24 18:37:00 +02:00
tracer 0a9a253b84 initial commit 2022-10-24 18:36:14 +02:00
4 changed files with 67 additions and 5 deletions

View File

@ -0,0 +1,29 @@
<?php include dirname(path: __DIR__) . '/_header.html.php'; ?>
<form method="POST">
<label for="nick">Username</label>
<input type="text" name="nick" id="nick" required>
<br>
<label for="password">Password</label>
<input type="password" name="password" id="password" required>
<br>
<label for="first">First</label>
<input type="text" name="first" id="first" required>
<br>
<label for="last">Last</label>
<input type="text" name="last" id="last" required>
<br>
<label for="is-admin">Is Admin</label>
<input type="checkbox" name="is_admin" id="is_admin">
<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' ?>

View File

@ -1,10 +1,10 @@
<?php include dirname(path: __DIR__) . '/_header.html.php'; ?>
<form method="POST">
<input type="hidden" name="id" value="<?= $user->getId() ?>">
<input type="hidden" name="id" value="<?= $editUser->getId() ?>">
<label for="nick">Username</label>
<input type="text" name="nick" id="nick" value="<?= $user->getNick() ?>">
<input type="text" name="nick" id="nick" value="<?= $editUser->getNick() ?>" required>
<br>
<label for="password">Password (leave empty to keep the current one)</label>
@ -12,15 +12,15 @@
<br>
<label for="first">First</label>
<input type="text" name="first" id="first" value="<?= $user->getFirst() ?>">
<input type="text" name="first" id="first" value="<?= $editUser->getFirst() ?>" required>
<br>
<label for="last">Last</label>
<input type="text" name="last" id="last" value="<?= $user->getLast() ?>">
<input type="text" name="last" id="last" value="<?= $editUser->getLast() ?>" required>
<br>
<label for="is-admin">Is Admin</label>
<input type="checkbox" name="is-admin" id="is-admin" <?= $user->isAdmin()?'checked':'' ?>>
<input type="checkbox" name="is_admin" id="is_admin" <?= $editUser->isAdmin()?'checked':'' ?>>
<br>
<!-- maybe later -->

6
templates/index.html.php Normal file
View File

@ -0,0 +1,6 @@
<?php include '_header.html.php' ?>
<br>
Welcome to Address Book
<?php include '_footer.html.php' ?>

View File

@ -0,0 +1,27 @@
<?php include dirname(path: __DIR__) . '/_header.html.php'; ?>
<?php if (false): ?>
You need Admin rights to access this area.
<?php else: ?>
<br>
<?php if ($message): ?>
<div class="info">
<?= $message ?>
</div>
<?php endif; ?>
<form method="POST">
<label for="nick">Username</label>
<input type="text" name="nick" id="nick">
<label for="password">Password</label>
<input type="password" name="password" id="password">
<!-- maybe later -->
<!-- <input type="hidden" name="_csrf" value="csrf_token" -->
<input type="submit" value="Login">
</form>
<?php endif; ?>
<?php include dirname(path: __DIR__) . '/_footer.html.php' ?>