/** 總信息數 */ var $infoCount; /** 總頁數 */ var $pageCount; /** 每頁顯示條數 */ var $items; /** 當前頁碼 */ var $pageNo; /** 查詢的起始位置 */ var $startPos; /**  */ var $nex " /> 中文字幕亚洲情99在线,欧美性猛xxx,久久精品亚洲麻豆av一区二区

色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

php相當簡單的分頁類

class Helper_Page{

/** 總信息數 */
var $infoCount;
/** 總頁數 */
var $pageCount;
/** 每頁顯示條數 */
var $items;
/** 當前頁碼 */
var $pageNo;
/** 查詢的起始位置 */
var $startPos;
/**  */
var $nextPageNo;
/**  */
var $prevPageNo;

function Helper_Page($infoCount, $items, $pageNo)
{
$this->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 < 1)
$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 < 1)
{
$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;
}
}

php技術php相當簡單的分頁類,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 古丈县| 西丰县| 威远县| 乾安县| 海宁市| 沧源| 山西省| 大港区| 安顺市| 梁山县| 新疆| 东海县| 富川| 东平县| 龙海市| 陕西省| 马边| 乌恰县| 大渡口区| 舞钢市| 大同市| 临海市| 大同市| 满洲里市| 海兴县| 阳谷县| 炎陵县| 亳州市| 基隆市| 新晃| 德江县| 上饶县| 防城港市| 夏邑县| 和林格尔县| 黄梅县| 剑川县| 弥勒县| 城市| 白玉县| 吴忠市|