diff --git a/download.php b/download.php new file mode 100644 index 0000000..13fec7a --- /dev/null +++ b/download.php @@ -0,0 +1,907 @@ +connect_error) { + die("Connection failed: " . $mysqli->connect_error); +} + +// Function to get a setting value +function getSettingValue($mysqli, $setting) { + $query = $mysqli->prepare("SELECT value FROM tbl_appconfig WHERE setting = ?"); + $query->bind_param("s", $setting); + $query->execute(); + $result = $query->get_result(); + if ($row = $result->fetch_assoc()) { + return $row['value']; + } + return ''; +} + +// Fetch hotspot title and description from tbl_appconfig +$hotspotTitle = getSettingValue($mysqli, 'hotspot_title'); +$description = getSettingValue($mysqli, 'description'); +$phone = getSettingValue($mysqli, 'phone'); +$company = getSettingValue($mysqli, 'CompanyName'); + +// Fetch router name and router ID from tbl_appconfig +$routerName = getSettingValue($mysqli, 'router_name'); +$routerId = getSettingValue($mysqli, 'router_id'); + +// Fetch available plans + +$planQuery = "SELECT id, type, name_plan, price, validity, validity_unit FROM tbl_plans WHERE routers = ? AND type = 'Hotspot'"; +$planStmt = $mysqli->prepare($planQuery); +$planStmt->bind_param("s", $routerName); +$planStmt->execute(); +$planResult = $planStmt->get_result(); + + +$htmlContent = ""; +$htmlContent .= "\n"; +$htmlContent .= "\n"; +$htmlContent .= "
\n"; +$htmlContent .= " \n"; +$htmlContent .= " \n"; +$htmlContent .= "HOTSPOT LOGIN
\n"; +$htmlContent .= "\n"; +$htmlContent .= " Empowering businesses with reliable WiFi solutions and seamless connectivity across Kenya.\n"; +$htmlContent .= "
\n"; +$htmlContent .= "\n"; +$htmlContent .= " \n"; +$htmlContent .= " For any enquiries contact: $phone\n"; +$htmlContent .= "
\n"; +$htmlContent .= "Redeem your voucher for instant access
\n"; +$htmlContent .= " \n"; +$htmlContent .= "Select the perfect plan for your internet needs
\n"; +$htmlContent .= "Enter your M-Pesa transaction code to reconnect
\n"; +$htmlContent .= "Login with your account details
\n"; +$htmlContent .= "\n"; +$htmlContent .= " © " . date("Y") . " Billing System\n"; +$htmlContent .= "
\n"; +$htmlContent .= "