Файл: upload/pages/admin/solutions/del-solution.php
Строк: 15
<?php
require_once ($_SERVER['DOCUMENT_ROOT'] . '/core/core.php');
if ($users_perms['edit_solutions'] != 1) {
RedirectToPage('/');
exit();
}
$id = abs(intval($_POST['id']));
$solution = FetchAssoc(dbquery("SELECT * FROM `solutions_question` WHERE `id` = ?", [$id]));
if (empty($solution['id'])) {
header("HTTP/1.0 404 Not Found");
include ($_SERVER['DOCUMENT_ROOT'] . '/pages/err_pages/404.php');
exit();
}
if (isset($_POST['del-solution'])) {
check_csrf();
deleteSolution($solution['id']);
showAlert('Успешно', 'success', 'Решение успешно удалено!');
RedirectToPage('/admin/solutions');
}
?>