<div class="inhalt">
  <div class="form-container">
    <h1>News bearbeiten</h1>
    <?php if (!empty($errors['news'])): ?>
      <div class="error-box"><?=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>