");
+ echo("
");
$sql = "select * from ports WHERE device_id = '".$device['device_id']."' ORDER BY ifIndex";
$query = mysql_query($sql);
unset ($seperator);
@@ -75,22 +76,9 @@ if ($_GET['optc'] == thumbs)
}
echo("
");
} else {
- if ($_GET['opta'] == "arp")
+ if ($_GET['opta'] == "arp" || $_GET['opta'] == "adsl" || $_GET['opta'] == "neighbours")
{
- include("arp.inc.php");
- } elseif ($_GET['opta'] == "adsl") {
- echo("
");
-
- echo("Port | Traffic | Sync Speed | Attainable Speed | Attenuation | SNR Margin | Output Powers |
");
- $i = "0";
- $interface_query = mysql_query("select * from `ports` AS P, `ports_adsl` AS A WHERE P.device_id = '".$device['device_id']."' AND A.interface_id = P.interface_id AND P.deleted = '0' ORDER BY `ifIndex` ASC");
- while ($interface = mysql_fetch_assoc($interface_query))
- {
- include("includes/print-interface-adsl.inc.php");
- $i++;
- }
- echo("
");
- echo("
");
+ include("ports/".$_GET['opta'].".inc.php");
} else {
if ($_GET['opta'] == "details") { $port_details = 1; }
echo("
");
@@ -102,7 +90,6 @@ if ($_GET['optc'] == thumbs)
$i++;
}
echo("
");
- echo("
");
}
}
diff --git a/html/pages/device/arp.inc.php b/html/pages/device/ports/arp.inc.php
similarity index 100%
rename from html/pages/device/arp.inc.php
rename to html/pages/device/ports/arp.inc.php
diff --git a/html/pages/device/ports/neighbours.inc.php b/html/pages/device/ports/neighbours.inc.php
new file mode 100644
index 0000000000..37cb0e24bd
--- /dev/null
+++ b/html/pages/device/ports/neighbours.inc.php
@@ -0,0 +1,40 @@
+
+
+$sql = "SELECT * FROM links AS L, ports AS I WHERE I.device_id = '".$device['device_id']."' AND I.interface_id = L.local_interface_id";
+$query = mysql_query($sql);
+
+echo('
');
+
+$i = "1";
+
+echo('Local Port |
+ Remote Port |
+ Remote Device |
+ |
+
');
+
+while($neighbour = mysql_fetch_assoc($query))
+{
+
+ if ($bg_colour == $list_colour_b) { $bg_colour = $list_colour_a; } else { $bg_colour = $list_colour_b; }
+
+ echo('');
+ echo("".generate_port_link($neighbour)." ".$neighbour['ifAlias']." | ");
+
+ if(is_numeric($neighbour['remote_interface_id']) && $neighbour['remote_interface_id'])
+ {
+ $remote_port = get_port_by_id($neighbour['remote_interface_id']);
+ $remote_device = device_by_id_cache($remote_port['device_id']);
+ echo("".generate_port_link($remote_port)." ".$remote_port['ifAlias']." | ");
+ echo("".generate_device_link($remote_device)." ".$remote_device['hardware']." | ");
+ } else {
+ echo("".$neighbour['remote_port']." | ");
+ echo("".$neighbour['remote_hostname']."
+ ".$neighbour['remote_platform']." | ");
+ }
+ $i++;
+}
+
+echo("
");
+
+?>