hi all,
this function working fine but when click on pagination number on webpage previous number is not disable
any help appre..
function show_paging($recordset_name=""){
if($recordset_name==""){
exit;
}else{
$Prev_Link = "";
$Next_Link = "";
$Page_Link = "";
$Query_String = "";
$Post_Vars = "";
$TotalPages = $this->RESULTS[$recordset_name]['total_pages'];
$Current_Page = $this->getCurrentPageName();
//echo $Current_Page;
$Segments = ceil($TotalPages / $this->RESULTS[$recordset_name]['segment_length']);
echo $Segments;
$FromCounter = (($this->RESULTS[$recordset_name]['current_segment']-1)* $this->RESULTS[$recordset_name]['segment_length']);
echo $FromCounter;
$FromCounter = $FromCounter<0?0:$FromCounter;
echo "ss".$FromCounter;
$PageRemained = ($TotalPages - $FromCounter);
if($PageRemained>=$this->RESULTS[$recordset_name]['segment_length']){
$ToCounter = $FromCounter + $this->RESULTS[$recordset_name]['segment_length'];
}else{
$ToCounter = $FromCounter + $PageRemained;
}
$ToCounter = $ToCounter<0?0:$ToCounter;
if($ToCounter > $FromCounter){
$Query_String = $this->getCurrentQuerystring();
$Query_String = $this->filterQueryString($Query_String);
$Post_Vars = $Query_String!=""?"&".$this->getPostVars():$this->getPostVars();
$Post_Vars = $Post_Vars=="&"?"":$Post_Vars;
$Query_String = $Query_String.$Post_Vars;
$Query_String = $Query_String!=""?"&".$Query_String:"";
if($this->RESULTS[$recordset_name]['current_segment']>=2){
$Prev_Link = "<a href='".$Current_Page."?pg_no=".($FromCounter-1).$Query_String."' class='".$this->CLASS_LINK."'><<Prev</a>";
}else{
$Prev_Link = "<span class='".$this->CLASS_NOLINK."'><<Prev</span>";
}
for($i=$FromCounter; $i<$ToCounter; $i++){
$Page_Link.=" ";
if($i==$this->CURRENT_PAGE){
$Page_Link.="<span class='".$this->CLASS_SELECTED."'>".($i+1)."</span>";
$this->CURRENT_QUERY_STRING = "pg_no=".$i."&".$Query_String;
}else{
$Page_Link.="<a href='".$Current_Page."?pg_no=".$i.$Query_String."' class='".$this->CLASS_LINK."'>".($i+1)."</a>";
}
}
$Next_Link.= " ";
if($this->RESULTS[$recordset_name]['current_segment']<$Segments){
$Next_Link.= "<a href='".$Current_Page."?pg_no=".$ToCounter.$Query_String."' class='".$this->CLASS_LINK."'>Next>></a>";
}else{
$Next_Link.= "<span class='".$this->CLASS_NOLINK."'>Next>></span>";
}
echo $Prev_Link.$Page_Link.$Next_Link;
}
}
}