<?PHP
/*
* Copyright (c) www.baojisky.com All rights reserved. 
*/
$root_path='../..';
include($root_path.'/php/connect_sub.php');
include($root_path.'/php/sub.php');
include($root_path."/php/img_sub.php");
include($root_path.'/php/page_sub_old.php');
include($root_path.'/admin/check.php');
 

$file_path_pdf		=	$root_path."/upload/paper_file/";  //上传pdf附件路径
$file_path_pic  	=	$root_path."/upload/paper_data/";  //上传图片附件路径

if($id!=""){$inid[0]=$id;}
for($b1=0;$b1< count($inid);$b1++)
{
	  //echo $inid[$b1];
		$result_news	=	$db->query("SELECT * from {$db_sux}papers_news where nid='$inid[$b1]'  ");
		$news_numberz	=	$db->num_rows($result_news);
		if($news_numberz>0)
		{
  		  $gb_news = $db->fetch_array($result_news);			
				//新闻图片数据
				$result_pic	=	$db->query("SELECT * from {$db_sux}papers_upfile where nid='$gb_news[nid]'  ");
				$pic_numberz	=	$db->num_rows($result_pic);
				if($pic_numberz>0)
				{
  				while($gb_pic = $db->fetch_array($result_pic))
					{
						//删除图片数据
		 				if($gb_pic[upfile]!=null and $gb_pic[upfile]!='')
						{
							  $filename_del	=	$file_path_pic.$gb_pic[upfile];//大图
								$tt	=	unlink($filename_del);
								$filename_del	=	$file_path_pic.$gb_pic[supfile];//小图
								$tt	=	unlink($filename_del);
						}
						$db->query("delete from {$db_sux}papers_upfile WHERE id='$gb_pic[id]'");//删除图片数据
					}
				}
				$db->query("delete from {$db_sux}papers_news WHERE nid='$inid[$b1]'");//删除新闻数据
			
		}
}		

web_echo("操作成功!","Newspaper_ban_list.php?page=$page&qid=$qid",'2',"$root_path",'info1');exit(0);

echo $fgoutputstr;
?>