header('Content-Type: text/html; charset=gb2312');
require "../inc/global.php";
require "../inc/function.php";
$pageID = empty($_REQUEST["pageID"])? 50 : $_REQUEST["pageID"];
$page=empty($_REQUEST["page"])? 0 : $_REQUEST["page"];
$kind = empty($_REQUEST["kind"])? 24 : $_REQUEST["kind"];
$where="kind = ".$kind." and disp =0";
$db=new db();
$sql="select Title,Description from prog_catalog where FormainId=188 and value=".$kind." order by disp_id ";
$query = $db->query($sql);
$i=0;
$forum = $db->fetch_array($query);
$subtitle = $forum['Title'];
$subimg = $forum['Description'];
//echo $subtitle;
//echo $subimg;
$start= $page * 18;
$sql="select id,title,date from cy_info where ".$where." order by id desc LIMIT ".$start." , 18";
$query = $db->query($sql);
$i=0;
while($forum = $db->fetch_array($query)) {
$news[$i]['id'] = $forum['id'];
$news[$i]['title'] = $forum['title'];//echo $forum['title'];
$news[$i]['date'] = date("Y-m-d",strtotime($forum['date']));
$i++;
}
$id = empty($_REQUEST['id'])? $news[0]['id'] : $_REQUEST['id'];
$sql="select title,text from cy_info where id =".$id;
$query = $db->query($sql);
$forum = $db->fetch_array($query);
$qe="&kind=".$kind;
$pages = $db->row_count("cy_info",$where);
$pagestr = view_pages($pages,$page,$qe);
$viewdata = array("pageID" => $pageID ,
"siteinfo" => $siteinfo,
"sitename" => $sitename,
"news" => $news,
"pagestr" => $pagestr,
"subtitle" => $subtitle,
"subimg" => $subimg,
"page" => $page,
"kind" => $kind,
"title" => $forum['title'],
"body" => $forum['text'],
"menu" => showmenu($pageID)
);
$tplname= CModel($_SERVER["SCRIPT_NAME"]);
callview($viewdata,$tplname);
?>