<?php
// Enable full error reporting
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('log_errors', 1);

echo "<h2>Testing Admin Class</h2>";

// Test the class file directly
echo "<h3>Step 1: Testing class.admin.php syntax</h3>";
$output = shell_exec('php -l dashboard/admin/class.admin.php 2>&1');
echo "<pre>$output</pre>";

// Try to include it
echo "<h3>Step 2: Attempting to load class</h3>";
try {
    ob_start();
    require_once 'dashboard/admin/class.admin.php';
    $errors = ob_get_clean();
    if ($errors) {
        echo "<pre style='color:red;'>$errors</pre>";
    } else {
        echo "<p style='color:green;'>Class loaded successfully!</p>";
    }
} catch (Throwable $e) {
    echo "<pre style='color:red;'>Error: " . $e->getMessage() . "\n";
    echo "File: " . $e->getFile() . "\n";
    echo "Line: " . $e->getLine() . "</pre>";
}

echo "<h3>Done</h3>";
?>
