<?php include dirname(__DIR__) . '/header.phtml'; ?>

    <h2>Alle News</h2>

<?php if (!empty($news)): ?>
    <table>
        <thead>
        <tr>
            <th>Name</th>
            <th>Beschreibung</th>
            <th>Datum</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($news as $item): ?>
            <tr>
                <td><?php echo htmlspecialchars($item['name']); ?></td>
                <td><?php echo nl2br(htmlspecialchars($item['beschreibung'])); ?></td>
                <td><?php echo date('d.m.Y', strtotime($item['datum'])); ?></td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
<?php else: ?>
    <p>Derzeit sind keine News verfügbar.</p>
<?php endif; ?>

<?php include dirname(__DIR__) . '/footer.phtml'; ?>