<th>Graph Range (values)</th>
<th>Graph Duration (seconds)</th>
</tr>
- <tr><th>www.slightlycyberpunk.com</th></tr>
- <tr>
- <td>CPU-US</td>
- <td><input type="text" value="User CPU" /></td>
- </tr>
+<?php
+$db_handle = new SQLite3("/home/bdsm/bdsm.sqlite3");
+$result = $db_handle->query("SELECT DISTINCT host FROM MEASUREMENTS");
+
+$hosts = Array();
+while($host = $result->fetchArray(SQLITE3_ASSOC))
+ if ( $host['host'] )
+ array_push($hosts, $host['host']);
+
+foreach ($hosts as $host)
+{
+ echo " <tr><th>$host</th></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>";
+}
+?>
</table>
</BODY>
</HTML>