%d ORDER BY utimestamp DESC LIMIT %d OFFSET %d", $module_id, get_system_time () - $period, $config['block_size'], get_parameter ('offset')); $sqlCount = sprintf ("SELECT COUNT(*) FROM tagente_datos_string WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, get_system_time () - $period); $string_type = 1; } else { $sql = sprintf ("SELECT * FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC LIMIT %d OFFSET %d", $module_id, get_system_time () - $period, $config['block_size'], get_parameter ('offset')); $sqlCount = sprintf ("SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo = %d AND utimestamp > %d ORDER BY utimestamp DESC", $module_id, get_system_time () - $period); $string_type = 0; } $countData = get_db_value_sql($sqlCount); $result = get_db_all_rows_sql ($sql, true); if ($result === false) { $result = array (); } echo "

".__('Received data from')." ".get_agentmodule_agent_name ($module_id)." / ".get_agentmodule_name ($module_id)."

"; echo "

" . __("From the last") . " " . human_time_description ($period) ."

"; echo "
"; echo __("Choose a time from now") . ": "; $intervals = array (); $intervals[3600] = human_time_description_raw (3600); // 1 hour $intervals[86400] = human_time_description_raw (86400); // 1 day $intervals[604800] = human_time_description_raw (604800); // 1 week $intervals[2592000] = human_time_description_raw (2592000); // 1 month echo print_extended_select_for_time ($intervals, 'period', $period, 'this.form.submit();', '', '0', 10) . __(" seconds."); echo "

"; if ($result === false) { echo '

'.__('There was a problem locating the source of the graph').'

'; } else { pagination ($countData, false) ; echo ' '; $count = 0; foreach ($result as $row) { if (($count % 2) == 0) $classPairOdd = 'rowPair'; else $classPairOdd = 'rowOdd'; if ($count > 100) break; $count++; echo(''); if (give_acl ($config['id_user'], $group, "AW") ==1) { if ($string_type == 0) { echo(''); } else { echo(''); } } else { echo(''); } // This returns data with absolute user-defined timestamp format // and numeric by data managed with 2 decimals, and not using Graph format // (replacing 1000 by K and 1000000 by G, like version 2.x echo(''); if (is_numeric ($row["datos"])) { echo(''); } else { echo(''); } echo(''); } echo '
' . __('Delete') . ' ' . __('Timestamp') . ' ' . __('Data') . '
' . date ($config["date_format"], $row["utimestamp"]) . '' . format_numeric($row["datos"],2) . '' . safe_input ($row["datos"]) . '
'; pagination ($countData, false) ; echo "

" . __('Total') . ' ' . $countData . ' ' . __('Data') . "

"; } ?>