From: Brian Flowers Date: Tue, 27 Sep 2016 05:16:32 +0000 (-0400) Subject: Adding configuration display X-Git-Url: http://git.slightlycyberpunk.com%2C%20git.slightlycyberpunk.com/git/?a=commitdiff_plain;h=aac84db5268ad89d80e64e34e6fe40f65e989dae;p=bdsm-web.git Adding configuration display --- diff --git a/configure.php b/configure.php index 562183c..34e2d31 100755 --- a/configure.php +++ b/configure.php @@ -1,3 +1,6 @@ +// /home/bdsm must be bdsm:www-root 775 +// /home/bdsm/bdsm.sqlite3* must be bdsm:www-root 775 + query("SELECT * FROM bdsmweb"); @@ -6,7 +9,7 @@ if( $db->errorInfo()[0] == "HY000" ) { $query = "CREATE TABLE bdsmweb (host VARCHAR(128) primary key,". "attribute VARCHAR(128), name VARCHAR(128), ". - "graph integer, maximum integer, minimim integer, ". + "graph integer, maximum integer, minimum integer, ". "duration integer);"; $db->query($query); @@ -18,7 +21,7 @@ if( isset($_POST) ) foreach( array_keys($_POST) as $key ) { $id = explode("|", $key); - $host = $id[0]; + $host = str_replace("_", ".", $id[0]); $attribute = $id[1]; $setting = $id[2]; $value = $_POST[$key]; @@ -132,17 +135,19 @@ foreach ($hosts as $host) $attributes = Array(); while($attribute = $result->fetch()) if ( $attribute['attribute'] ) - array_push($attributes, $attribute['attribute']); + array_push($attributes, $attribute['attribute']); foreach($attributes as $attribute) { + $result = $db->query("SELECT * FROM bdsmweb WHERE host='$host' AND attribute='$attribute'"); + $values = $result->fetch(); echo " "; echo " $attribute"; - echo " "; - echo " "; - echo " - ". - ""; - echo " "; + echo " "; + echo " "; + echo " - ". + ""; + echo " "; echo " "; } echo "";