<?php require ("Hait_login_ask.php");?>
<?php
if($article_gl==null or $article_gl<>1 or $add_article==null or $add_article<>1 )
{
   echo "<script>alert('Hait windows 提醒你，非法操作！！你没有该权限！');location.href='Hait_right.php'</script>";
   exit;
}?>
<link rel="stylesheet" type="text/css" href="images/hait_admin.css" />
﻿<?php 
require("../config.php");
@$appname=$_POST['appname'];
if( !empty($_POST['checkbox']))
{
SWITCH($appname){
case"huishou";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set huishou=1 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，该信息已经移至回收站！');location.href='hait_article_gl.php';</script>";
	};
	};//回收结束
break;
case"hy";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set huishou=2 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，还原成功！');location.href='hait_hsz.php';</script>";
	};
	};//回收结束
break;
case"del";//下面是删除代码
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "delete from hait_article where id='$v'";
$ok = mysql_query($sql, $conn);
$sql2="delete from hait_class where kjfs='$v'";
$ok2=mysql_query($sql2, $conn);
if ($ok and $ok2) {
 echo "<script>alert('Hait windows提醒你，删除成功！');location.href='hait_hsz.php';</script>";
	};//循环结束
	};//删除结束
break;
case"sh";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set shenhe=1 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量审核成功！');location.href='hait_article_gl.php';</script>";
	};
	};//审核结束
break;
case"qxsh";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set shenhe=2 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量取消审核成功！');location.href='hait_article_gl.php';</script>";
	};
	};//取消审核结束
break;
case"zdh";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set lashen=1 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量最大化成功！');location.href='hait_article_gl.php';</script>";
	};
	};//最大化结束
break;
case"qxzdh";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set lashen=2 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量取消最大化成功！');location.href='hait_article_gl.php';</script>";
	};
	};//取消最大化结束
break;
case"zd";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set zhiding=1 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量置顶成功！');location.href='hait_article_gl.php';</script>";
	};
	};//置顶结束
break;
case"qxzd";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set zhiding=2 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量取消置顶成功！');location.href='hait_article_gl.php';</script>";
	};
	};//取消置顶结束
break;
case"tj";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set tuijian=1 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量推荐化成功！');location.href='hait_article_gl.php';</script>";
	};
	};//推荐结束
break;
case"qxtj";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_article set tuijian=2 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量取消推荐成功！');location.href='hait_article_gl.php';</script>";
	};
	};//取消推荐束
break;
case"zy";
$alllist =$_POST[ 'checkbox'];
$newclass=$_POST['newclass'];
foreach($alllist as  $v){
$sql = "update hait_article set channel='$newclass' where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量转移成功！');location.href='hait_article_gl.php';</script>";
	};
	};//转移结束
break;
case"pinglun-del";//下面是删除代码
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "delete from hait_pinglun where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok ) {
 $id =$_POST[ 'pinglun-id'];
 $title =$_POST[ 'title'];
 $class =$_POST[ 'class'];
 echo '<script>alert("Hait windows提醒你，删除成功！");location.href="hait_pinglun_gl.php?id='.$id.'&title='.$title.'&class='.$class.'";</script>';
	};//循环结束
	};//删除结束
break;


}//switch结束
}//if结束
else{echo "<script>alert('Hait windows提醒你，请至少添加一个选项！');history.back();</script>";
  exit;}

?>