Файл: api_forum/del_theme.php
Строк: 22
<?
////////////////////////////////////////
///// Основа ApiCMS //////
///// Автор биллинга - IvanDanilov /////
///// Автор биллинга - IvanDanilov /////
///// ICQ 936545, mail: KyberID@ya.ru //
////////////////////////////////////////
/////////////////////////////////////////
$title = 'Удаление';
require_once '../api_core/apicms_system.php';
require_once '../api_core/head.php';
/////////////////////////////////////////
$theme_id = intval($_GET['id']);
if (!isset($user)) header('location: index.php');
$post = mysql_fetch_assoc(mysql_query("SELECT * FROM `api_forum_theme` WHERE `id` = '".$theme_id."' LIMIT 1"));
if (isset($user) && $user['id'] == $post['id_user'] or $user['level']==1 or $user['level']==2){
if (isset($_POST['okdel']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `api_forum_theme` WHERE `id` = '".$theme_id."'"),0)==1){
mysql_query("DELETE FROM `api_forum_theme` WHERE `id` = '$theme_id'");
mysql_query("DELETE FROM `api_forum_post` WHERE `theme` = '$theme_id'");
header("Location: index.php");
}else{
echo "<div class='erors'>Ошибка удаления</div>n";
}
/////////////////////////////////////////
echo "<form action="del_theme.php?id=".$theme_id."&ok" method="post">n";
echo "<div class='content'><center><input type='submit' name='okdel' value='Подтвердить удаление'/></form></center></div>n";
//////////////////////////////////////////
}
apicms_foot();
?>