<?php
// =====================================================================
// KONFIGURASI DATABASE
// Sesuaikan DB_USER, DB_PASS, DB_NAME dengan akun hosting/cPanel Anda
// Konvensi cPanel biasanya: namauser_namadb (contoh: abdulura_keuangan)
// =====================================================================

define('DB_HOST', 'localhost');
define('DB_NAME', 'abdulura_keuangan_sekolah'); // sudah disesuaikan dengan database cPanel Anda
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,
        [
            PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
            PDO::ATTR_EMULATE_PREPARES   => false,
            PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true,
        ]
    );
} catch (PDOException $e) {
    die("Koneksi database gagal: " . $e->getMessage());
}

// Timezone Indonesia
date_default_timezone_set('Asia/Jakarta');