<?php use function App\Core\e; $section = 'loglar'; ?>
<div class="panel zpanel zpanel-app">
    <?php require BASE_PATH . '/app/Views/zpanel/_sidebar.php'; ?>
    <section class="panel-body zpanel-main">
        <div class="zpanel-head"><div><p class="eyebrow">ZPanel</p><h1>Admin Loglari</h1><p class="muted">Admin aksiyonlari, hedefler, IP ve sanitize edilmis detaylar.</p></div></div>
        <section class="zpanel-card"><div class="table-scroll"><table class="zpanel-table">
            <thead><tr><th>ID</th><th>Admin</th><th>Aksiyon</th><th>Hedef</th><th>Detay</th><th>IP</th><th>Tarih</th></tr></thead><tbody>
            <?php foreach (($logs ?? []) as $log): ?><tr><td><?= e($log['id'] ?? '') ?></td><td><?= e($log['admin_username'] ?? '-') ?></td><td><?= e($log['action'] ?? '') ?></td><td><?= e(($log['target_type'] ?? '-') . ' #' . ($log['target_id'] ?? '-')) ?></td><td><code><?= e($log['details'] ?? '{}') ?></code></td><td><?= e($log['ip_address'] ?? '') ?></td><td><?= e($log['created_at'] ?? '') ?></td></tr><?php endforeach; ?>
            <?php if (empty($logs)): ?><tr><td colspan="7">Admin logu yok.</td></tr><?php endif; ?>
            </tbody></table></div></section>
    </section>
</div>
