From 7b2f608355144f236afc3ea237128cd7d64976dc Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 May 2019 14:14:43 -0400 Subject: [PATCH] Added an API along with a an API key --- alerts.php | 13 +++++++++++- api.php | 49 ++++++++++++++++++++++++++++++++++++++++++++ config.php | 2 ++ post.php | 3 ++- settings-general.php | 12 ++++++++++- 5 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 api.php diff --git a/alerts.php b/alerts.php index 65e4f347..09f9de83 100644 --- a/alerts.php +++ b/alerts.php @@ -1,11 +1,22 @@ - + 0"; +}else{ + $where_clause = "= 0"; +} + +?> + +
Alerts
+ New + Archived
diff --git a/api.php b/api.php new file mode 100644 index 00000000..4df57743 --- /dev/null +++ b/api.php @@ -0,0 +1,49 @@ +"; + } + + } + + if(isset($_GET['client_emails'])){ + + $sql = mysqli_query($mysqli,"SELECT * FROM clients;"); + + while($row = mysqli_fetch_array($sql)){ + $client_name = $row['client_name']; + $client_email = $row['client_email']; + + echo "$client_name - $client_email
"; + } + + } +}else{ + echo "

Ma!! You've been BAAAAADDDDD!!

"; +} + +?> \ No newline at end of file diff --git a/config.php b/config.php index d60a14c9..48cd7a97 100644 --- a/config.php +++ b/config.php @@ -43,6 +43,8 @@ $config_mail_from_name = $row['config_mail_from_name']; $config_account_balance_threshold = $row['config_account_balance_threshold']; + $config_api_key = $row['config_api_key']; + $_SESSION['alert_message'] = ''; $_SESSION['alert_type'] = "warning"; diff --git a/post.php b/post.php index 30fd8736..f4cac3cb 100644 --- a/post.php +++ b/post.php @@ -19,8 +19,9 @@ if(isset($_POST['edit_general_settings'])){ $config_start_page = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_start_page'])); $config_account_balance_threshold = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_account_balance_threshold'])); + $config_api_key = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_api_key'])); - mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$config_start_page', config_account_balance_threshold = '$config_account_balance_threshold'"); + mysqli_query($mysqli,"UPDATE settings SET config_start_page = '$config_start_page', config_account_balance_threshold = '$config_account_balance_threshold', config_api_key = '$config_api_key'"); header("Location: " . $_SERVER["HTTP_REFERER"]); diff --git a/settings-general.php b/settings-general.php index 4b0203e7..c544a5bc 100644 --- a/settings-general.php +++ b/settings-general.php @@ -23,7 +23,7 @@
-
+
@@ -32,6 +32,16 @@
+ +
+ +
+
+ +
+ +
+