Fixed historical data reports. Ticket#2730

This commit is contained in:
Arturo Gonzalez Diaz 2015-10-05 10:35:02 +02:00
parent fece1ed581
commit c24fd49536
2 changed files with 12 additions and 3 deletions

View File

@ -2171,7 +2171,8 @@ function reporting_historical_data($report, $content) {
global $config;
$return['type'] = 'historical_data';
$period = $content['period'];
$date_limit = time() - $period;
if (empty($content['name'])) {
$content['name'] = __('Historical data');
}
@ -2181,7 +2182,15 @@ function reporting_historical_data($report, $content) {
$return["date"] = reporting_get_date_text($report, $content);
$return['keys'] = array(__('Date'), __('Data'));
$result = db_get_all_rows_sql (
'SELECT *
FROM tagente_datos
WHERE id_agente_modulo =' . $content['id_agent_module'] . '
AND utimestamp >' . $date_limit . '
AND utimestamp <=' . time()
);
$data = array();
foreach ($result as $row) {
$data[] = array(

View File

@ -1168,7 +1168,7 @@ function reporting_html_historical_data($table, $item) {
$table1->data = array ();
foreach ($item['data'] as $data) {
$row = array($data[__('date')], $data[__('Data')]);
$row = array($data[__('Date')], $data[__('Data')]);
$table1->data[] = $row;
}