<?php
// Mock session
session_start();
$_SESSION['user_id'] = 1;
$_SESSION['user_role_name'] = 'Administrator';
$_SESSION['user_permissions'] = 'all';

// Simulate GET request
$_GET['page'] = 'accounting';
$_SERVER['REQUEST_METHOD'] = 'GET';
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
$_SERVER['HTTPS'] = 'on';

// Capture output
ob_start();
try {
    require 'index.php';
} catch (Throwable $e) {
    echo "\nFATAL ERROR: " . $e->getMessage() . " in " . $e->getFile() . ":" . $e->getLine() . "\n";
}
$output = ob_get_clean();

file_put_contents('output_test.html', $output);
echo "Output saved to output_test.html (" . strlen($output) . " bytes)\n";
