%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 "
";
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('' .
date ($config["date_format"], $row["utimestamp"]) .
' | ');
if (is_numeric ($row["datos"])) {
echo('' .
format_numeric($row["datos"],2) .
' | ');
}
else {
echo('' .
safe_input ($row["datos"]) .
' | ');
}
echo('
');
}
echo '
';
pagination ($countData, false) ;
echo "" . __('Total') . ' ' . $countData . ' ' . __('Data') . "
";
}
?>