Now the report type 'serialized data' gets the data from the default and the historical database

This commit is contained in:
Alejandro Gallardo Escobar 2014-09-29 13:15:26 +02:00
parent cce59f3059
commit f406bdb02d

View File

@ -4778,19 +4778,21 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$datelimit = $report["datetime"] - $content['period']; $datelimit = $report["datetime"] - $content['period'];
// This query gets information from the default and the historic database
$result = db_get_all_rows_sql('SELECT * $result = db_get_all_rows_sql('SELECT *
FROM tagente_datos FROM tagente_datos
WHERE id_agente_modulo = ' . $content['id_agent_module'] . ' WHERE id_agente_modulo = ' . $content['id_agent_module'] . '
AND utimestamp > ' . $datelimit . ' AND utimestamp > ' . $datelimit . '
AND utimestamp <= ' . $report["datetime"]); AND utimestamp <= ' . $report["datetime"], true);
// Adds string data if there is no numeric data // Adds string data if there is no numeric data
if ((count($result) < 0) or (!$result)){ if ((count($result) < 0) or (!$result)) {
// This query gets information from the default and the historic database
$result = db_get_all_rows_sql('SELECT * $result = db_get_all_rows_sql('SELECT *
FROM tagente_datos_string FROM tagente_datos_string
WHERE id_agente_modulo = ' . $content['id_agent_module'] . ' WHERE id_agente_modulo = ' . $content['id_agent_module'] . '
AND utimestamp > ' . $datelimit . ' AND utimestamp > ' . $datelimit . '
AND utimestamp <= ' . $report["datetime"]); AND utimestamp <= ' . $report["datetime"], true);
} }
if ($result === false) { if ($result === false) {
$result = array(); $result = array();