<?php require ("Hait_login_ask.php");?>
<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"del";//下面是删除代码
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql="select * from hait_class where id='$v'";
$okis=mysql_query($sql,$conn);
$admin=mysql_fetch_array($okis);
if($admin['lmlx']==11){
$sql = "delete from hait_class where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok){
 echo "<script>alert('Hait windows提醒你，删除成功！');location.href='hait_class_gl.php';</script>";
	};}
else{$sql = "delete from hait_class where id='$v'";
$sq2 = "delete from hait_article where channel='$v'";
$ok = mysql_query($sql, $conn);
$ok2 = mysql_query($sq2, $conn);
if ($ok and $ok2 ) {
 echo "<script>alert('Hait windows提醒你，删除成功！');location.href='hait_class_gl.php';</script>";
	};
	};//循环结束
	};//删除结束
break;
case"zdh";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_class set lashen=1 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量最大化成功！');location.href='hait_class_gl.php';</script>";
	};
	};//最大化结束
break;
case"qxzdh";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_class set lashen=2 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量取消最大化成功！');location.href='hait_class_gl.php';</script>";
	};
	};//取消最大化结束
break;
case"zm";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_class set value=1 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批量桌面显示设置成功！');location.href='hait_class_gl.php';</script>";
	};
	};//桌面显示结束
break;
case"qxzm";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql = "update hait_class set value=2 where id='$v'";
$ok = mysql_query($sql, $conn);
if ($ok) {
 echo "<script>alert('Hait windows提醒你，批取消量桌面显示设置成功！');location.href='hait_class_gl.php';</script>";
	};
	};//取消置顶结束
break;
case"delwj";
$alllist =$_POST[ 'checkbox'];
foreach($alllist as  $v){
$sql="select * from hait_upload where id='$v'";
$okis=mysql_query($sql,$conn);
$admin=mysql_fetch_array($okis);
$picurl="../".$admin['picurl'];
$ok=unlink($picurl);
$sql2 = "delete from hait_upload where id='$v'";
$ok1 = mysql_query($sql2, $conn);
if ($ok and $ok1) {
 echo "<script>alert('Hait windows提醒你，文件删除成功！');location.href='hait_upload_gl.php';</script>";
	};
	};//取消置顶结束
break;


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


?>