0) { $filter .= ' and building_id=?'; $params[]=$f_building_id; } if ($f_devtype_id >= 0) { $filter .= ' and device_type=?'; $params[]=$f_devtype_id; } else { $filter .= ' and device_type<=2'; } if ($f_devmodel_id > 0) { $filter .= ' and device_model_id=?'; $params[]= $f_devmodel_id; } #$countSQL = "SELECT COUNT(*) FROM devices D #LEFT JOIN device_models DM ON D.device_model_id = DM.id #LEFT JOIN building B ON D.building_id = B.id #WHERE D.deleted = 0 $filter"; #$count_records = get_single_field($db_link, $countSQL, $params); #$total=ceil($count_records/$displayed); #if ($page>$total) { $page=$total; } #if ($page<1) { $page=1; } #$start = ($page * $displayed) - $displayed; #print_navigation($page_url,$page,$displayed,$count_records,$total); $sort_sql=" ORDER BY device_name"; if (!empty($sort_field) and !empty($order)) { $sort_sql = " ORDER BY $sort_field $order"; } $dSQL = 'SELECT D.*, DM.model_name, B.name AS building_name FROM devices D LEFT JOIN device_models DM ON D.device_model_id = DM.id LEFT JOIN building B ON D.building_id = B.id WHERE D.deleted = 0 ' . $filter . ' ' . $sort_sql; $switches = get_records_sql($db_link,$dSQL, $params); foreach ($switches as $row) { print "\n"; $cl = "data"; if (isset($row['nagios_status'])) { $cl = 'shutdown'; if ($row['nagios_status'] == 'UP') { $cl = 'up'; } } print "\n"; print "\n"; print "\n"; if (isset($row['user_id']) and $row['user_id']>0) { print "\n"; } else { print "\n"; } print "\n"; print '\n"; print "\n"; print "\n"; print "\n"; print "\n"; } ?>
> > > > >
".get_devtype_name($db_link,$row['device_type'])."" . $row['device_name'] . "".$row['ip']."".$row['ip']."" . get_vendor_name($db_link, $row['vendor_id']) . " " . $row['model_name'] . "' . $row['sn'] ."" . get_building($db_link, $row['building_id']); if (!empty($row['description'])) { print '
' . $row['description']; } print "
" . $row['port_count'] . "" . get_qa($row['nagios']) . "" . get_qa($row['discovery']) . "