<?php
define('DB_HOST', 'localhost');
define('DB_NAME', 'abdulura_spp_sekolah');
define('DB_USER', 'abdulura_abdulura');
define('DB_PASS', 'Lr-h#50SSD5vy9');
define('DB_CHAR', 'utf8mb4');

try {
    $pdo = new PDO(
        "mysql:host=".DB_HOST.";dbname=".DB_NAME.";charset=".DB_CHAR,
        DB_USER, DB_PASS,
        [
            PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
            PDO::ATTR_EMULATE_PREPARES   => false,
        ]
    );
} catch (PDOException $e) {
    die('<div style="font-family:sans-serif;padding:40px;text-align:center;color:#dc2626">
        <h2>❌ Koneksi Database Gagal</h2>
        <p style="color:#666">'.$e->getMessage().'</p>
    </div>');
}