<?php
require_once("paging.php");
$totalRecord = 20;
$recordPerPage = 4;
$pageURL = $_SERVER['PHP_SELF'];
$maxPaging = 3;
$userPaging = new paging($totalRecord , $recordPerPage , $pageURL ,$maxPaging);
$currPage = $_GET['page'];
//
//set max number of page to be displayed
//
print "we have $totalRecord , and we want to display $recordPerPage per page, and \n we want to display $maxPaging number of paging per page";
print "<br />";
$_GET['offset'] = (isset($_GET['offset'] )? $_GET['offset'] : 0);
for($i=$_GET['offset'] ; $i < $_GET['offset']+$recordPerPage ; $i++)
{
print "element #:" . ($i+1) ;
print "<br />";
}
print $userPaging->display_paging($currPage);
?>
|