<?php
// includes/db.php
declare(strict_types=1);

function pdo(): PDO {
  static $pdo = null;
  if ($pdo instanceof PDO) return $pdo;

  $host = '127.0.0.1';
  $db   = 'deltadmin_breport';
  $user = 'deltadmin_sysadmin';
  $pass = '#aAb07DB583.26#';
  $charset = 'utf8mb4';

  $dsn = "mysql:host={$host};dbname={$db};charset={$charset}";
  $opt = [
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
    PDO::ATTR_EMULATE_PREPARES => false,
  ];
  $pdo = new PDO($dsn, $user, $pass, $opt);
  return $pdo;
}