/** 總信息數 */ var $infoCount; /** 總頁數 */ var $pageCount; /** 每頁顯示條數 */ var $items; /** 當前頁碼 */ var $pageNo; /** 查詢的起始位置 */ var $startPos; /**  */ var $nex " /> 亚洲国产成人av,一区二区激情视频,天堂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相當簡單的分頁類,轉載需保留來源!

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

主站蜘蛛池模板: 盐亭县| 潮安县| 云浮市| 青田县| 云霄县| 衡东县| 筠连县| 新丰县| 武鸣县| 遂宁市| 邻水| 新津县| 泽库县| 临西县| 农安县| 昌吉市| 安塞县| 绩溪县| 苏州市| 兰州市| 石门县| 旅游| 大方县| 娄烦县| 大姚县| 土默特右旗| 东平县| 榆林市| 永济市| 伊春市| 襄樊市| 平顶山市| 睢宁县| 佛学| 南投县| 广汉市| 枞阳县| 灵台县| 渝中区| 遂川县| 奉化市|