Fixed item sql

This commit is contained in:
Daniel Maya 2019-12-16 15:50:21 +01:00
parent 24838cad0f
commit 8bde504fc2
2 changed files with 8 additions and 36 deletions

View File

@ -1856,7 +1856,7 @@ $class = 'databox filters';
'combo_server',
$server_name,
'',
__('Select server'),
__('Local metaconsole'),
0
);
?>

View File

@ -5092,37 +5092,13 @@ function reporting_sql($report, $content)
}
if ($content['treport_custom_sql_id'] != 0) {
switch ($config['dbtype']) {
case 'mysql':
$sql = io_safe_output(
db_get_value_filter(
'`sql`',
'treport_custom_sql',
['id' => $content['treport_custom_sql_id']]
)
);
break;
case 'postgresql':
$sql = io_safe_output(
db_get_value_filter(
'"sql"',
'treport_custom_sql',
['id' => $content['treport_custom_sql_id']]
)
);
break;
case 'oracle':
$sql = io_safe_output(
db_get_value_filter(
'sql',
'treport_custom_sql',
['id' => $content['treport_custom_sql_id']]
)
);
break;
}
$sql = io_safe_output(
db_get_value_filter(
'`sql`',
'treport_custom_sql',
['id' => $content['treport_custom_sql_id']]
)
);
} else {
$sql = io_safe_output($content['external_source']);
}
@ -5152,10 +5128,6 @@ function reporting_sql($report, $content)
$historical_db = $content['historical_db'];
}
if (is_metaconsole()) {
metaconsole_restore_db();
}
$result = db_get_all_rows_sql($sql, $historical_db);
if ($result !== false) {
foreach ($result as $row) {