Änderungen von templates und Hinzufügen von Validation
This commit is contained in:
@@ -4,35 +4,33 @@
|
||||
|
||||
<h1>Benutzer erstellen</h1>
|
||||
|
||||
<form method="post">
|
||||
<h2>Registrieren</h2>
|
||||
<form method="post" class="form-grid">
|
||||
|
||||
<label for="reg_name">Vorname:</label>
|
||||
<input type="text" name="name" id="reg_name" required>
|
||||
<?php foreach ($labels as $key => $label): ?>
|
||||
<div class="input">
|
||||
<label for="reg_<?= $key ?>"><?= $label ?></label>
|
||||
<?php if ($key === 'password'): ?>
|
||||
<input type="password" name="<?= $key ?>" id="reg_<?= $key ?>" required>
|
||||
<?php elseif ($key === 'role'): ?>
|
||||
<label><input type="radio" name="role" value="user" <?= (isset($validData['role']) && $validData['role'] === 'user') ? 'checked' : '' ?>> User</label>
|
||||
<label><input type="radio" name="role" value="leiter" <?= (isset($validData['role']) && $validData['role'] === 'leiter') ? 'checked' : '' ?>> Leiter</label>
|
||||
<?php else: ?>
|
||||
<input type="text" name="<?= $key ?>" id="reg_<?= $key ?>" value="<?= htmlspecialchars($validData[$key] ?? '') ?>" required>
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="reg_lastname">Nachname:</label>
|
||||
<input type="text" name="lastname" id="reg_lastname" required>
|
||||
<?php if (!empty($errors[$key])): ?>
|
||||
<div class="error"><?= $errors[$key] ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<label for="reg_email">Email:</label>
|
||||
<input type="email" name="email" id="reg_email" required>
|
||||
|
||||
<label for="reg_password">Passwort:</label>
|
||||
<input type="password" name="password" id="reg_password" required>
|
||||
|
||||
<p>Wähle deine Rolle:</p>
|
||||
<label>
|
||||
<input type="radio" name="role" value="user" required> User
|
||||
</label>
|
||||
<label>
|
||||
<input type="radio" name="role" value="leiter"> Leiter
|
||||
</label>
|
||||
|
||||
<input type="hidden" name="controller" value="user">
|
||||
<input type="hidden" name="do" value="register">
|
||||
<button type="submit" class="btn" style="display: block">Registrieren</button>
|
||||
|
||||
<button type="submit" class="btn">Registrieren</button>
|
||||
</form>
|
||||
|
||||
<a href="?controller=User&do=showUserLoginForm">Haben Sie schon ein Benutzer Konto?</a>
|
||||
|
||||
|
||||
<?php
|
||||
include dirname(__DIR__).'/footer.phtml';
|
||||
|
Reference in New Issue
Block a user