<?php
include_once("../config/templateConfig.inc.php");
include_once("../config/databaseConfig.inc.php");
$templateMain   = new SmartTemplate('fuWuYuZhiChi.html');
$templateMenu   = new SmartTemplate('menu.html');
$templateTop    = new SmartTemplate('top.html');
$templateBottom = new SmartTemplate('copyRight.html');
/*
输出头部
*/
$templateTop->output();
/*
输出菜单
*/
$menu="服务与支持";
$submenu="";
$templateMenu->assign('MENU',$menu);
$templateMenu->output();
/*
获取URL后的页码变量
*/
$Qclass = $_GET["class"];
if (empty($Qclass)==true){
    $Qclass = 1;
}else{
    if (!is_numeric($Qclass)) die(参数传递错误！非法操作！);
}
/*
$tn 总记录数
*/
$sqltn="select count(*) from Article where Aclass = {$Qclass}";
$tn =$db->GetOne($sqltn);
/*
分页设置
计算页数
*/
$page_size = 15;
$tp = ceil($tn / $page_size);
$cp =(int)$_GET["p"];
empty($cp)==true ? $cp=1:$cp=(int)$_GET["p"];
if ($cp < 1) $cp   = 1 ;
if ($cp > $tp) $cp = $tp; 
/*
取记录
输出主体部分
*/
$sqlrs="select ID,Atitle,Aclass,Aeditor,Atime from Article where Aclass = {$Qclass} order by ID DESC";
$rs = $db->SelectLimit($sqlrs,$page_size,($cp-1) * $page_size);
$rs = $rs->GetRows();
$templateMain->assign('class',$Qclass);
$templateMain->assign('article',$rs);
$templateMain->assign('CP',$cp);
$templateMain->assign('Pr',$cp-1);
$templateMain->assign('Ne',$cp+1);
$templateMain->assign('TP',$tp);
$templateMain->assign('TN',$tn);
$templateMain->output();
/*
输出页脚
*/
$templateBottom->output();
?>