Fixed errors related with the oracle compatibility

This commit is contained in:
Alejandro Gallardo Escobar 2015-05-18 19:06:21 +02:00
parent b8f2daf6fa
commit 7e67287ee0
1 changed files with 24 additions and 24 deletions

View File

@ -1786,33 +1786,33 @@ function grafico_db_agentes_purge ($id_agent, $width = 380, $height = 300) {
// Data from 1 day ago
$filter['utimestamp'] = '>' . $time_1day;
$num_1day = 0;
$num_1day += (int) db_get_value_filter('count(*)', 'tagente_datos', $filter);
$num_1day += (int) db_get_value_filter('count(*)', 'tagente_datos_string', $filter);
$num_1day += (int) db_get_value_filter('count(*)', 'tagente_datos_log4x', $filter);
$num_1day += (int) db_get_value_filter('COUNT(*)', 'tagente_datos', $filter);
$num_1day += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_string', $filter);
$num_1day += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_log4x', $filter);
if ($num_1day !== false) {
// Data from 1 week ago
$filter['utimestamp'] = '>' . $time_1week;
$num_1week = 0;
$num_1week += (int) db_get_value_filter('count(*)', 'tagente_datos', $filter);
$num_1week += (int) db_get_value_filter('count(*)', 'tagente_datos_string', $filter);
$num_1week += (int) db_get_value_filter('count(*)', 'tagente_datos_log4x', $filter);
$num_1week += (int) db_get_value_filter('COUNT(*)', 'tagente_datos', $filter);
$num_1week += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_string', $filter);
$num_1week += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_log4x', $filter);
if ($num_1week !== false) {
// Data from 1 month ago
$filter['utimestamp'] = '>' . $time_1month;
$num_1month = 0;
$num_1month += (int) db_get_value_filter('count(*)', 'tagente_datos', $filter);
$num_1month += (int) db_get_value_filter('count(*)', 'tagente_datos_string', $filter);
$num_1month += (int) db_get_value_filter('count(*)', 'tagente_datos_log4x', $filter);
$num_1month += (int) db_get_value_filter('COUNT(*)', 'tagente_datos', $filter);
$num_1month += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_string', $filter);
$num_1month += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_log4x', $filter);
if ($num_1month !== false) {
// Data from 3 months ago
$filter['utimestamp'] = '>' . $time_3months;
$num_3months = 0;
$num_3months += (int) db_get_value_filter('count(*)', 'tagente_datos', $filter);
$num_3months += (int) db_get_value_filter('count(*)', 'tagente_datos_string', $filter);
$num_3months += (int) db_get_value_filter('count(*)', 'tagente_datos_log4x', $filter);
$num_3months += (int) db_get_value_filter('COUNT(*)', 'tagente_datos', $filter);
$num_3months += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_string', $filter);
$num_3months += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_log4x', $filter);
if ($num_3months !== false) {
// All data
@ -1820,15 +1820,15 @@ function grafico_db_agentes_purge ($id_agent, $width = 380, $height = 300) {
if (empty($filter)) {
$num_all = 0;
$num_all += (int) db_get_value_sql('SELECT count(*) FROM tagente_datos');
$num_all += (int) db_get_value_sql('SELECT count(*) FROM tagente_datos_string');
$num_all += (int) db_get_value_sql('SELECT count(*) FROM tagente_datos_log4x');
$num_all += (int) db_get_value_sql('SELECT COUNT(*) FROM tagente_datos');
$num_all += (int) db_get_value_sql('SELECT COUNT(*) FROM tagente_datos_string');
$num_all += (int) db_get_value_sql('SELECT COUNT(*) FROM tagente_datos_log4x');
}
else {
$num_all = 0;
$num_all += (int) db_get_value_filter('count(*)', 'tagente_datos', $filter);
$num_all += (int) db_get_value_filter('count(*)', 'tagente_datos_string', $filter);
$num_all += (int) db_get_value_filter('count(*)', 'tagente_datos_log4x', $filter);
$num_all += (int) db_get_value_filter('COUNT(*)', 'tagente_datos', $filter);
$num_all += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_string', $filter);
$num_all += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_log4x', $filter);
}
if ($num_all !== false) {
@ -1838,15 +1838,15 @@ function grafico_db_agentes_purge ($id_agent, $width = 380, $height = 300) {
// All data in common and history database
if (empty($filter)) {
$num_all_w_history = 0;
$num_all_w_history += (int) db_get_value_sql('SELECT count(*) FROM tagente_datos', true);
$num_all_w_history += (int) db_get_value_sql('SELECT count(*) FROM tagente_datos_string', true);
$num_all_w_history += (int) db_get_value_sql('SELECT count(*) FROM tagente_datos_log4x', true);
$num_all_w_history += (int) db_get_value_sql('SELECT COUNT(*) FROM tagente_datos', true);
$num_all_w_history += (int) db_get_value_sql('SELECT COUNT(*) FROM tagente_datos_string', true);
$num_all_w_history += (int) db_get_value_sql('SELECT COUNT(*) FROM tagente_datos_log4x', true);
}
else {
$num_all_w_history = 0;
$num_all_w_history += (int) db_get_value_filter('count(*)', 'tagente_datos', $filter, 'AND', true);
$num_all_w_history += (int) db_get_value_filter('count(*)', 'tagente_datos_string', $filter, 'AND', true);
$num_all_w_history += (int) db_get_value_filter('count(*)', 'tagente_datos_log4x', $filter, 'AND', true);
$num_all_w_history += (int) db_get_value_filter('COUNT(*)', 'tagente_datos', $filter, 'AND', true);
$num_all_w_history += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_string', $filter, 'AND', true);
$num_all_w_history += (int) db_get_value_filter('COUNT(*)', 'tagente_datos_log4x', $filter, 'AND', true);
}
if ($num_all_w_history !== false) {