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

    <h2>Alle Ausstellungen</h2>

<?php if (!empty($events)): ?>
    <table>
        <thead>
        <tr>
            <th>Name</th>
            <th>Beschreibung</th>
            <th>Von</th>
            <th>Bis</th>
            <th>Max. Tickets</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($events as $event): ?>
            <tr>
                <td><?php echo htmlspecialchars($event['name']); ?></td>
                <td><?php echo nl2br(htmlspecialchars($event['beschreibung'])); ?></td>
                <td><?php echo date('d.m.Y', strtotime($event['datum_von'])); ?></td>
                <td><?php echo date('d.m.Y', strtotime($event['datum_bis'])); ?></td>
                <td><?php echo (int) $event['max_tickets']; ?></td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
<?php else: ?>
    <p>Derzeit sind keine Ausstellungen verfügbar.</p>
<?php endif; ?>

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