<?php
// includes/db.php  – Edit credentials before deploying
define('DB_HOST', 'localhost');
define('DB_NAME', 'georizmj_onvite_superadmin');
define('DB_USER', 'georizmj_superadmin');       // ← change
define('DB_PASS', 'Lake92040#');   // ← change
define('DB_CHARSET', 'utf8mb4');

function getDB(): PDO {
    static $pdo = null;
    if ($pdo === null) {
        $dsn = "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME . ";charset=" . DB_CHARSET;
        $pdo = new PDO($dsn, DB_USER, DB_PASS, [
            PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
            PDO::ATTR_EMULATE_PREPARES   => false,
        ]);
    }
    return $pdo;
}
