<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

session_start();

// Simulate logged-in user
if (!isset($_SESSION['uname'])) {
    $_SESSION['uname'] = 'stanlee';
}

echo "<!DOCTYPE html><html><head><title>Summary Test</title></head><body>";
echo "<h1>Testing Summary Page Load</h1>";
echo "<p>Session username: " . htmlspecialchars($_SESSION['uname']) . "</p>";
echo "<hr>";

// Try to load the actual summary.php
echo "<h2>Loading summary.php...</h2>";

try {
    ob_start();
    include('summary.php');
    $output = ob_get_clean();
    
    if (empty($output)) {
        echo "<p style='color:red;'>summary.php produced no output (blank page)</p>";
    } else {
        echo "<p style='color:green;'>summary.php loaded successfully</p>";
        echo "<hr>";
        echo $output;
    }
} catch (Exception $e) {
    echo "<p style='color:red;'>Error: " . $e->getMessage() . "</p>";
}

echo "</body></html>";
?>
