View file admin/delete_ads.php

File size: 1.05Kb
<?

////////////////////////////////////////
///// Kyber ApiCMS 2013 apicms.ru //////
///// Запрещается продажа данной CMS ///
///// Автор Евгений Медянкин Kyber /////
///// ICQ 626-000-895 или 37-22-47 /////
////////////////////////////////////////

/////////////////////////////////////////
$title = 'Удаление рекламной ссылки';
require_once '../api_core/apicms_system.php';
require_once '../api_core/head.php';
/////////////////////////////////////////
if ($user['level'] != 1) header('location: index.php');
if ($user['level'] == 1 or $user['level'] == 2){
if (isset($_GET['id']) && $user['level']==1 && mysql_result(mysql_query("SELECT COUNT(*) FROM `advertising` WHERE `id` = '".intval($_GET['id'])."'"),0)==1){
$post=mysql_fetch_assoc(mysql_query("SELECT * FROM `advertising` WHERE `id` = '".intval($_GET['id'])."' LIMIT 1"));
mysql_query("DELETE FROM `advertising` WHERE `id` = '$post[id]'");
header("Location: ads.php");
}
}
//////////////////////////////////////////
?>