欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

新手提问分页类的一个输出循环显示分页遇到有关问题,求解

程序员文章站 2022-05-10 18:54:27
...
新手提问分页类的一个输出循环显示分页遇到问题,求解?

class PageClass {
private $total_record;//总记录
private $page_size;//页记录数
private $current_page;//当前页
private $total_page_size;//总页数
private $page_url; //页面url
private $page_start; //起始页
private $page_stop;//结束页
public $page_limit; //limit,
function __construct($total_record=0,$page_size=1,$current_page=1,$page_url) {
$this->total_record=$this->numeric($total_record);
$this->page_size=$this->numeric($page_size);
$this->current_page=$this->numeric($current_page);
$this->page_limit=($this->current_page*$this->page_size)-$this->page_size;
$this->page_url=$page_url;
if($this->current_page $this->current_page=1;
}

if($this->current_page $this->current_page=0;
}
$total_page_size = ceil($total_record/$page_size);

if($this->total_page_size $this->total_page_size=1;
}
if($this->current_page>$this->total_page_size){
$this->crrent_page=$this->total_page_size;
}
$this->page_start=$this->current_page;
$this->page_stop=$this->current_page+5;
if($this->page_stop>$this->total_page_size){
$this->page_stop=$this->total_page_size;
$this->page_start=$this->page_stop-5;
}
if($this->page_start $this->page_start=1;
if($this->page_stop > $this->total_page_size){
$this->page_stop=$this->total_page_size;
}
新手提问分页类的一个输出循环显示分页遇到有关问题,求解

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频