Fixed historical data reports. Ticket#2730
This commit is contained in:
parent
fece1ed581
commit
c24fd49536
|
@ -2171,7 +2171,8 @@ function reporting_historical_data($report, $content) {
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$return['type'] = 'historical_data';
|
$return['type'] = 'historical_data';
|
||||||
|
$period = $content['period'];
|
||||||
|
$date_limit = time() - $period;
|
||||||
if (empty($content['name'])) {
|
if (empty($content['name'])) {
|
||||||
$content['name'] = __('Historical data');
|
$content['name'] = __('Historical data');
|
||||||
}
|
}
|
||||||
|
@ -2182,6 +2183,14 @@ function reporting_historical_data($report, $content) {
|
||||||
|
|
||||||
$return['keys'] = array(__('Date'), __('Data'));
|
$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();
|
$data = array();
|
||||||
foreach ($result as $row) {
|
foreach ($result as $row) {
|
||||||
$data[] = array(
|
$data[] = array(
|
||||||
|
|
|
@ -1168,7 +1168,7 @@ function reporting_html_historical_data($table, $item) {
|
||||||
|
|
||||||
$table1->data = array ();
|
$table1->data = array ();
|
||||||
foreach ($item['data'] as $data) {
|
foreach ($item['data'] as $data) {
|
||||||
$row = array($data[__('date')], $data[__('Data')]);
|
$row = array($data[__('Date')], $data[__('Data')]);
|
||||||
$table1->data[] = $row;
|
$table1->data[] = $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue