PHP_AdminTool_Projekt/public/views/users_create.php

53 lines
2.2 KiB
PHP

<?php
declare(strict_types=1);
/**
* Platzhalter-View: Benutzer hinzufügen
*/
?>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Benutzer hinzufügen</h6>
</div>
<div class="card-body">
<?php if (!empty($errors) && is_array($errors)): ?>
<div class="alert alert-danger">
<ul>
<?php foreach ($errors as $e): ?>
<li><?= htmlspecialchars($e, ENT_QUOTES, 'UTF-8') ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php if (!empty($success)): ?>
<div class="alert alert-success"><?= htmlspecialchars($success, ENT_QUOTES, 'UTF-8') ?></div>
<?php endif; ?>
<form method="post" action="index.php?route=users.create.submit" class="user">
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($csrf_token ?? '', ENT_QUOTES, 'UTF-8') ?>">
<div class="form-group">
<label for="username">Benutzername</label>
<input id="username" name="username" class="form-control" value="<?= htmlspecialchars($form['username'] ?? '', ENT_QUOTES, 'UTF-8') ?>">
</div>
<div class="form-group">
<label for="givenName">Vorname</label>
<input id="givenName" name="givenName" class="form-control" value="<?= htmlspecialchars($form['givenName'] ?? '', ENT_QUOTES, 'UTF-8') ?>">
</div>
<div class="form-group">
<label for="sn">Nachname</label>
<input id="sn" name="sn" class="form-control" value="<?= htmlspecialchars($form['sn'] ?? '', ENT_QUOTES, 'UTF-8') ?>">
</div>
<div class="form-group">
<label for="mail">E-Mail</label>
<input id="mail" name="mail" class="form-control" value="<?= htmlspecialchars($form['mail'] ?? '', ENT_QUOTES, 'UTF-8') ?>">
</div>
<button type="submit" class="btn btn-primary">Validieren (Platzhalter)</button>
<a href="index.php?route=users" class="btn btn-secondary">Zurück zur Liste</a>
</form>
</div>
</div>