<?php
define('NTLCMS', 1);
$module = 'spam';
include ('../system/start.php');
include ('../system/function.php');
include ('../system/antidos.php');
include ('../system/head.php');
################################################################################
if (!$active){
header('Location: '.URL);
$_SESSION['fail'] = 'Вы не авторизированы!';
exit;
}
################################################################################

if ($_USER['admin'] > '0' && $_USER['admin'] < '2'){

$id = isset($_GET['id']) ? filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT) : '0';

if (isset($_GET['id'])){
DB :: run() -> query("delete from `spam` where `id` = '".$id."'");
header('Location: '.URL.'/mailing');
$_SESSION['fail'] = 'Рассылка успешно удалена!';
} else {
header('Location: '.URL.'/mailing');
$_SESSION['fail'] = 'Рассылка не удалена!';
}
} else {
header('Location: '.URL);
$_SESSION['fail'] = 'Доступ запрещен!';
}


?>