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

echo "<h3>PHP OK - versi: " . phpversion() . "</h3>";

// Test koneksi DB
define('DB_HOST', 'localhost');
define('DB_NAME', 'abdulura_spp_sekolah');
define('DB_USER', 'abdulura_abdulura');
define('DB_PASS', 'Lr-h#50SSD5vy9');

try {
    $pdo = new PDO(
        "mysql:host=".DB_HOST.";dbname=".DB_NAME.";charset=utf8mb4",
        DB_USER, DB_PASS
    );
    echo "<h3 style='color:green'>✅ Database terhubung!</h3>";
} catch (PDOException $e) {
    echo "<h3 style='color:red'>❌ DB Error: " . $e->getMessage() . "</h3>";
}