This commit is contained in:
2025-06-25 10:02:02 +02:00
7 changed files with 119 additions and 67 deletions

View File

@@ -5,26 +5,30 @@ include dirname(__DIR__).'/header.phtml';
<h2>Neuer Kurs</h2>
<form method="post">
<form method="post" class="form-grid">
<?php foreach ($labels as $index => $value) {
echo '<label for="' . $index . '">' . $value . '</label>';
if ($index == "beschreibung") {
echo "<textarea id=\"$index\" name=\"$index\" >";
if (isset($validData[$index])) { echo $validData[$index]; }
<?php
$index = 0;
foreach ($labels as $key => $value) {
echo '<div class="input"><label for="' . $key . '">' . $value . '</label>';
if ($key == "beschreibung") {
echo "<textarea id=\"$key\" name=\"$key\" >";
if (isset($validData[$key])) { echo $validData[$key]; }
echo "</textarea><br>";
} else {
echo '<input type="text" name="' . $index . '" value="' . (isset($validData[$index]) ? $validData[$index] : '') . '"><br>';
echo '<input class="input" type="text" name="' . $key . '" value="' . (isset($validData[$key]) ? $validData[$key] : '') . '"><br>';
}
if (isset($errors[$index])) {
echo '<label class="errorMsg">' . $errors[$index] . '</label><br>';
if (isset($errors[$key])) {
echo '<label class="errorMsg">' . $errors[$key] . '</label><br>';
}
echo '</div>';
$index++;
}
?>
<input type="hidden" name="controller" value="contact">
<input type="hidden" name="do" value="validateForm">
<input type="hidden" name="controller" value="admin">
<input type="hidden" name="do" value="showForm">
<input type="submit" name="submit" value="Absenden"></form>
<?php include dirname(__DIR__).'/footer.phtml'; ?>

View File

@@ -31,6 +31,7 @@ include dirname(__DIR__).'/header.phtml';
<input type="hidden" name="controller" value="contact">
<input type="hidden" name="do" value="validateForm">
<input type="submit" name="submit" value="Absenden"></form>
<input type="submit" name="submit" value="Absenden">
</form>
<?php include dirname(__DIR__).'/footer.phtml'; ?>