//--------------------------------
// Get 函数
//--------------------------------
//取记录总数
function GetTotalRec(){
$SQL="SELECT Count(*) AS total FROM ".$this->Table." ".$this->Condition;
$stmt = OCIParse($this->LinkId,$SQL);
$bool = OCIExecute($stmt);
if (!$bool) {
echo "连接失败!";
OCILogoff($this->LinkId);
exit;
}
else {
OCIFetch($stmt);
$this->Total=OCIResult($stmt,1);
}
OCIFreeStatement($stmt);
}
//取总页数、当前页
function GetPage(){
$this->TPages=ceil($this->Total/$this->MaxLine);
$this->CPages=ceil($this->Offset/$this->MaxLine)+1;
}
//取总组数、当前组
function GetGroup() {
$this->TGroup=ceil($this->TPages/$this->PGroup);
$this->CGroup=ceil($this->CPages/$this->PGroup);
}
|