//——————————– // 专门的工作函数
//——————————– //读取记录
//首要办事函数,依照所给的原则从表中读取相应的记录
//返回值是五个二维数组,Result[记录号][字段名] function ReadList() {
$SQL=”SELECT * FROM “.$this->Table.” “.$this->Condition.” O本田CR-VDER
BY “.$this->Id.” DESC”; $stmt = OCIParse; $bool = OCIExecute { echo
“连接失利!”; OCILogoff; exit; } else { $ncols = OCINumCols; for ( $i =
1; $i <= $ncols; $i++ State of Qatar $column_name[$i] = OCIColumnName; $k=0;
for($j=0;$j<$this->StartRec+$this->Offset;$j++) OCIFetch;
for($j=0;$j<$this->MaxLine;$j++){ if{ $k++; for
$temp[$column_name[$i]]=OCIResult; $this->Result[]=$temp; }
else break; } $this->Number=$k; } OCIFreeStatement; return
$this->Result; } //读最新的记录 //topnum内定要读出的记录数 function
ReadTopList{ $SQL=”SELECT * FROM “.$this->Table.”
“.$this->Condition.” O福睿斯DE凯雷德 BY “.$this->Id.” DESC”; $stmt =
OCIParse; $bool = OCIExecute { echo “连接失败!”; OCI图标ff; exit; }
else { $ncols = OCINumCols; for ( $i = 1; $i <= $ncols; $i++ )$column_name[$i] = OCIColumnName; $k=0; for{ if{ $k++; for
$temp[$column_name[$i]]=OCIResult; $this->TopResult[]=$temp; }
else break; } $this->TopNumber=$k; } OCIFreeStatement; return
$this->TopResult; } //————————— // 分页相关
//————————— //展现当前页及总页数
//本函数在GetPage(卡塔尔(قطر‎后调用。 function ThePage(卡塔尔国 { echo
“第”.$this->CPages.”页/共”.$this->TPages.”页”; } //展现翻页按钮//此函数要在GetPage(卡塔尔函数之后调用 //呈现下页、上页,并累计要传递的参数
function Page(卡塔尔国 { $k=count; $strQuery=””; //生成三个要传递参数字串 for{
$strQuery.=”&”.$this->PageQuery[$i][key].”=”.$this->PageQuery[$i][value];
} return $strQuery; } function PrePage{
$prev=$this->Offset-$this->MaxLine; if echo “<A
href=$PHP_SELF?offset=”.$prev.$strQuery.”
class=newslink>上一页</A>”; else if($this->TheFirstPage!=NULL)
echo “<A href=”.$this->TheFirstPage.”
class=newslink>上一页</A>”; else echo “上一页”; } function
NexPage{ $next=$this->Offset+$this->MaxLine;
$k=$this->Total-$this->StartRec; if echo “<A
href=$PHP_SELF?offset=”.$next.$strQuery.”
class=newslink>下一页</A>”; else echo “下一页”; }
//———————————— // 记录分组
//———————————- //突显分组 function NumPage(State of Qatar {
$first=*+1; $last=($first+$this->PGroup > $this->TPages)? :;
$pr=?*:?*$this->MaxLine):;
$ne=($this->CGroup*$this->PGroup+1<=$this->TPages)?($this->CGroup*$this->PGroup+1):?*$this->MaxLine卡塔尔:;
$k=count; $strQuery=””; //生成叁个要传送参数字串 for{
$strQuery.=”&”.$this->PageQuery[$i][key].”=”.$this->PageQuery[$i][value];
} if echo “<A href=$PHP_SELF?offset=”.$prev.$strQuery.” > <<
</a>”; for($i=$first;$i<$last;$i++) { if{
$current=*$this->MaxLine; echo “<A
href=$PHP_SELF?offset=”.$current.$strQuery.” >”.$i.”</a> “; }
else echo “<font color=#e00729>”.$i.”</font> “; } if echo “<A
href=$PHP_SELF?offset=”.$next.$strQuery.” > >> </a>”; }
//******end class } ?>

发表评论

电子邮件地址不会被公开。 必填项已用*标注