Revert "deduping type_where code, adding manual types to graph widgets "

This commit is contained in:
Neil Lathwood
2016-06-07 09:15:04 +01:00
parent db6ccf1404
commit 5cb9d751c3
5 changed files with 59 additions and 76 deletions

View File

@@ -495,10 +495,19 @@ function get_graph_by_portgroup() {
$vars['width'] = $_GET['width'] ?: 1075;
$vars['height'] = $_GET['height'] ?: 300;
$auth = '1';
$type_where = ' (';
$or = '';
$type_param = array();
foreach (explode(',', $group) as $type) {
$type_where .= " $or `port_descr_type` = ?";
$or = 'OR';
$type_param[] = $type;
}
$ports = get_ports_from_type(explode(',', $group));
$type_where .= ') ';
$if_list = '';
$seperator = '';
$ports = dbFetchRows("SELECT * FROM `ports` as I, `devices` AS D WHERE $type_where AND I.device_id = D.device_id ORDER BY I.ifAlias", $type_param);
foreach ($ports as $port) {
$if_list .= $seperator.$port['port_id'];
$seperator = ',';