/** 總信息數 */ var $infoCount; /** 總頁數 */ var $pageCount; /** 每頁顯示條數 */ var $items; /** 當前頁碼 */ var $pageNo; /** 查詢的起始位置 */ var $startPos; /**  */ var $nex " /> 日韩av在线网,美女100%一区,韩日精品一区二区

色尼玛亚洲综合影院,亚洲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相當簡單的分頁類,轉載需保留來源!

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

主站蜘蛛池模板: 英吉沙县| 宁都县| 枣庄市| 台前县| 南开区| 六安市| 景泰县| 永嘉县| 武山县| 五常市| 道孚县| 桓仁| 汉川市| 株洲县| 六枝特区| 本溪| 柯坪县| 汽车| 台湾省| 桑日县| 句容市| 静海县| 天祝| 澎湖县| 铁岭县| 高雄县| 松滋市| 大连市| 商南县| 灌云县| 湾仔区| 祁东县| 灵石县| 本溪市| 仪征市| 凤翔县| 禄丰县| 呼玛县| 根河市| 谢通门县| 汉阴县|