Bugfixes in configure
authorBrian Flowers <git-admn@bsflowers.net>
Thu, 22 Sep 2016 17:09:33 +0000 (13:09 -0400)
committerBrian Flowers <git-admn@bsflowers.net>
Thu, 22 Sep 2016 17:09:33 +0000 (13:09 -0400)
configure.php

index aad32ee..ef6d0c8 100755 (executable)
@@ -63,21 +63,25 @@ while($host = $result->fetchArray(SQLITE3_ASSOC))
 
 foreach ($hosts as $host)
 {
-    echo "      <tr><th>$host</th></tr>";
+    echo "      <tr><th>$host</th>";
+    echo "<td><input type='submit' value='Update $host' /></td></tr>";
     $result = $db_handle->query("SELECT DISTINCT attribute FROM MEASUREMENTS WHERE host='$host'");
     $attributes = Array();
     while($attribute = $result->fetchArray(SQLITE3_ASSOC))
       if ( $attribute['attribute'] )
         array_push($attributes, $attribute['attribute']);
     
-    echo "      <tr>";
-    echo "        <td>$attribute</td>";
-    echo "        <td><input type='text' name='$host-$attribute-name' value='' /></td>";
-    echo "        <td><input type='checkbox' name='$host-$attribute-graph' /></td>";
-    echo "        <td><input type='text' name='$host-$attribute-min' value='' />".
-                  ."<input type='text' name='$host-$attribute-max' value='' /></td>";
-    echo "        <td><input type='text' name='$host-$attribute-duration' value='' /></td>";
-    echo "      </tr>";
+    foreach($attributes as $attribute)
+    {
+      echo "      <tr>";
+      echo "        <td>$attribute</td>";
+      echo "        <td><input type='text' name='$host-$attribute-name' value='' /></td>";
+      echo "        <td><input type='checkbox' name='$host-$attribute-graph' /></td>";
+      echo "        <td><input type='text' name='$host-$attribute-min' value='' />".
+                    "<input type='text' name='$host-$attribute-max' value='' /></td>";
+      echo "        <td><input type='text' name='$host-$attribute-duration' value='' /></td>";
+      echo "      </tr>";
+    }
 }
 ?>
     </table>