News-Bearbeitung gefixt: Feldnamen im Model an Controller & Formular angepasst, keine Notices mehr beim Editieren.
This commit is contained in:
21
Views/News/editNewsForm.phtml
Normal file
21
Views/News/editNewsForm.phtml
Normal 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>
|
14
Views/News/showEditSuccess.phtml
Normal file
14
Views/News/showEditSuccess.phtml
Normal 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>
|
Reference in New Issue
Block a user