diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index 7f7fc7dc2d..b8cd3e683f 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -1187,4 +1187,25 @@ function db_get_fields($table) { break; } } + +/** + * @param int Unix timestamp with the date. + * + * @return bool Returns true if the history db has data after the date provided or false otherwise. + */ +function db_search_in_history_db ($utimestamp) { + global $config; + + $search_in_history_db = false; + if ($config['history_db_enabled'] == 1) { + $history_db_start_period = $config['history_db_days'] * SECONDS_1DAY; + + // If the date is newer than the newest history db data + if (time() - $history_db_start_period >= $utimestamp) + $search_in_history_db = true; + } + + return $search_in_history_db; +} + ?> \ No newline at end of file