Файл: upload/pages/help/solutions/question.php
Строк: 34
<?php
require_once ($_SERVER['DOCUMENT_ROOT'] . '/core/core.php');
$id = abs((int)($_GET['id'] ?? 0));
$question = FetchAssoc(dbquery("SELECT * FROM `solutions_question` WHERE `id` = ?", [$id]));
if (empty($question['id'])) {
header("HTTP/1.0 404 Not Found");
include ($_SERVER['DOCUMENT_ROOT'] . '/pages/err_pages/404.php');
exit();
}
$sol_section = FetchAssoc(dbquery("SELECT * FROM `solutions_section` WHERE `id` = ?", [$question['section']]));
// Начало вывода страницы
$breadcrumbs = generateBreadcrumbs([
['/', 'Главная'],
['/solutions', 'База знаний'],
['#', $question['question']]
]);
// Сайдбар
include $_SERVER['DOCUMENT_ROOT'] . '/core/elements/sidebars/question.php';
$page_html = $view->render('pages/help/solutions/question.html', [
'breadcrumbs_html' => $breadcrumbs['html'],
'breadcrumbs_json' => $breadcrumbs['json_ld'],
'sidebar' => $sidebar,
'question' => [
'title' => chars($question['question']),
'solution' => nl2br(chars($question['solution']))
]
]);
require_once ($_SERVER['DOCUMENT_ROOT'] . '/layout.php');
?>