%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", $module_id, get_system_time () - $period);
$string_type = 0;
}
$result = get_db_all_rows_sql ($sql);
if ($result === false) {
$result = array ();
}
echo "
".__('Received data from')." ".get_agentmodule_agent_name ($module_id)." / ".get_agentmodule_name ($module_id)."
";
echo "".human_time_description ($period) ."
";
$table->cellpadding = 3;
$table->cellspacing = 3;
$table->width = 600;
$table->class = "databox";
$table->head = array ();
$table->data = array ();
$table->align = array ();
$table->head[0] = __('Delete');
$table->align[0] = 'center';
$table->head[1] = __('Timestamp');
$table->align[1] = 'center';
$table->head[2] = __('Data');
$table->align[2] = 'center';
foreach ($result as $row) {
$data = array ();
if (give_acl ($config['id_user'], $group, "AW") ==1) {
if ($string_type == 0) {
$data[0] = '';
} else {
$data[0] = '';
}
} else {
$data[0] = '';
}
// 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
$data[1] = date ($config["date_format"], $row["utimestamp"]);
if (is_numeric ($row["datos"])) {
$data[2] = format_numeric($row["datos"],2);
} else {
$data[2] = safe_input ($row["datos"]);
}
array_push ($table->data, $data);
}
if (empty ($table->data)) {
echo ''.__('There was a problem locating the source of the graph').'
';
} else {
print_table ($table);
unset ($table);
}
?>