From 7807653e1ece081283f118a0a911a2c0c353fa21 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 14 Sep 2018 12:25:10 +0200 Subject: [PATCH] Fixed tabs --- config.php | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/config.php b/config.php index 2af910b..0980c66 100644 --- a/config.php +++ b/config.php @@ -28,15 +28,15 @@ require_once "include/initialize.inc.php"; if ($_SERVER["REQUEST_METHOD"] == "GET") { - $message = ""; - if (isset($_GET["message"])) { - switch ($_GET["message"]) { - case "edited": - $message = "The config has been edited"; break; - } - } - - $error = ""; + $message = ""; + if (isset($_GET["message"])) { + switch ($_GET["message"]) { + case "edited": + $message = "The config has been edited"; break; + } + } + + $error = ""; if (isset($_GET["error"])) { switch ($_GET["error"]) { case "emptyfields": @@ -45,28 +45,28 @@ if ($_SERVER["REQUEST_METHOD"] == "GET") { } - $loader = new Twig_Loader_Filesystem('templates'); - $twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)); + $loader = new Twig_Loader_Filesystem('templates'); + $twig = new Twig_Environment($loader, array('cache' => 'cache', "debug" => true)); - $configs = load_config_categorized(); + $configs = load_config_categorized(); - $twig_vars = array('config' => $configs, "error" => $error, "message" => $message); + $twig_vars = array('config' => $configs, "error" => $error, "message" => $message); - echo $twig->render('config.html.twig', $twig_vars); + echo $twig->render('config.html.twig', $twig_vars); } elseif ($_SERVER["REQUEST_METHOD"] == "POST") { - foreach($_POST as $key => $value) { - if (empty($value)) { - header("location:config.php?error=emptyfields"); exit; - } + foreach($_POST as $key => $value) { + if (empty($value)) { + header("location:config.php?error=emptyfields"); exit; + } - $keydb = str_replace('_', '.', $key); - $stmt = $db->prepare("UPDATE config SET value = ? WHERE conf = ?"); - $stmt->execute(array($value, $keydb)); - } + $keydb = str_replace('_', '.', $key); + $stmt = $db->prepare("UPDATE config SET value = ? WHERE conf = ?"); + $stmt->execute(array($value, $keydb)); + } - header("location:config.php?message=edited"); + header("location:config.php?message=edited"); exit; }