<?php
session_start();
if (!isset($_SESSION['admin_id'])) { header("Location: login.php"); exit(); }
$logfile = '../error_log';
$logs = file_exists($logfile) ? file_get_contents($logfile) : 'No logs found.';
?>
<!DOCTYPE html>
<html><head><title>System Logs</title><link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"></head>
<body><div class="container mt-4"><h2>System Error Log</h2><pre><?= htmlspecialchars(substr($logs, -5000)) ?></pre></div></body>
</html>