diff --git a/html/pages/device/apps.inc.php b/html/pages/device/apps.inc.php index 5200d7870d..c65369f5c2 100644 --- a/html/pages/device/apps.inc.php +++ b/html/pages/device/apps.inc.php @@ -1,12 +1,10 @@ "); } - echo("" . htmlspecialchars($type) ."\n"); - if ($_GET['opta'] == $type) { echo(""); } - $sep = ' | '; -} - -unset ($sep); - -print_optionbar_end(); - -$query = mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$device['device_id']."' and entSensorType = '".$_GET['opta']."' ORDER BY `entPhysicalName`"); -while ($data = mysql_fetch_assoc($query)) -{ - if ($data['entSensorMeasuredEntity']) - { - $measured = mysql_fetch_assoc(mysql_query("SELECT * FROM entPhysical WHERE device_id = '".$device['device_id']."' AND entPhysicalIndex = '".$data['entSensorMeasuredEntity']."'")); - } - - echo("

".$measured['entPhysicalName']." ".$data['entPhysicalName']."

"); - $graph_type = "cisco_entity_sensor"; - $args = "&a=".$data['entPhysical_id']; - - include("includes/print-device-graph.php"); - - echo("
"); -} - -?> \ No newline at end of file diff --git a/html/pages/device/entphysical.inc.php b/html/pages/device/entphysical.inc.php index ea32ae863e..b180050e6f 100644 --- a/html/pages/device/entphysical.inc.php +++ b/html/pages/device/entphysical.inc.php @@ -4,8 +4,8 @@ function printEntPhysical($ent, $level, $class) { global $device; - $query = mysql_query("SELECT * FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entPhysicalContainedIn = '".$ent."' ORDER BY entPhysicalContainedIn,entPhysicalIndex"); - while ($ent = mysql_fetch_assoc($query)) + $ents = dbFetchRows("SELECT * FROM `entPhysical` WHERE device_id = ? AND entPhysicalContainedIn = ? ORDER BY entPhysicalContainedIn,entPhysicalIndex", array($device['device_id'], $ent)); + foreach ($ents as $ent) { echo("
  • "); @@ -28,7 +28,7 @@ function printEntPhysical($ent, $level, $class) if ($ent['ifIndex']) { - $interface = mysql_fetch_assoc(mysql_query("SELECT * FROM `ports` WHERE ifIndex = '".$ent['ifIndex']."' AND device_id = '".$device['device_id']."'")); + $interface = dbFetchRow("SELECT * FROM `ports` WHERE ifIndex = ? AND device_id = ?", array($ent['ifIndex'], $device['device_id'])); $ent['entPhysicalName'] = generate_port_link($interface); } @@ -61,7 +61,7 @@ function printEntPhysical($ent, $level, $class) echo(""); - $count = mysql_result(mysql_query("SELECT COUNT(*) FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entPhysicalContainedIn = '".$ent['entPhysicalIndex']."'"),0); + $count = dbFetchCell("SELECT COUNT(*) FROM `entPhysical` WHERE device_id = '".$device['device_id']."' AND entPhysicalContainedIn = '".$ent['entPhysicalIndex']."'"); if ($count) { echo("