<?php
/*
- NTLCMS v 18.1 19.08.2017 г
- Автор скрипта Александр (NTL)
- Скрипт клик клуба v 18.1
- Оф.сайт http://clicks24.ru
- Контакты ntl-jt@mail.ru
- Все права принадлежат разработчику
- Вы не имеете право вносить изменения в код скрипта
- Данный скрипт запрещено распространять
*/
define('NTLCMS', 1);
$module = 'delete';
include ('../system/start.php');
include ('../system/function.php');
################################################################################
if (!$active){
header('Location: '.URL);
$_SESSION['fail'] = 'Вы не авторизированы!';
exit;
}
################################################################################
if ($_USER['admin'] == '1'){
$id = isset($_GET['id']) ? filter_int($_GET['id']) : '0';
if (isset($_GET['id']) && DB :: run() -> querySingle("select * from `chat` where `id` = ?", array($id)) != 0){
DB :: run() -> query("delete from `chat` where `id` = ? limit 1", array($id));
header('Location: '.URL.'/chats');
$_SESSION['success'] = 'Пост успешно удален!';
} else {
header('Location: '.URL.'/chats');
$_SESSION['fail'] = 'Пост не удален!';
}
} else {
header('Location: '.URL);
$_SESSION['fail'] = 'Доступ запрещен!';
}
?>