自定义分页
$info1 = $GLOBALS['DB']->get_row("SELECT COUNT(*) FROM admin_trouble WHERE `engineman` = '{$_SESSION['name']}'");
// echo $_SESSION['name'];exit;
$count = $info1['COUNT(*)'];
$page = $_GET['page'] ? $_GET['page'] : 1;
$page_size = 2;
$start = ($page-1) * $page_size;
$end = $page_size;
$maxpage = ceil($count/$page_size);
$next = $page + 1;
$prev = $page - 1;
// echo $end;
$info = $GLOBALS['DB']->get_results("SELECT * FROM admin_trouble WHERE `engineman` = '{$_SESSION['name']}' LIMIT $start,$end");
// var_dump($info);exit;
if($page == 1){
$string = "<li>当前是第{$page}页</li>";
$string .="<a href=/log.php?act=fenye&page=$next>下一页</a>";
}
if($page > 1 && $page < $maxpage){
$string = "<li><a href=/log.php?act=fenye&page=$prev>上一页</a></li>";
$string .="<li><a href=/log.php?act=fenye&page=1>首页</a></li>";
$string .= "<li>当前是第{$page}页</li>";
$string .="<li><a href=/log.php?act=fenye&page=$next>下一页</a></li>";
}
if($page == $maxpage){
$string = "<li><a href=/log.php?act=fenye&page=1>首页</a></li>";
$string .= "<li>当前是第{$page}页</li>";
$string .="<li><a href=/log.php?act=fenye&page=$prev>上一页</a></li>";
}