<?php
// Only for admin - add proper authentication before production use
if (!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true) {
    die('Unauthorized');
}

$log_file = __DIR__ . '/cron.log';

if (!file_exists($log_file)) {
    echo "<p>No cron logs found yet. Cron jobs will start logging after first run.</p>";
    exit;
}

$logs = file_get_contents($log_file);
$logs = nl2br(htmlspecialchars($logs));

echo "<pre style='background:#f5f5f5; padding:15px; border-radius:5px; max-height:600px; overflow-y:auto;'>";
echo $logs;
echo "</pre>";
?>