0?$page:1; $start=($page-1)*$size; $pagestring="Move To :"; if (isset($_GET["page"])) $page=intval($_GET["page"],20); $query5="select SQL_CALC_FOUND_ROWS * from tbl_enquery_eit where companyid ='$companyid' and isactive=0 group by name,email,qdate order by qid desc limit ".$start.",".$size; $fquery =mysql_query($query5) or die(mysql_error()); $tot1=mysql_query("select found_rows()"); $tot1=mysql_result($tot1, 0, 0); $pagecount=ceil($tot1/$size); $page=$page>0 && $pagecount>=$page?$page:1; $start=($page-1)*$size; //========================== if(($_GET['page'] != 1) and ($_GET['page'] != "")) { $prev=$_GET['page'] - 1; $pagestring.=" << Prev "; } $pagingstart=($_GET['page']>6 ? $_GET['page']-5:1); $pagingend=$pagingstart+9; if($pagingend > $pagecount) { $pagingend=$pagecount; } if($pagingstart > 1) { $pagestring.="...."; } //echo $pagingstart; //echo $pagingend; //============================= for ($i=$pagingstart;$i<=$pagingend;$i++) { if ($_GET['page']==$i) $pagestring.=" $i"; else $pagestring.=" $i"; } //========================== if($pagingend < $pagecount) { $pagestring.="...."; } if($_GET['page'] != $pagecount) { if($_GET['page']==""){ $gpage=1; } else { $gpage=$_GET['page']; } $next=$gpage + 1; $pagestring.=" Next >> "; } if($_GET['mode']=='inbox'){ $qid=$_GET['qid']; mysql_query("update tbl_enquery_eit set isactive=1 where qid='$qid'") or die(mysql_error()); header("location:trash.html?msg=query Move To inbox"); } ?>