<?php
/**
 * Database configuration - Fizasite
 * Database name: fizasie
 */
define('DB_HOST', 'localhost');
define('DB_USER', 'iqenergiesco_fiza');
define('DB_PASS', 'Fiza@2026');
define('DB_NAME', 'iqenergiesco_fizasite');

function getDB() {
    static $pdo = null;
    if ($pdo === null) {
        try {
            $pdo = new PDO(
                'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=utf8mb4',
                DB_USER,
                DB_PASS,
                [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
            );
        } catch (PDOException $e) {
            die('Database connection failed: ' . $e->getMessage());
        }
    }
    return $pdo;
}
