<?php
// Enable detailed error reporting for debugging
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$section = 'hr_dashboard';
require_once __DIR__ . '/db/config.php';

// Try to connect to DB first
try {
    $db = db();
} catch (PDOException $e) {
    die("Database Connection Error: " . $e->getMessage());
} catch (Exception $e) {
    die("General Error: " . $e->getMessage());
}

require_once __DIR__ . '/helpers.php';
require_once __DIR__ . '/includes/auth.php';
check_auth();

$lang = $_SESSION['lang'];

require_once __DIR__ . '/includes/actions.php';
require_once __DIR__ . '/includes/common_data.php';

require_once __DIR__ . '/includes/layout/header.php';

require_once __DIR__ . '/includes/pages/hr_dashboard.php';

require_once __DIR__ . '/includes/layout/footer.php';