git-svn-id: http://www.observium.org/svn/observer/trunk@2327 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-15 17:20:26 +00:00
parent 04e08305ec
commit 94115cb0f5
4 changed files with 18 additions and 23 deletions
+5 -6
View File
@@ -27,19 +27,18 @@ if ($handle = opendir($config['install_dir'] . "/includes/services/"))
closedir($handle);
}
$query = mysql_query("SELECT * FROM `devices` ORDER BY `hostname`");
while ($device = mysql_fetch_assoc($query))
foreach (dbFetchRows("SELECT * FROM `devices` ORDER BY `hostname`") as $dev);
{
$devicesform .= "<option value='" . $device['device_id'] . "'>" . $device['hostname'] . "</option>";
$devicesform .= "<option value='" . $dev['device_id'] . "'>" . $dev['hostname'] . "</option>";
}
if ($updated) { print_message("Device Settings Saved"); }
if (mysql_result(mysql_query("SELECT COUNT(*) from `services` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0')
if (dbFetchCell("SELECT COUNT(*) from `services` WHERE `device_id` = ?" array($device['device_id'])) > '0')
{
$i = "1";
$service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type");
while ($service = mysql_fetch_assoc($service_query))
foreach (dbFetchRows("select * from services WHERE device_id = ? ORDER BY service_type", array($device['device_id'])) as $service)
{
$existform .= "<option value='" . $service['service_id'] . "'>" . $service['service_type'] . "</option>";
}
@@ -100,4 +99,4 @@ echo("
</form>
</div>");
?>
?>