<?php
include_once('IsLogined.php');
include_once("../config/databaseConfig.inc.php");
if ($_POST['more']=='del'){
	$ArticleID= $_POST['ArticleID'];
	if(is_array($ArticleID)){
		$ids = $comma = "";
		foreach($ArticleID as $id){
			$ids .= "{$comma}{$id}";
			$comma = ",";
		}
		//print($ids);
		/*
		批量删除记录
		*/
		$sqlDel = "Delete FROM Article Where ID IN ({$ids})";   
		echo $sqlDel;
		$db->Execute($sqlDel);  
		$db->close();
		$purl = $HTTP_SERVER_VARS['HTTP_REFERER'];
		exit("<meta http-equiv=\"refresh\" content=\"0;URL={$purl}\">");	
	}
}else{
/*
从url得到ID
*/
$Qid = $_GET["ID"];
if (empty($Qid)==true){
    die(参数传递错误！非法操作！);
}else{
    if (!is_numeric($Qid)) die(参数传递错误！非法操作！);
}
/*
删除单个记录
*/
$sqlDel = "Delete FROM Article Where ID = {$Qid}";   
$db->Execute($sqlDel);  
$db->close();
$purl = $HTTP_SERVER_VARS['HTTP_REFERER'];
exit("<meta http-equiv=\"refresh\" content=\"0;URL={$purl}\">");
}
?>