<?php
// Test file - delete after debugging
error_reporting(E_ALL);
ini_set('display_errors', 1);

echo "<h2>Step 1: PHP works ✓</h2>";

session_start();
echo "<h2>Step 2: Session started ✓</h2>";
echo "<p>Session ID: " . session_id() . "</p>";
echo "<p>Session data: <pre>" . print_r($_SESSION, true) . "</pre></p>";

echo "<h2>Step 3: Testing database.php...</h2>";
require_once 'config/database.php';
echo "<p>database.php loaded ✓</p>";

echo "<h2>Step 4: Testing translation.php...</h2>";
require_once 'includes/translation.php';
echo "<p>translation.php loaded ✓</p>";

echo "<h2>Step 5: Testing DB connection...</h2>";
try {
    $db = new Database();
    $conn = $db->getConnection();
    echo "<p style='color:green'>DB connected ✓</p>";
} catch (Exception $e) {
    echo "<p style='color:red'>DB Error: " . $e->getMessage() . "</p>";
}

echo "<h2>All tests passed!</h2>";
echo "<p><a href='login.php?logout=1'>Clear session & go to login</a></p>";
?>
