From 19787642b8dc3feba2034ec75ed97fe6f0176849 Mon Sep 17 00:00:00 2001 From: NaysKutzu Date: Sat, 18 Nov 2023 19:04:01 +0000 Subject: [PATCH] PUSH -> Now settings work? --- view/admin/settings/ads.php | 8 +++----- view/admin/settings/customcss.php | 4 ++-- view/admin/settings/customhead.php | 4 ++-- view/admin/settings/discord.php | 6 +++--- view/admin/settings/general.php | 4 ++-- view/admin/settings/linkvertise.php | 6 +++--- view/admin/settings/mail.php | 6 +++--- view/admin/settings/pp.php | 6 +++--- view/admin/settings/pterodactyl.php | 6 +++--- view/admin/settings/purge.php | 4 ++-- view/admin/settings/recaptcha.php | 6 +++--- view/admin/settings/resources.php | 6 +++--- view/admin/settings/security.php | 2 +- view/admin/settings/seo.php | 6 +++--- view/admin/settings/store.php | 6 +++--- view/admin/settings/stripe.php | 6 +++--- view/admin/settings/tos.php | 13 +++++++------ 17 files changed, 49 insertions(+), 50 deletions(-) diff --git a/view/admin/settings/ads.php b/view/admin/settings/ads.php index da68a025..05c2e360 100644 --- a/view/admin/settings/ads.php +++ b/view/admin/settings/ads.php @@ -6,19 +6,17 @@ if (isset($_GET['update_settings'])) { $enable_ads = mysqli_real_escape_string($conn, $_GET['ads:enabled']); $ads_code = mysqli_real_escape_string($conn, $_GET['ads:code']); - $enable_adblocker_detection = mysqli_real_escape_string($conn, $_GET['ads:adblocker']); mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `enable_ads` = '" . $enable_ads . "' WHERE `mythicaldash_settings`.`id` = 1;"); - mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `enable_ads` = '" . $enable_ads . "' WHERE `mythicaldash_settings`.`id` = 1;"); - mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `enable_adblocker_detection` = '" . $enable_adblocker_detection . "' WHERE `mythicaldash_settings`.`id` = 1;"); + mysqli_query($conn, "UPDATE `mythicaldash_settings` SET `ads_code` = '" . $ads_code . "' WHERE `mythicaldash_settings`.`id` = 1;"); header('location: /admin/settings?s=We updated the settings inside the database'); $conn->close(); die(); } else { - header('location: /admin/settings'); + header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } diff --git a/view/admin/settings/customcss.php b/view/admin/settings/customcss.php index a1bb9593..30ab130c 100644 --- a/view/admin/settings/customcss.php +++ b/view/admin/settings/customcss.php @@ -12,11 +12,11 @@ $conn->close(); die(); } else { - header('location: /admin/settings'); + header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } diff --git a/view/admin/settings/customhead.php b/view/admin/settings/customhead.php index dfefafd3..aecd1c29 100644 --- a/view/admin/settings/customhead.php +++ b/view/admin/settings/customhead.php @@ -13,11 +13,11 @@ $conn->close(); die(); } else { - header('location: /admin/settings'); + header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } diff --git a/view/admin/settings/discord.php b/view/admin/settings/discord.php index f4188110..63f08b33 100644 --- a/view/admin/settings/discord.php +++ b/view/admin/settings/discord.php @@ -20,11 +20,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/general.php b/view/admin/settings/general.php index cfb441dc..58223ae4 100644 --- a/view/admin/settings/general.php +++ b/view/admin/settings/general.php @@ -12,11 +12,11 @@ $conn->close(); die(); } else { - header('location: /admin/settings'); + header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } diff --git a/view/admin/settings/linkvertise.php b/view/admin/settings/linkvertise.php index f065d960..ef7f224b 100644 --- a/view/admin/settings/linkvertise.php +++ b/view/admin/settings/linkvertise.php @@ -15,11 +15,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/mail.php b/view/admin/settings/mail.php index 10720c14..5ce562e7 100644 --- a/view/admin/settings/mail.php +++ b/view/admin/settings/mail.php @@ -22,11 +22,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/pp.php b/view/admin/settings/pp.php index e7690ab2..2da27729 100644 --- a/view/admin/settings/pp.php +++ b/view/admin/settings/pp.php @@ -10,11 +10,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/pterodactyl.php b/view/admin/settings/pterodactyl.php index 2b27d751..e2404ae0 100644 --- a/view/admin/settings/pterodactyl.php +++ b/view/admin/settings/pterodactyl.php @@ -12,11 +12,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/purge.php b/view/admin/settings/purge.php index cccc4435..5eb991ad 100644 --- a/view/admin/settings/purge.php +++ b/view/admin/settings/purge.php @@ -16,11 +16,11 @@ header('location: /admin/settings?s=We updated the settings inside the database'); die(); } else { - header('location: /admin/settings'); + header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } diff --git a/view/admin/settings/recaptcha.php b/view/admin/settings/recaptcha.php index 9f79212e..6be54917 100644 --- a/view/admin/settings/recaptcha.php +++ b/view/admin/settings/recaptcha.php @@ -15,11 +15,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/resources.php b/view/admin/settings/resources.php index a1765402..cf30da19 100644 --- a/view/admin/settings/resources.php +++ b/view/admin/settings/resources.php @@ -28,11 +28,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/security.php b/view/admin/settings/security.php index 0c125af3..6abf4033 100644 --- a/view/admin/settings/security.php +++ b/view/admin/settings/security.php @@ -18,7 +18,7 @@ die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die(); } diff --git a/view/admin/settings/seo.php b/view/admin/settings/seo.php index e35b1af8..76da2346 100644 --- a/view/admin/settings/seo.php +++ b/view/admin/settings/seo.php @@ -12,11 +12,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/store.php b/view/admin/settings/store.php index 8ecaa1fd..cf2b032b 100644 --- a/view/admin/settings/store.php +++ b/view/admin/settings/store.php @@ -22,11 +22,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/stripe.php b/view/admin/settings/stripe.php index 93013880..dc252f4a 100644 --- a/view/admin/settings/stripe.php +++ b/view/admin/settings/stripe.php @@ -19,11 +19,11 @@ $conn->close(); die (); } else { - header('location: /admin/settings'); - die (); + header('location: /admin/settings?e=Failed to update the settings inside the database'); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ",$ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); die (); } diff --git a/view/admin/settings/tos.php b/view/admin/settings/tos.php index a03cc290..5667b0a5 100644 --- a/view/admin/settings/tos.php +++ b/view/admin/settings/tos.php @@ -1,21 +1,22 @@ close(); - die (); + die(); } else { header('location: /admin/settings?e=Failed to update the settings inside the database'); - die (); + die(); } } catch (Exception $ex) { - ErrorHandler::Critical("Failed to update settings ",$e); + ErrorHandler::Critical("Failed to update settings ", $ex); header('location: /admin/settings?e=Failed to update the settings inside the database'); - die (); + die(); } ?> \ No newline at end of file