<?PHP
/*
* Copyright (c) www.baojisky.com All rights reserved. 
*/
ob_start(); 
header("Content-type: text/html;charset=gbk");//输出编码,避免中文乱码
$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');
 

$intime		=	Date("Y-m-d H:i:s");	

$result	=	$db->query("SELECT * FROM {$db_sux}papers WHERE  qid='$qid'");		
$gb 	=	$db->fetch_array($result);

$result_ban	=	$db->query("SELECT * from {$db_sux}papers_ban where qid='$qid' and bid='$bid'");	
$gb_ban = $db->fetch_array($result_ban);


$result_news	=	$db->query("SELECT * from {$db_sux}papers_news where nid='$nid'  ");
$news_numberz	=	$db->num_rows($result_news);
if($news_numberz==1){$gb_news = $db->fetch_array($result_news);}else{web_echo("该新闻不存在！可能已经删除。","",'',"$root_path",'info1');exit(0);}

$max_up_M=ini_get('upload_max_filesize');
$max_up_kb=$max_up_M*1024*1024;
$my_domain=dirname("http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF']).'/';

//新闻图片数据
$i=1;
$pic_html='';
$result_pic	=	$db->query("SELECT * from {$db_sux}papers_upfile where nid='$gb_news[nid]' ORDER BY taxis ");
$pic_numberz	=	$db->num_rows($result_pic);
if($pic_numberz>0)
{
	$pic_html.='<table width="100%" border="0" cellspacing="0" cellpadding="0">';
 	while($gb_pic = $db->fetch_array($result_pic))
	{
		$temp_pic_html='<td width="25%" align="left"><table width="170" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="center" bgcolor="#FFFFFF"><a href="'.$root_path.'/upload/paper_data/'.$gb_pic[upfile].'" target="_blank"><img src="'.$root_path.'/upload/paper_data/'.$gb_pic[supfile].'"  border=0 height="96"></a></td>
            </tr>
            <tr>
              <td height="25" align="left" bgcolor="#FFFFFF">名称：<input type="hidden"  name="pic_id[]" id="pic_id[]" value="'.$gb_pic[id].'" ><input name="pname[]" type="text" id="pname'.$gb_pic[id].'" value="'.$gb_pic[name].'" size="14"></td>
            </tr>
            <tr>
              <td height="25" align="left" bgcolor="#FFFFFF">排序：<input name="taxis[]" type="text" id="taxis'.$gb_pic[id].'" value="'.$gb_pic[taxis].'" size="2">&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:isdel(\'Newspaper_news_pic_del.php?inid='.$gb_pic[id].'&nid='.$nid.'&qid='.$qid.'&bid='.$bid.'&page='.$page.'&maodian='.$maodian.'\')">删除</a></td>
            </tr>
          </table></td>';
    if($i==1 ) 
		{
			$pic_html	.=	'<tr height="75" style="line-height:150%;" >'.$temp_pic_html;
			$i++;	
		}
		else if($i==4)
		{
			$pic_html	.=	$temp_pic_html.'</tr>';
			$i=1;
		}
		else if($i>1) 
		{
			$pic_html	.=$temp_pic_html;
			$i++;	
		}
	}	
	$z=1;
	if($i!=1)
	{
		while($z<=4-($i-1))
		{
		$pic_html	.="<td width=\"25%\">&nbsp;</td>";
		$z++;	
		}
		$pic_html	.="</tr>";
	}
								
	$pic_html	.=	"</table>";	
	
	
}


	
include(parse_template('Newspaper_news_edit'.'_x',$root_path.'/tpl/admin/',$root_path.'/admin/system/'));

ob_end_flush();
?>