<?PHP
/*
* Copyright (c) www.baojisky.com All rights reserved. 
*/
ob_start(); 
header("Content-type: text/html;charset=utf-8");//输出编码,避免中文乱码
$root_path='.';
include_once($root_path.'/php/connect_sub.php');
include_once($root_path.'/php/sub.php');

if($qid==''){$qid='1287669734';}

$result_qi	=	$db->query("SELECT * from {$db_sux}papers where qid='$qid'  ");
$gb_qi = $db->fetch_array($result_qi);

$gb_qi[addtime]=iconv("gbk", "UTF-8", $gb_qi[addtime]);
$gb_qi[n_qi]=iconv("gbk", "UTF-8", $gb_qi[n_qi]);

$qi_data=substr($gb_qi[addtime],0,4).'年'.substr($gb_qi[addtime],5,2).'月'.substr($gb_qi[addtime],8,2).'日 星期'.iconv("gbk", "UTF-8", daxie_weekday(GetWeekDay($gb_qi[addtime]))).' 总第'.$gb_qi[n_qi].'期';
$now_data=substr($gb_qi[addtime],0,10);
//echo $qi_data;

//几版
$ban_num=$db->num_rows($db->query("SELECT * from {$db_sux}papers_ban where qid='$qid'"));



$fgfg	=	'<?xml version="1.0" encoding="utf-8"?>
<xmlbase>';
$fgfg.= '<can_shu  z_qi="'.$gb_qi[z_qi].'" n_qi="'.$gb_qi[n_qi].'" ban_num="'.$ban_num.'"  now_data="'.$now_data.'" datahtml="'.$qi_data.'" />';
//版面名称
	$result=$db->query("SELECT * from {$db_sux}papers_ban where qid='$qid' ORDER by bnum ");
	while ($gb_ban = mysql_fetch_array($result))
	{
		$gb_ban[ban_name]=iconv("gbk", "UTF-8", $gb_ban[ban_name]);
		
		$fgfg.=	'<ban_list>';
		$fgfg.=	'<bnum>'.$gb_ban[bnum].'</bnum>';
		$fgfg.=	'<ban_name>'.$gb_ban[ban_name].'</ban_name>';
		$fgfg.=	'<ban_pic>'.$gb_ban[ban_pic].'</ban_pic>';
		$fgfg.=	'</ban_list>';
	}	
$fgfg.=	"
</xmlbase>";
echo $fgfg;
ob_end_flush();
?>