News-Bearbeitung gefixt: Feldnamen im Model an Controller & Formular angepasst, keine Notices mehr beim Editieren.

This commit is contained in:
2025-07-08 10:38:27 +02:00
parent 5f3ac9f78d
commit 7280cb0246
4 changed files with 70 additions and 10 deletions

View File

@@ -0,0 +1,21 @@
<div class="inhalt">
<div class="form-container">
<h1>News bearbeiten</h1>
<?php if (!empty($errors['news'])): ?>
<div class="form-error"><?=htmlspecialchars($errors['news'])?></div>
<?php endif; ?>
<form class="form-horizontal" action="index.php" method="post">
<input type="hidden" name="controller" value="News">
<input type="hidden" name="do" value="updateNews">
<input type="hidden" name="id" value="<?=htmlspecialchars($id ?? '')?>">
<label for="name">Titel</label>
<input type="text" name="name" id="name" required value="<?=htmlspecialchars($validData['name'] ?? '')?>">
<label for="date">Datum</label>
<input type="date" name="date" id="date" required value="<?=htmlspecialchars($validData['date'] ?? date('Y-m-d'))?>">
<label for="description">Beschreibung</label>
<textarea name="description" id="description" rows="7" required><?=htmlspecialchars($validData['description'] ?? '')?></textarea>
<button class="button-register" type="submit">Änderungen speichern</button>
</form>
<a href="?controller=News&do=showNews">Zurück zur Übersicht</a>
</div>
</div>

View File

@@ -0,0 +1,14 @@
<div class="inhalt">
<div class="login-success">
<h2>News erfolgreich bearbeitet!</h2>
<p>Du wirst in wenigen Sekunden zur Übersicht weitergeleitet...</p>
</div>
</div>
<script>
setTimeout(function() {
window.location.href = "?controller=News&do=showNews";
}, 2000);
</script>
<noscript>
<meta http-equiv="refresh" content="2;url=?controller=News&do=showNews">
</noscript>