<?php 
/*文章模块后台管理系统*/

$type=$_GET['type'];
$articleid=$_GET['id'];
$sid=$sid_info;
echo '<div class="art_top"><a href="index.php?action=article&type=add&cid='.$_GET['cid'].'&id='.$articleid.'&">文章上传</a><a href="index.php?action=article&page=1&">栏目列表</a><a href="index.php?action=article&cid=0&page=1&">文章列表</a></div>';
if($type==mod){
   require "../article/admin/mod.php";/*加载文章修改模块*/
   }elseif($type==add){
   require "add.php";/*加载添加文章模块*/
   }elseif($type==top){
   $sql="UPDATE article SET top='top' WHERE articleid='{$_GET["id"]}'";
   $result=mysql_query($sql);
   if($result && mysql_affected_rows()>0){
	echo "修改推荐成功";
	echo '<script>window.location="index.php?action=article&cid='.$_GET['cid'].'&page='.$_GET['page'].'&id='.$articleid.'&"</script>';
	}else{
    echo "修改推荐失败";
    };
	}elseif($type=='qtop'){
	$sql="UPDATE article SET top='NULL' WHERE articleid='{$_GET["id"]}'";
	$result=mysql_query($sql);
	if($result && mysql_affected_rows()>0){
	echo "取消推荐成功";
	echo '<script>window.location="webadmin.php?action=article&cid='.$_GET['cid'].'&page='.$_GET['page'].'&id='.$articleid.'&"</script>';
	}else{
	echo "取消推荐失败";
    };
   }elseif($type=='del'){
	$result = mysql_query("DELETE FROM article WHERE articleid='{$_GET["id"]}'");
	if($result && mysql_affected_rows()>0){
	echo '<script>window.location="index.php?action=article&cid='.$_GET['cid'].'&page='.$_GET['page'].'&id='.$articleid.'&"</script>';
	}else{
    echo "删除失败";
	};
	}elseif($type==Modclass){
	require "Modclass.php";
	}elseif($type==delclass){
	   if($_GET['ok']==y){
	$result = mysql_query("DELETE FROM class WHERE cid='{$_GET["cid"]}'");
	if($result && mysql_affected_rows()>0){
	echo '<script>window.location="index.php?action=article&cid='.$cid.'page='.$_GET['page'].'&id='.$articleid.'&"</script>';
	}else{
    echo "删除失败";
	};}else{
	echo '<div class="tip">确定删除此栏目吗？删除后栏目将不可恢复！但是栏目内容不会被删除！<br>';
	echo "<a href=\"index.php?action=article&type=delclass&ok=y&cid=".$cid."&page=".$_GET['page']."&sid=".$sid_info."\">
   <img src=\"../../image/del.png\"/>确定删除</a></div>";
   } ;
	}else{
   require "../article/admin/list.php";/*加载文章列表模块*/
   }
?>list.php";/*加载文章列表模块*/
   }
?>