class CPageCtrl
{
var $CurrentPage = 0;
var $RecordCount;
var $NumPerPage = 15;
var $QueryString;
var $TotalPage;
var $ShowPage;
function CPageCtrl($CurrentPage, $RecordCount, $NumPerPage=15, $QueryString)
{
$this->RecordCount = $RecordCount;
$this->NumPerPage = $NumPerPage;
$this->QueryString = $QueryString;
if ($RecordCount - 10 > 0) {
$nCount = $RecordCount - 10;
$this->TotalPage = ceil($nCount / $NumPerPage) + 1;;
}
else {
$this->TotalPage = 1;
}
if ($CurrentPage <= 0) {
$this->CurrrentPage = 1;
}
else if ($CurrentPage > $this->TotalPage) {
$this->CurrentPage = $this->TotalPage;
}
else {
$this->CurrentPage = $CurrentPage;
}
if ($this->TotalPage == 0) {
$this->ShowPage = 0;
}
else {
$this->ShowPage = $this->CurrentPage;
}
}
function getHTML()
{
$OutputHtml = "";
$NextPage = $this->CurrentPage + 1;
$PrevPage = $this->CurrentPage - 1;
if ($this->CurrentPage == 1 || $this->TotalPage == 0) {
$OutputHtml .= "QueryString . "1'\">\n";
}
else {
$OutputHtml .= "QueryString . "1'\">\n";
}
if ($this->CurrentPage == 1 || $this->TotalPage == 0) {
$OutputHtml .= "QueryString . $PrevPage . "'\">\n";
}
else {
$OutputHtml .= "QueryString . $PrevPage . "'\">\n";
}
if ($this->TotalPage == 0){
$OutputHtml .= "