<?php if (!defined('DASHBOARD_ROOT')) { http_response_code(403); exit; } ?> <table class="data-table"> <thead> <tr><th>Time</th><th>Category</th><th>Action</th><th>Target</th><th>IP</th><th>Admin</th></tr> </thead> <tbody><?php if (empty($events)): ?> <tr><td colspan="6" style="text-align:center;padding:30px;color:var(--text-dim)">No events found.</td></tr><?php else: foreach ($events as $ev): $cat = (int)($ev['category'] ?? 0); ?> <tr> <td style="font-size:11px;color:var(--text-dim);white-space:nowrap"><?= UI::e($ev['created_at'] ?? '') ?></td> <td><span class="badge badge-<?= $catColors[$cat] ?? 'default' ?>"><?= $catLabels[$cat] ?? 'OTHER' ?></span></td> <td style="font-weight:700"><?= UI::e($ev['action'] ?? '') ?></td> <td style="font-size:11px"><?= UI::e(($ev['target_type'] ?? '') . ($ev['target_id'] ? '#' . $ev['target_id'] : '')) ?></td> <td style="font-family:var(--font-mono);font-size:10px;color:var(--text-dim)"><?= UI::e($ev['ip_address'] ?? '') ?></td> <td><?= UI::e($ev['admin_id'] ?? '') ?></td> </tr><?php endforeach; endif; ?> </tbody> </table><?php if ($maxPage > 1): ?> <div class="pagination" style="padding:12px"><?php for ($i = max(1, $page - 3); $i <= min($maxPage, $page + 3); $i++): ?> <a href="?view=logs&page=<?= $i ?>&cat=<?= UI::e($catFilter) ?>" class="<?= $page === $i ? 'page-active' : '' ?>"><?= $i ?></a><?php endfor; ?> </div><?php endif; ?>