getMessage()); } catch (Exception $e) { die("General Error: " . $e->getMessage()); } // Now include helpers, which can use the existing $db connection require_once __DIR__ . '/helpers.php'; // Auth Check require_once __DIR__ . '/includes/auth.php'; check_auth(); // $db is already set above, so no need to call db() again, but it's safe if we do. // $db = db(); $lang = $_SESSION['lang']; require_once __DIR__ . '/includes/actions.php'; require_once __DIR__ . '/includes/common_data.php'; if (!isset($_GET['ajax_search'])) { require_once __DIR__ . '/includes/layout/header.php'; } require_once __DIR__ . '/includes/pages/dashboard.php'; if (!isset($_GET['ajax_search'])) { require_once __DIR__ . '/includes/layout/footer.php'; }