From dfe1d0d2db478839cb6c8c768ad487abe98f807f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Oct 2025 01:35:14 +0000 Subject: [PATCH] Remove db.php and add navigation menu to all pages Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- _website/adminserverlist.php | 45 ++++++++++++++++----------- _website/cart.php | 28 +++++++++++++++-- _website/db.php | 39 ----------------------- _website/includes/menu.php | 55 +++++++++++++++++++++++++++++++++ _website/index.php | 28 +---------------- _website/login.php | 21 +++++++++++-- _website/logout.php | 6 ++-- _website/order.php | 27 +++++++++++++++- _website/serverlist.php | 29 ++++++++++++++--- _website/test_db_connection.php | 10 ++++-- 10 files changed, 190 insertions(+), 98 deletions(-) delete mode 100644 _website/db.php create mode 100644 _website/includes/menu.php diff --git a/_website/adminserverlist.php b/_website/adminserverlist.php index 37df8609..1126a8a9 100644 --- a/_website/adminserverlist.php +++ b/_website/adminserverlist.php @@ -1,29 +1,32 @@ + + +
+ + +$db must be a mysqli connection (check panel/_db.php).
- ';
- return;
+// Create database connection
+$db = mysqli_connect($db_host, $db_user, $db_pass, $db_name);
+if (!$db) {
+ die("Connection failed: " . mysqli_connect_error());
}
+
+// Include menu
+include(__DIR__ . '/includes/menu.php');
+
+/* show errors during setup */
+@ini_set('display_errors','1');
+error_reporting(E_ALL);
function h($s){ return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }
function esc_mysqli($db, $v){ return $db->real_escape_string($v); }
function fetch_all_assoc($db, $sql){
@@ -318,3 +321,9 @@ document.querySelectorAll('.locs-box').forEach(function(box){
});
+
+
+
diff --git a/_website/cart.php b/_website/cart.php
index e7acf3df..7737519b 100644
--- a/_website/cart.php
+++ b/_website/cart.php
@@ -1,17 +1,35 @@
+
+
+
+
+
+