<div class="panel-actions">
    <a class="btn-primary" href="<?= e(url('admin/etkinlik/ekle')) ?>">+ Yeni Etkinlik</a>
</div>

<div class="panel">
    <div class="table-scroll">
    <table class="data-table">
        <thead><tr><th>Görsel</th><th>Başlık</th><th>Tarih</th><th>Rozet</th><th>Durum</th><th>İşlem</th></tr></thead>
        <tbody>
        <?php foreach ($events as $ev): ?>
            <tr>
                <td>
                    <?php if (!empty($ev['video'])): ?><span class="thumb thumb-emoji">🎬</span>
                    <?php elseif (!empty($ev['image'])): ?><img class="thumb" src="<?= e(media_url($ev['image'])) ?>" alt="">
                    <?php else: ?><span class="thumb thumb-emoji">★</span><?php endif; ?>
                </td>
                <td><strong><?= e($ev['title']) ?></strong></td>
                <td><?= e($ev['date_text'] ?? '') ?></td>
                <td><?= e($ev['badge'] ?? '') ?></td>
                <td><?= $ev['is_active'] ? '<span class="pill on">Aktif</span>' : '<span class="pill off">Pasif</span>' ?></td>
                <td class="actions">
                    <a class="mini-btn" href="<?= e(url('admin/etkinlik/duzenle/'.$ev['id'])) ?>">Düzenle</a>
                    <a class="mini-btn danger" href="<?= e(del_link('admin/etkinlik/sil/'.$ev['id'])) ?>" data-confirm="Bu etkinliği silmek istediğinize emin misiniz?">Sil</a>
                </td>
            </tr>
        <?php endforeach; ?>
        <?php if (empty($events)): ?><tr><td colspan="6" class="muted">Etkinlik yok.</td></tr><?php endif; ?>
        </tbody>
    </table>
    </div>
</div>
