phpcms 后台分页

2021-05-18 04:30

阅读:621

标签:后台   font   ram   include   分页类   array   nal   span   set   

php  代码
public function init() {
$where=‘‘;//条件
$page = $_GET[‘page‘] ? intval($_GET[‘page‘]) : ‘1‘;
$infos = $this->listinfo($where,‘‘, $page, 10);//查询数据
$pages = $this->pages;
include $this->admin_tpl(‘capture‘);//加载后台模板
}
/**
* 查询多条数据并分页类
* @param $where
* @param $order
* @param $page
* @param $pagesize
* @return unknown_type
*/
final public function listinfo($where = ‘‘, $order = ‘‘, $page = 1, $pagesize = 10, $key=‘‘, $setpages = 5,$urlrule = ‘‘,$array = array(), $data = ‘*‘) {
$where = to_sqls($where);
$this->number = $this->db->count($where);
$page = max(intval($page), 1);
$offset = $pagesize*($page-1);
$this->pages = pages($this->number, $page, $pagesize, $urlrule, $array, $setpages);
$array = array();
if ($this->number > 0) {
return $this->db->select($where, $data, "$offset, $pagesize", $order, ‘‘, $key);
} else {
return array();
}
}

html 代码

phpcms 后台分页

标签:后台   font   ram   include   分页类   array   nal   span   set   

原文地址:http://www.cnblogs.com/jiaoaozuoziji/p/7738257.html


评论


亲,登录后才可以留言!