mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
create common method for generating type_wheres
This commit is contained in:
@ -495,19 +495,10 @@ 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;
|
||||
}
|
||||
|
||||
$type_where .= ') ';
|
||||
$ports = get_ports_from_type(explode(',', $group));
|
||||
$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 = ',';
|
||||
|
Reference in New Issue
Block a user