<?php //session_start();?>
<head>
<style type="text/css">
  .paging
 {
    font-size: 10pt;
    font-weight:bold;
    font-family: Tahoma, Arial, Helvetica, sans-serif;
    color:#206BA4;
 }

</style>
</head>
<?php
$nume=$_SESSION['p'];
$pg='getajax.php';
$back=$_SESSION[bak];
$this1=$_SESSION[ths];
$limit=$_SESSION[lim];
//echo $limit;
$_SESSION[prt]='0';
//echo $_SESSION[strt].'uu'.$_SESSION[ro];
$max_pages= ceil($nume / $limit);
if($_SESSION[strt]=='1')
 $cur = ceil($_SESSION[start] / $limit)+1;
elseif($_SESSION[ro]=='1')
 $cur = ceil($_SESSION[row] / $limit)+1;
else
 $cur = ceil($_SESSION[row] / $limit)+1;
$eu=$_SESSION[eu2];
 //echo $_SESSION[ser];
                  if($nume <= $limit ){
						$retorno .= "<table align = 'center' dir='rtl'   class='paging' width='70%' style='padding-top:10px'><tr><td width='50%' >تعداد کل رکوردها : $nume</td><td  align='left' width='50%'></tr></table>";
				          }
						if($nume > $limit ){
								$retorno .= "<table dir='rtl' class='paging'  align = 'center' style='padding-top:10px'  border='0' width='70%'><tr>
								<td> <label> صفحه&nbsp;&nbsp;</label>";
                                 $retorno .= "<input name='txtpage'  id='txtpage' type='text' size='4' onkeyup='Eve1(event)'  /></td>";

							     $retorno .= "<td >تعداد کل رکوردها : $nume</td><td>";
								if($back >=0) {
							    $retorno .= "<a style='cursor:pointer;' onClick='page(\"$pg\",\"$back\",\"$_SESSION[ser]\")'>قبلي</a>";
								}
								$retorno .="</td><td align=center >";
								$i=0;
								$l=1;
								if ($nume>=60)
								{
								for($i=0;$i <60;$i=$i+$limit){
								if($i <> $eu){
								$retorno .=" <td><a  style='cursor:pointer;' onClick='page(\"$pg\",\"$i\",\"$_SESSION[ser]\")'  >$l</a></td> ";
								}
								else
								{
								   $retorno .= "<td style='font-size:14pt;'>$cur</td>";
								}

                                   $l=$l+1;
								}
								}
								elseif ($nume<60)
								{
								for($i=0;$i <$nume;$i=$i+$limit){
								if($i <> $eu){
							    $retorno .= " <td><a onClick='page(\"$pg\",\"$i\",\"$_SESSION[ser]\")' style='cursor:pointer;'>$l</a></td> ";
								}
								else
								{
                                 //if($l==$cur)
								  $retorno .= "<td style='font-size:14pt;'>$cur</td>";
								}

								$l=$l+1;
								}
								}
								$retorno .="<td  align='right' >";
								if($this1 <$nume) {
								$retorno .= "<a onClick='page(\"$pg\",\"$_SESSION[nex]\",\"$_SESSION[ser]\")'  style='cursor:pointer;'>بعدي</a>";
								}
								 $retorno .= "</td><td align='left'>صفحه $cur از $max_pages";
								$retorno .= "</td></tr></table>";
}
								?>
