<?php
define('NTLCMS', 1);
$module = 'delete';
include ('../system/start.php');
include ('../system/function.php');
include ('../system/antidos.php');
if ($_USER['admin'] == '1'){
$did = isset($_GET['delete']) ? filter_var($_GET['delete'], FILTER_SANITIZE_NUMBER_INT) : '0';
if (isset($_GET['delete']) && DB :: run() -> querySingle("select * from `comment` where `id` = ?", array($did)) != 0){
DB :: run() -> query("delete from `comment` where `id` = ? limit 1", array($did));
$_SESSION['success'] = 'Комментарий успешно удален!';
header('Location: '.URL.'/feed_comment'.$id);
} else {
$_SESSION['fail'] = 'Комментарий не удален!';
header('Location: '.URL.'/feed_comment'.$id);
}
} else {
header('Location: '.URL);
$_SESSION['fail'] = 'Доступ запрещен!';
}
?>