<?php 

//禁止直接访问
!defined('IN_SYSTEM') && exit('Access Denied');

if(isset($_POST["SelMsg"])){
	$SelMsgArr = explode(',', $_POST['SelMsg']);
	//过滤处理
	$SelMsgArr = ToUtf8($SelMsgArr);	//转换为UTF8编码格式
	//安全验证
	if(CheckSelMsg($SelMsgArr) == false){
		echo '0';
		exit();
	}
	$DelMsgArr = '';
	$CheckV = 1;
	foreach($SelMsgArr as $v){
		if(check_zzs($v) !== true){
			$CheckV = 0;
		}
		else{
			$DelMsgArr = $DelMsgArr."'".$v."',";
		}
	}
	if($CheckV == 1){
		//连接到MYSQL并打开系统数据库
		$DataBase->open_db();
		$DelMsgArr = rtrim($DelMsgArr, ",");
		if($DataBase->up('message', "`check` = '1'", "WHERE `id` in (".$DelMsgArr.")")){
			echo "1";
		}
		else{
			echo "0";
		}
		//关闭数据库连接
		$DataBase->close_dblink();				
	}
}
	
?>