diff --git a/modules/billing/add_to_cart.php b/modules/billing/add_to_cart.php index 3101e688..efe3159a 100644 --- a/modules/billing/add_to_cart.php +++ b/modules/billing/add_to_cart.php @@ -5,6 +5,13 @@ require_once(__DIR__ . '/includes/config.inc.php'); require_once(__DIR__ . '/includes/login_required.php'); require_once(__DIR__ . '/includes/log.php'); +// Variables from config.inc.php (helps IDEs understand scope) +/** @var string $db_host Database host */ +/** @var string $db_user Database user */ +/** @var string $db_pass Database password */ +/** @var string $db_name Database name */ +/** @var string $table_prefix Table prefix for database tables */ + // Start session if not already if (session_status() === PHP_SESSION_NONE) session_start(); diff --git a/modules/billing/admin_coupons.php b/modules/billing/admin_coupons.php index a168e373..12a39375 100644 --- a/modules/billing/admin_coupons.php +++ b/modules/billing/admin_coupons.php @@ -3,6 +3,13 @@ require_once(__DIR__ . '/includes/admin_auth.php'); require_once(__DIR__ . '/includes/config.inc.php'); +// Variables from config.inc.php (helps IDEs understand scope) +/** @var string $db_host Database host */ +/** @var string $db_user Database user */ +/** @var string $db_pass Database password */ +/** @var string $db_name Database name */ +/** @var string $table_prefix Table prefix for database tables */ + // Start session if not already started by admin_auth if (session_status() === PHP_SESSION_NONE) session_start(); if (empty($_SESSION['admin_csrf'])) { diff --git a/modules/billing/cart.php b/modules/billing/cart.php index b0ea58be..5120ef35 100644 --- a/modules/billing/cart.php +++ b/modules/billing/cart.php @@ -42,6 +42,15 @@ if (session_status() === PHP_SESSION_NONE) { // Load configuration require_once(__DIR__ . '/includes/config.inc.php'); +// Variables from config.inc.php (helps IDEs understand scope) +/** @var string $db_host Database host */ +/** @var string $db_user Database user */ +/** @var string $db_pass Database password */ +/** @var string $db_name Database name */ +/** @var string $table_prefix Table prefix for database tables */ +/** @var string $SITE_BASE_URL Site base URL */ +/** @var string $SITE_DATA_DIR Data directory path */ + // Check if user is logged in $user_id = 0; if (isset($_SESSION['website_user_id']) && !empty($_SESSION['website_user_id'])) { @@ -169,6 +178,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['apply_coupon'])) { } else { $error_message = 'Invalid coupon code.'; } + } } } diff --git a/modules/billing/forgot_password.php b/modules/billing/forgot_password.php index 5e64fc97..72ab11d7 100644 --- a/modules/billing/forgot_password.php +++ b/modules/billing/forgot_password.php @@ -6,6 +6,13 @@ session_start(); // Include database configuration require_once(__DIR__ . '/includes/config.inc.php'); +// Variables from config.inc.php (helps IDEs understand scope) +/** @var string $db_host Database host */ +/** @var string $db_user Database user */ +/** @var string $db_pass Database password */ +/** @var string $db_name Database name */ +/** @var string $table_prefix Table prefix for database tables */ + // Create database connection $db = mysqli_connect($db_host, $db_user, $db_pass, $db_name); if (!$db) { diff --git a/modules/billing/my_account.php b/modules/billing/my_account.php index 7432bc5e..4a5d4650 100644 --- a/modules/billing/my_account.php +++ b/modules/billing/my_account.php @@ -30,6 +30,13 @@ if (!$is_logged_in) { // Include database configuration require_once(__DIR__ . '/includes/config.inc.php'); +// Variables from config.inc.php (helps IDEs understand scope) +/** @var string $db_host Database host */ +/** @var string $db_user Database user */ +/** @var string $db_pass Database password */ +/** @var string $db_name Database name */ +/** @var string $table_prefix Table prefix for database tables */ + // Create database connection $db = mysqli_connect($db_host, $db_user, $db_pass, $db_name); if (!$db) { diff --git a/modules/billing/my_servers.php b/modules/billing/my_servers.php index 26502637..d5929b65 100644 --- a/modules/billing/my_servers.php +++ b/modules/billing/my_servers.php @@ -13,6 +13,13 @@ require_once(__DIR__ . '/includes/login_required.php'); // Include database configuration require_once(__DIR__ . '/includes/config.inc.php'); +// Variables from config.inc.php (helps IDEs understand scope) +/** @var string $db_host Database host */ +/** @var string $db_user Database user */ +/** @var string $db_pass Database password */ +/** @var string $db_name Database name */ +/** @var string $table_prefix Table prefix for database tables */ + // Create database connection $db = mysqli_connect($db_host, $db_user, $db_pass, $db_name); if (!$db) { diff --git a/modules/billing/renew_server.php b/modules/billing/renew_server.php index 005bf7c7..f175cd0f 100644 --- a/modules/billing/renew_server.php +++ b/modules/billing/renew_server.php @@ -11,6 +11,13 @@ require_once(__DIR__ . '/includes/config.inc.php'); require_once(__DIR__ . '/includes/login_required.php'); require_once(__DIR__ . '/includes/log.php'); +// Variables from config.inc.php (helps IDEs understand scope) +/** @var string $db_host Database host */ +/** @var string $db_user Database user */ +/** @var string $db_pass Database password */ +/** @var string $db_name Database name */ +/** @var string $table_prefix Table prefix for database tables */ + // Connect to DB (use mysqli like other website modules) $db = @mysqli_connect($db_host, $db_user, $db_pass, $db_name); if (!$db) { diff --git a/modules/billing/reset_password.php b/modules/billing/reset_password.php index 420107fa..2b80ca47 100644 --- a/modules/billing/reset_password.php +++ b/modules/billing/reset_password.php @@ -6,6 +6,13 @@ session_start(); // Include database configuration require_once(__DIR__ . '/includes/config.inc.php'); +// Variables from config.inc.php (helps IDEs understand scope) +/** @var string $db_host Database host */ +/** @var string $db_user Database user */ +/** @var string $db_pass Database password */ +/** @var string $db_name Database name */ +/** @var string $table_prefix Table prefix for database tables */ + // Create database connection $db = mysqli_connect($db_host, $db_user, $db_pass, $db_name); if (!$db) {