<?
session_start();
require_once("../common/init.php");
require_once("security.inc.php");
$page = $_GET['page'];
/************* 查询 ******************/
$wheres  = " AND UserName='".$_SESSION['User_S']."'";
$keyword = trim($keyword);
if($keyword){
	$wheres .= " AND(Subject like '%$keyword%')";
}
//得到总记录数
$sql         = "select count(*) from question where 1 $wheres";
$rs          = $db->query($sql);
$pageSize    = 30;
$totalRecord = $db->result($rs,0,0);
$totalPage   = ceil($totalRecord/$pageSize);
if(!$page)$page = 1;
$offset      = ($page-1) * $pageSize;
//查询
$sql         = "select * from question where 1 $wheres order by ID DESC limit $offset,$pageSize";
$result      = $db->query($sql);
$pageList    = GetPageList($_SERVER[PHP_SELF],"page","15",$totalPage,$page);
while($QuesI = $db->fetch_array($result)){
	  $bg          = $bg=="#FFFFFF"?"#EEEEEE":"#FFFFFF";
	  $QuesI['bg'] = $bg;
	  $QuesItems[] = $QuesI;
}
$pagers = "共<font color='red'> $totalRecord </font>条记录,".
          "共<font color='red'> $totalPage </font>页,".
		  "当前是第<font color='red'> $page </font>页";
if($pageList) $pagers .= "$pageList[0] <br> $pageList[1]";
/************* end of 查询财务信息 *******************/
//输出
$smarty->assign("QuesItems",$QuesItems);
$smarty->assign("pagers",$pagers);
$smarty->assign("backUrl",GetUrl());
$smarty->display('user_infolist.html');
$db->close();
?>