<?php
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
ini_set('log_errors', '1');
ini_set('error_log', __DIR__ . '/php_error.log');

$DB_HOST = 'localhost';
$DB_USER = 'tempduzq_beam';
$DB_PASS = '#rg~PHwJl.+7';
$DB_NAME = 'tempduzq_beam';

$conn = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME);
if ($conn->connect_error) {
    die('Database connection failed: ' . $conn->connect_error);
}
$conn->set_charset('utf8mb4');

function is_logged_in() {
    return isset($_SESSION['admin_username']);
}
