首页 > 后端开发 > php教程 > 新手提问分页类的一个输出循环显示分页遇到有关问题,求解

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

WBOY
发布: 2016-06-13 12:38:19
原创
848 人浏览过

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

<br>
<?php <br />
class PageClass {<br>
	private $total_record;//总记录<br>
	private $page_size;//页记录数<br>
	private $current_page;//当前页<br>
	private $total_page_size;//总页数<br>
	private $page_url;   //页面url<br>
	private $page_start;  //起始页<br>
	private $page_stop;//结束页<br>
	public $page_limit;  //limit,<br>
    function __construct($total_record=0,$page_size=1,$current_page=1,$page_url) {<br>
    	$this->total_record=$this->numeric($total_record);<br>
    	$this->page_size=$this->numeric($page_size);<br>
    	$this->current_page=$this->numeric($current_page);<br>
    	$this->page_limit=($this->current_page*$this->page_size)-$this->page_size;<br>
        $this->page_url=$page_url;<br>
        if($this->current_page
        	$this->current_page=1;<br>
        }<br>
<br>
        if($this->current_page
        	$this->current_page=0;<br>
        }<br>
        $total_page_size = ceil($total_record/$page_size);<br>
<br>
        if($this->total_page_size
        	$this->total_page_size=1;<br>
        }<br>
        if($this->current_page>$this->total_page_size){<br>
        	$this->crrent_page=$this->total_page_size;<br>
        }<br>
        $this->page_start=$this->current_page;<br>
        $this->page_stop=$this->current_page+5;<br>
        if($this->page_stop>$this->total_page_size){<br>
        	$this->page_stop=$this->total_page_size;<br>
        	$this->page_start=$this->page_stop-5;<br>
        }<br>
        if($this->page_start
        	$this->page_start=1;<br>
        	if($this->page_stop > $this->total_page_size){<br>
        		$this->page_stop=$this->total_page_size;<br>
        	} <div class="clear">
                 
              
              
        
            </div>
登录后复制
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板