git-svn-id: http://www.observium.org/svn/observer/trunk@2317 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-05-14 21:51:58 +00:00
parent 5cda569ca7
commit 7e16919426
8 changed files with 183 additions and 100 deletions
+5 -5
View File
@@ -35,16 +35,16 @@ echo("<div style='margin: 5px;'><table cellpadding=7 border=0 cellspacing=0 widt
if ($_SESSION['userlevel'] >= '5')
{
$host_sql = "SELECT * FROM devices AS D, services AS S WHERE D.device_id = S.device_id GROUP BY D.hostname ORDER BY D.hostname";
$host_par = array();
} else {
$host_sql = "SELECT * FROM devices AS D, services AS S, devices_perms AS P WHERE D.device_id = S.device_id AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' $where GROUP BY D.hostname ORDER BY D.hostname";
$host_sql = "SELECT * FROM devices AS D, services AS S, devices_perms AS P WHERE D.device_id = S.device_id AND D.device_id = P.device_id AND P.user_id = ? GROUP BY D.hostname ORDER BY D.hostname";
$host_par = array($_SESSION['user_id']);
}
$host_query = mysql_query($host_sql);
while ($host_data = mysql_fetch_assoc($host_query))
foreach (dbFetchRows($host_sql, $host_par) as $host_data)
{
$device_id = $host_data['device_id'];
$device_hostname = $host_data['hostname'];
$service_query = mysql_query("SELECT * FROM `services` WHERE `device_id` = '" . $host_data['device_id'] . "' $where");
while ($service = mysql_fetch_assoc($service_query))
foreach (dbFetchRows("SELECT * FROM `services` WHERE `device_id` = ?", array($host_data['device_id'])) as $service)
{
include("includes/print-service.inc.php");
# $samehost = 1;