您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

五 分页类

2024/2/20 14:38:11发布28次查看
分页
infocount = $infocount;
        $this->items     = $items;
        $this->pageno    = $pageno;
        $this->pagecount = $this->getpagecount();
        $this->adjustpageno();
        $this->startpos  = $this->getstartpos();
    }
    function adjustpageno()
    {
        if($this->pageno == '' || $this->pageno             $this->pageno = 1;
        if ($this->pageno > $this->pagecount)
            $this->pageno = $this->pagecount;
    }
    /**
     * 下一页
     */
    function gotonextpage()
    {
        $nextpageno = $this->pageno + 1;
        if ($nextpageno > $this->pagecount)
        {
            $this->nextpageno = $this->pagecount;
            return false;
        }
        $this->nextpageno = $nextpageno;
        return true;
    }
    /**
     * 上一页
     */
    function gotoprevpage()
    {
        $prevpageno = $this->pageno - 1;
        if ($prevpageno         {
            $this->prevpageno = 1;
            return false;
        }
        $this->prevpageno = $prevpageno;
        return true;
    }
    function getpagecount()
    {
        return ceil($this->infocount / $this->items);
    }
    function getstartpos()
    {
        return ($this->pageno - 1)  * $this->items;
    }
}
?>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product