81 lines
3.4 KiB
PHP
81 lines
3.4 KiB
PHP
|
<?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">Lehrperson bearbeiten</h3>
|
||
|
</div>
|
||
|
<div class="col-4">
|
||
|
<a href="teachers.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">
|
||
|
<?php
|
||
|
$paramResult = checkParamId('id');
|
||
|
if(!is_numeric($paramResult)){
|
||
|
echo '<div class="alert alert-danger" role="alert">'.$paramResult.'</div>';
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
$teacher = getById('tbl_teachers',checkParamId('id'));
|
||
|
if($teacher['status'] == 200)
|
||
|
{
|
||
|
?>
|
||
|
<input type="hidden" name="id" value="<?= $teacher['data']['id'] ;?>" required>
|
||
|
<div class="row">
|
||
|
<div class="col-md-6">
|
||
|
<div class="mb-3">
|
||
|
<label class="form-label">Vorname</label>
|
||
|
<input type="text" name="firstname" value="<?= $teacher['data']['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" value="<?= $teacher['data']['lastname'] ;?>" required class="form-control">
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="col-md-6">
|
||
|
<div class="mb-3">
|
||
|
<label class="form-label">E-Mail Adresse</label>
|
||
|
<input type="email" name="email" value="<?= $teacher['data']['email'] ;?>" required class="form-control">
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="col-md-12">
|
||
|
<button type="submit" name="updateteacher" class="btn btn-info float-end"><i class="ti ti-check"></i> Änderungen speichern</button>
|
||
|
<a type="button" class="btn btn-danger float-end mx-1" data-bs-toggle="modal" data-bs-target="#deleteTeacher"><i class="ti ti-trash"></i> Löschen</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
<?php
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
echo '<div class="alert alert-danger" role="alert">'.$teacher['message'].'</div>';
|
||
|
}
|
||
|
|
||
|
?>
|
||
|
|
||
|
</form>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- Modal -->
|
||
|
<div class="modal fade" id="deleteTeacher" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||
|
<div class="modal-dialog">
|
||
|
<div class="modal-content">
|
||
|
<div class="modal-header">
|
||
|
<h1 class="modal-title fs-5" id="staticBackdropLabel">Lehrperson entfernen</h1>
|
||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||
|
</div>
|
||
|
<div class="modal-body">
|
||
|
<p>Sind Sie sicher, dass Sie <b><?= $teacher['data']['firstname'] . ' ' . $teacher['data']['lastname']?></b> entfernen möchten?</p>
|
||
|
</div>
|
||
|
<div class="modal-footer">
|
||
|
<button type="button" class="btn btn-light" data-bs-dismiss="modal">Abbrechen</button>
|
||
|
<a href="teachers-delete.php?id=<?= $teacher['data']['id']; ?>" class="btn btn-danger"><i class="ti ti-trash"></i> Löschen</a>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- Modal Ende -->
|
||
|
<?php include('includes/footer.php'); ?>
|