%d AND utimestamp < %d %s GROUP BY %s ORDER BY %s DESC LIMIT %d', $field_to_group, $start, $end, $filter_sql, $field_to_group, $field_to_order, $top ); $data = db_get_all_rows_sql($sql); return ($data !== false) ? $data : []; } /** * Get the possible actions on networking. * * @param boolean $network True if network. False if netflow. * * @return array With the actions to print in a select. */ function network_get_report_actions($network) { $common_actions = [ 'listeners' => __('Top listeners'), 'talkers' => __('Top talkers'), ]; if ($network) { return $common_actions; } return array_merge( $common_actions, [ 'tcp' => __('Top TCP protocols'), 'udp' => __('Top UDP protocols'), ] ); } /** * Print the header of the network * * @param string $title Title of header. * @param string $order Current ordering. * @param string $selected Selected order. * @param array $hidden_data All the data to hide into the button. * * @return string With HTML data. */ function network_print_explorer_header( $title, $order, $selected, $hidden_data ) { $cell = '