Просмотр файла sdark.mobi/clan_forum/del_razdel.php

Размер файла: 1.13Kb
<?
require_once '../core/system.php';
echo only_reg();
echo moder();
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_razdel_clan` WHERE `id` = ".intval($_GET['razdel']).""),0) == true){
$topic = mysql_fetch_array(mysql_query("SELECT * FROM `forum_razdel_clan` WHERE `id`  = ".intval($_GET['razdel']).""));
}else{
$_SESSION['err'] = "Раздел не найден";
header("Location: /clan_forum?id=".intval($_GET['id'])."");
exit();
}
$clan = mysql_fetch_array(mysql_query("SELECT * FROM `clan` WHERE `id`  = '".intval($_GET['id'])."'"));
$razd = mysql_fetch_array(mysql_query("SELECT * FROM `forum_razdel_clan` WHERE `id`  = ".intval($_GET['razdel'])." and `clan`  = $user[clan]"));
if(($user['dolz']=='основатель' and $topic['id']==$razd['id']  and $user['clan']==$clan['id']) or ($user['prava']==5)){

header("Location: /clan_forum?id=".intval($_GET['id'])."");
mysql_query("DELETE FROM `forum_razdel_clan` WHERE `id` = '$topic[id]'");
$_SESSION['message'] = "Раздел удален";
exit();}else{$_SESSION['err'] = "Ошибка"; header("Location: /clan_forum?id=".intval($_GET['id']).""); exit();}
?>