<?php
// GLOBAL COMPANY SETTINGS
if (!defined('COMPANY_ADDR')) {
    define('COMPANY_ADDR', 'Plot No – 361, Ground Floor<br>Anuj Times Squre building, Rupali Squre<br>Bhubaneswar, Odisha-751007<br>Email:- info@utcpl.co.in');
}

if (!defined('COMPANY_LOGO')) {
    define('COMPANY_LOGO', 'https://utcpl.co.in/images/logo-1.webp');
}
// 1. DATABASE CONFIGURATION (Derived from your .env)
$host     = '127.0.0.1';
$db       = 'demotest_utcpl_hr';
$user     = 'demotest_utcpl_hr';
$pass     = 'Utcpl@2025#';
$charset  = 'utf8mb4';

// 2. TIMEZONE (Required for correct salary dates)
date_default_timezone_set('Asia/Kolkata'); 

// 3. SECURE CONNECTION
try {
    $dsn = "mysql:host=$host;dbname=$db;charset=$charset";
    
    $options = [
        PDO::ATTR_ERRMODE            => PDO::ERRMODE_EXCEPTION,      // Show errors (critical for debugging)
        PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,          // Fetch as arrays (Modern standard)
        PDO::ATTR_EMULATE_PREPARES   => false,                     // Prevent SQL Injection
    ];
    
    $conn = new PDO($dsn, $user, $pass, $options);

} catch (PDOException $e) {
    // Secure failure: Don't show password details to users
    error_log($e->getMessage()); 
    die("Database Connection Failed. Please try again later.");
}
?>