if ($show_query) {
$total_time_query = $db->query_list;
if (is_array($total_time_query)) {
for ($i = 0; $i < count($total_time_query); $i++) {
$color = ($total_time_query[$i]['time'] > 0.01) ? 'red' : 'green';
$rounded_time = sprintf("%.8f", $total_time_query[$i]['time']);
$time_query .= "<p><span style='color:".$color."'>".$rounded_time."</span> сек. - [ ".htmlspecialchars($total_time_query[$i]['query'])." ]</p>";
}
}
}
if (!$nolog) {
$base_path = $site_root . '/uploads/stat_log.html';
$statfile = fopen($base_path, 'r');
if ($statfile) {
$fileSize = round(filesize($base_path) / 1024, 2);
$logContent = fgets($statfile);
fclose($statfile);
$showstat .= "<a id='log-link' href='".$config['http_home_url']."uploads/stat_log.html' target='_blank' title='Смотреть лог. Лимит ".$size."Кб, сейчас: ".$logContent.$fileSize."Кб'></a>";
}
}