Lachenzelg/admin/admins-create.php

60 lines
2.4 KiB
PHP
Raw Normal View History

2025-01-07 03:02:25 +01:00
<?php include('includes/header.php'); ?>
<div>
<div class="card card-body p-4">
<?= alertMessage(); ?>
<div class="row">
<div class="col-8">
<h3 class="fw-semibold mb-4">Administrator erstellen</h3>
</div>
<div class="col-4">
<a href="admins.php" class="btn btn-light float-end"> <i class="ti ti-arrow-left"></i> Zurück zur Übersicht</a>
</div>
</div>
<form action="code.php" method="POST">
<div class="row">
<div class="col-md-6">
<div class=" mb-3">
<label class="form-label">Vorname</label>
<input type="text" name="firstname" required class="form-control">
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">Nachname</label>
<input type="text" name="lastname" required class="form-control">
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">Benutzer-ID</label>
<input type="text" name="user-id" required pattern="[A-Za-z0-9\-]+" onkeydown="if(['Space'].includes(arguments[0].code)){return false;}" class="form-control">
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">Kennwort</label>
<input type="password" name="password" class="form-control">
</div>
</div>
<div class="col-md-6">
<div class="mb-3">
<label class="form-label">Status</label>
<select name="status" class="form-select">
<?php
$enumValueLabels = [
'active' => 'Aktiv',
'disabled' => 'Inaktiv'
];
createEnumSelect('tbl_admins', 'status', '', $enumValueLabels);
?>
</select>
</div>
</div>
<div class="col-md-12">
<button type="submit" name="createadmin" class="btn btn-info float-end"><i class="ti ti-plus me-1"></i>Erstellen</button>
</div>
</div>
</form>
</div>
</div>
<?php include('includes/footer.php'); ?>