mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-11-23 20:58:46 -05:00
This file is functional now
This commit is contained in:
parent
dc1cf2691c
commit
6858223daf
@ -15,22 +15,42 @@ else{
|
|||||||
require_once("../classes/db-class.php");
|
require_once("../classes/db-class.php");
|
||||||
}
|
}
|
||||||
$db = new SSDB();
|
$db = new SSDB();
|
||||||
define("NAME", $db->getSetting($mysqli,"name"));
|
if(trim($db->getSetting($mysqli,"notifyUpdates")) == "yes"){
|
||||||
define("TITLE", $db->getSetting($mysqli,"title"));
|
$notifyUpdates_status = true;
|
||||||
define("WEB_URL", $db->getSetting($mysqli,"url"));
|
} else {
|
||||||
define("MAILER_NAME", $db->getSetting($mysqli,"mailer"));
|
$notifyUpdates_status = false;
|
||||||
define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email"));
|
}
|
||||||
$set_post = false;
|
$set_post = false;
|
||||||
if(isset($_POST)){
|
if(!empty($_POST)){
|
||||||
|
if($_POST["nu_toggle"] == "on"){ $nu_toggle = "yes"; } else { $nu_toggle = "no"; }
|
||||||
$set_post = true;
|
$db->deleteSetting($mysqli,"notifyUpdates");
|
||||||
|
$db->setSetting($mysqli,"notifyUpdates",$nu_toggle);
|
||||||
|
$db->deleteSetting($mysqli,"name");
|
||||||
|
$db->setSetting($mysqli,"name",$_POST["sitename"]);
|
||||||
|
$set_post = true;
|
||||||
|
if($nu_toggle == "yes"){
|
||||||
|
$notifyUpdates_status = true;
|
||||||
|
} else {
|
||||||
|
$notifyUpdates_status = false;
|
||||||
|
}
|
||||||
|
define("NAME", $db->getSetting($mysqli,"name"));
|
||||||
|
define("TITLE", $db->getSetting($mysqli,"title"));
|
||||||
|
define("WEB_URL", $db->getSetting($mysqli,"url"));
|
||||||
|
define("MAILER_NAME", $db->getSetting($mysqli,"mailer"));
|
||||||
|
define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email"));
|
||||||
}
|
}
|
||||||
Template::render_header(_("Options"), true);
|
Template::render_header(_("Options"), true);
|
||||||
?>
|
?>
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
<h2><?php if($set_post){ "Settings Saved"; } else { echo "Server Status Options"; } ?></h2>
|
<h2><?php if($set_post){ echo "Settings Saved"; } else { echo "Server Status Options"; } ?></h2>
|
||||||
</div>
|
</div>
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<?php Template::render_toggle("Toggle Title","togglename"); ?>
|
<?php Template::render_toggle("Notify Updates","nu_toggle",$notifyUpdates_status); ?>
|
||||||
<button class="btn btn-primary pull-right" type="submit">Save Settings</button>
|
<div class="input-group mb-3">
|
||||||
|
<div class="input-group-prepend">
|
||||||
|
<span class="input-group-text" id="basic-addon1">Site Name</span>
|
||||||
|
</div>
|
||||||
|
<input type="text" class="form-control" placeholder="" aria-label="Username" aria-describedby="basic-addon1" name="sitename" value="<?php echo NAME; ?>">
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-primary pull-right" type="submit">Save Settings</button>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
Reference in New Issue
Block a user