diff --git a/html/includes/graphs/customer/bits.inc.php b/html/includes/graphs/customer/bits.inc.php index 344d4fd916..64bd2e01ef 100644 --- a/html/includes/graphs/customer/bits.inc.php +++ b/html/includes/graphs/customer/bits.inc.php @@ -2,7 +2,7 @@ ## Generate a list of ports and then call the multi_bits grapher to generate from the list -$query = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE `ifAlias` LIKE 'Cust: ".mres($_GET['cust'])."%' AND D.device_id = I.device_id"); +$query = mysql_query("SELECT * FROM `ports` AS I, `devices` AS D WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = '".mres($_GET['id'])."' AND D.device_id = I.device_id"); while($int = mysql_fetch_array($query)) { if(is_file($config['rrd_dir'] . "/" . $int['hostname'] . "/" . safename($int['ifIndex'] . ".rrd"))) { $rrd_filenames[] = $config['rrd_dir'] . "/" . $int['hostname'] . "/" . safename($int['ifIndex'] . ".rrd"); diff --git a/html/includes/graphs/multiport/auth.inc.php b/html/includes/graphs/multiport/auth.inc.php new file mode 100644 index 0000000000..7a79bf4245 --- /dev/null +++ b/html/includes/graphs/multiport/auth.inc.php @@ -0,0 +1,16 @@ + diff --git a/html/includes/graphs/multi_bits.inc.php b/html/includes/graphs/multiport/bits.inc.php similarity index 76% rename from html/includes/graphs/multi_bits.inc.php rename to html/includes/graphs/multiport/bits.inc.php index 615ccd0e84..99e859f073 100644 --- a/html/includes/graphs/multi_bits.inc.php +++ b/html/includes/graphs/multiport/bits.inc.php @@ -1,11 +1,8 @@ diff --git a/html/includes/graphs/multi_bits_duo.inc.php b/html/includes/graphs/multiport/bits_duo.inc.php similarity index 100% rename from html/includes/graphs/multi_bits_duo.inc.php rename to html/includes/graphs/multiport/bits_duo.inc.php diff --git a/html/includes/graphs/multi_bits_separate.inc.php b/html/includes/graphs/multiport/bits_separate.inc.php similarity index 100% rename from html/includes/graphs/multi_bits_separate.inc.php rename to html/includes/graphs/multiport/bits_separate.inc.php diff --git a/html/includes/graphs/multi_bits_trio.inc.php b/html/includes/graphs/multiport/bits_trio.inc.php similarity index 100% rename from html/includes/graphs/multi_bits_trio.inc.php rename to html/includes/graphs/multiport/bits_trio.inc.php diff --git a/html/includes/print-interface.inc.php b/html/includes/print-interface.inc.php index 209baf9165..9954a13883 100644 --- a/html/includes/print-interface.inc.php +++ b/html/includes/print-interface.inc.php @@ -11,6 +11,8 @@ $if_id = $interface['interface_id']; +print_r($interface); + $interface = ifLabel($interface); if(!is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } diff --git a/html/pages/customers.inc.php b/html/pages/customers.inc.php index 0aa936d111..7ba965a16b 100644 --- a/html/pages/customers.inc.php +++ b/html/pages/customers.inc.php @@ -1,6 +1,6 @@ "); @@ -23,7 +23,7 @@ while($customer = mysql_fetch_array($cust_query)) { $i++; - $port_sql = "SELECT * FROM `ports` WHERE `port_descr_type` = 'Cust' AND `port_descr_descr` = '".$customer['port_descr_descr']."'"; + $port_sql = "SELECT * FROM `ports` WHERE `port_descr_type` = 'cust' AND `port_descr_descr` = '".$customer['port_descr_descr']."'"; $port_query = mysql_query($port_sql); $customer_name = $customer['port_descr_descr']; @@ -65,10 +65,10 @@ while($customer = mysql_fetch_array($cust_query)) { } echo(" - - - - + + + + "); diff --git a/html/pages/device/interface.inc.php b/html/pages/device/interface.inc.php index 91f6ca0c5b..a4fea523cc 100644 --- a/html/pages/device/interface.inc.php +++ b/html/pages/device/interface.inc.php @@ -3,7 +3,7 @@ if( !isset($_GET['optb']) ) { $_GET['optb'] = "graphs"; } $interface_query = mysql_query("select * from ports WHERE interface_id = '".$_GET['opta']."'"); -$interface = mysql_fetch_array($interface_query); +$interface = mysql_fetch_assoc($interface_query); $port_details = 1; diff --git a/html/pages/device/ports.inc.php b/html/pages/device/ports.inc.php index ae0644aba0..18f3e7defe 100644 --- a/html/pages/device/ports.inc.php +++ b/html/pages/device/ports.inc.php @@ -36,7 +36,7 @@ if($_GET['optc'] == thumbs) { $sql = "select * from ports WHERE device_id = '".$device['device_id']."' ORDER BY ifIndex"; $query = mysql_query($sql); unset ($seperator); - while($interface = mysql_fetch_array($query)) { + while($interface = mysql_fetch_assoc($query)) { echo("
".makeshortif($interface['ifDescr'])."
PortTrafficSync SpeedAttainable SpeedAttenuationSNR MarginOutput 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_array($interface_query)) { + while($interface = mysql_fetch_assoc($interface_query)) { include("includes/print-interface-adsl.inc.php"); $i++; } @@ -70,7 +70,7 @@ if($_GET['optc'] == thumbs) { echo("
"); $i = "1"; $interface_query = mysql_query("select * from ports WHERE device_id = '".$device['device_id']."' AND deleted = '0' ORDER BY `ifIndex` ASC"); - while($interface = mysql_fetch_array($interface_query)) { + while($interface = mysql_fetch_assoc($interface_query)) { include("includes/print-interface.inc.php"); $i++; } diff --git a/html/pages/iftype.inc.php b/html/pages/iftype.inc.php index 51f7122493..13b8c64e70 100644 --- a/html/pages/iftype.inc.php +++ b/html/pages/iftype.inc.php @@ -6,12 +6,13 @@ echo("
"); $type_where = " ("; foreach(split(",", $_GET['opta']) as $type) { - $type_where .= " $or `ifAlias` like '$type: %' "; + $type_where .= " $or `port_descr_type` = '$type' "; $or = "OR"; } $type_where .= ") "; - $sql = "select * from ports as I, devices as D WHERE $type_where AND I.device_id = D.device_id ORDER BY I.ifAlias"; + $sql = "SELECT * FROM `ports` as I, `devices` AS D WHERE $type_where AND I.device_id = D.device_id ORDER BY I.ifAlias"; + $query = mysql_query($sql); while($interface = mysql_fetch_array($query)) { $if_list .= $seperator . $interface['interface_id']; @@ -27,7 +28,7 @@ echo("
"); "); echo(""); @@ -43,7 +44,7 @@ echo("
Total Graph for ports of type : ".$types."
"); - $graph_type = "multi_bits"; + $graph_type = "multiport_bits"; $interface['interface_id'] = $if_list; include("includes/print-interface-graphs.inc.php"); echo("
"); $ifclass = ifclass($interface['ifOperStatus'], $interface['ifAdminStatus']); if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; } echo(" -
" . generateiflink($interface,$interface['ifAlias']) . "
+
" . generateiflink($interface,$interface['port_descr_descr']) . "
".generatedevicelink($interface)." ".generateiflink($interface)." "); if(mysql_result(mysql_query("SELECT count(*) FROM mac_accounting WHERE interface_id = '".$interface['interface_id']."'"),0)){