<?php     
			 
	     $navigation = "";
	    if(isset($_GET['from'])){
		$from=$_GET['from'];} 
		
		if (empty($from)){
		   $from=0;
		}
           
			 $sql_paging="select id from ".$table_name.$WHERECLOSE;
			 $rs_paging = mysql_query($sql_paging) or die(mysql_error());
	         $totrec = mysql_num_rows($rs_paging);
             //echo  $totrec ; 
     if ($totrec>$items_per_page)
		{
		  $prev=$from-$items_per_page;
		  $next=$from+$items_per_page;
		  $navigation.= "<b>Page : </b>";
			  if (!$from==0)
			  {
			       //$navigation.= "<a href='".$page_name."from=".$prev."'><b>&laquo;</b></a>&nbsp;";
			  }
			  else
				{
			      $navigation.= "&nbsp;";
				}
				
	  for ($i=1; $i<=ceil($totrec/$items_per_page);$i++)
		  {
			 if ((($from/$items_per_page)+1)==$i)
				 {
				 $navigation.= "<b>".$i." |"."</b> ";
				 }
			else
				{
				$startval=($i-1)*$items_per_page;
				$navigation.= "<a href='".$page_name."from=".$startval."'>".$i."</a>"." | ";
				}
		   }
		   
	    if($from<($totrec-$items_per_page))
		  {
		// $navigation.= "<a href='".$page_name."from=".$next."'><b>&raquo;</b></a>";
			}
		else {
		 $navigation.= "&nbsp;";
	  }
  }

	if($totrec > 0)
		{
			$to = $from + $items_per_page;
				//echo $totrec;
			  if($to < $totrec)
				{ $to = $to; }
			else
				{ $to = $totrec; }
				
					$from_show = $from+1;
			  $navigation = $navigation;
	  }
				 
?>
  
           
           