'locations', 'view' => $type]); $navbar['options'][$type]['text'] = ucfirst($type); } print_navbar($navbar); unset($navbar); echo generate_box_open(); echo('' . PHP_EOL); //$location_where = generate_query_values_and($vars['location'], 'location'); $cols = [ [NULL, 'class="state-marker"'], 'location' => ['Location', 'style="width: 300px;"'], 'total' => ['Devices: Total', 'style="width: 50px; text-align: right;"'] ]; foreach (array_keys($cache['devices']['types']) as $type) { $cols[$type] = [nicecase($type), 'style="width: 40px;"']; } echo get_table_header($cols); //, $vars); // Currently sorting is not available echo('' . PHP_EOL); foreach ($cache['devices']['types'] as $type => $type_data) { echo('' . PHP_EOL); } echo(' '); foreach (get_locations() as $location) { $location_where = generate_where_clause($GLOBALS['cache']['where']['devices_permitted'], generate_query_values($location, 'location')); $num = dbFetchCell('SELECT COUNT(*) FROM `devices`' . $location_where); $hostalerts = dbFetchCell('SELECT COUNT(*) FROM `devices`' . $location_where . ' AND `status` = ?', [0]); if ($hostalerts) { $row_class = 'error'; } else { $row_class = ''; } if ($location === '') { $location = OBS_VAR_UNSET; } $value = var_encode($location); echo('' . PHP_EOL); foreach (array_keys($cache['devices']['types']) as $type) { $location_count = dbFetchCell('SELECT COUNT(*) FROM `devices`' . $location_where . ' AND `type` = ?', [$type]); if ($location_count > 0) { $location_count = '' . $location_count . ''; } echo('' . PHP_EOL); } echo(' '); if ($vars['view'] == 'traffic') { echo(''); } $done = 'yes'; } echo('
ALL ' . $devices['count'] . '' . $type_data['count'] . '
' . generate_link($location, ['page' => 'devices', 'location' => $value]) . ' ' . $num . '' . $location_count . '
'); $graph_array['type'] = 'location_bits'; $graph_array['height'] = 100; $graph_array['width'] = 220; $graph_array['to'] = get_time(); $graph_array['legend'] = 'no'; $graph_array['id'] = $value; print_graph_row($graph_array); echo('
'); echo generate_box_close(); // EOF