<?php session_start();
if($_SESSION[invcox] == ""){
header("location:login.php?action=need");
}else{
include("config.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Bangladesh Visa Status</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<?php include("calendar.php");?>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=yes,width=1100,height=550,left = 100,top = 50');");
}
// End -->
</script>
<style type="text/css">
<!--
.style3 {font-size: 10px}
.style73 {font-family: "Times New Roman", Times, serif; font-size: 16px;}
-->
</style>
</head>
<body onload="show_form('ajax_genarel_form.php');">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="box-wrap">
<tr>
<td><?php include("top.php");?></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="100%" height="15" colspan="13" align="left" class="link2">&nbsp;</td>
</tr>
<tr>
<td height="30" align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><a href="status.php?country=&amp;status1=1 Entry"><strong>1)&nbsp;Entry</strong></a></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><a href="status.php?country=&amp;status1=2 Receive F.C."><strong>2) Receive F.C.</strong></a></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=3 OnProcess">3) OnProcess</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=4 Submitted">4) Submitted</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=5 Collect F.Imm">5) Collect F. Imm</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=6 Collect F.Emb">6) Collect F. Emm</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=7 Delivery B.Co">7) Delivery By.Co</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=8 Delivery B.Email">8) Delivery By Email</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=9 Completed">9) Completed</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=j Due">Due</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=k Hold">Hold</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=l Cancell">Cancel</a></strong></td>
<td align="center" valign="middle" bordercolor="#FFFFFF" background="images/place_bg.jpg" class="location"><strong><a href="status.php?country=&amp;status1=m Refunded">Refunded</a></strong></td>
</tr>
<tr>
<td colspan="13" align="right"><form id="form1" name="form1" method="get" action="">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#488B1F" bgcolor="#FFFFFF">
<tbody>
<tr>
<td width="18%" align="center" valign="middle" bordercolor="#666666">Search By Country:
<select name="country" id="country">
<option value="" selected="selected">All Country</option>
<option value="Thailand" <?php if($_GET[country] == "Thailand"){echo 'selected="selected"';}?>>Thailand</option>
<option value="Singapore" <?php if($_GET[country] == "Singapore"){echo 'selected="selected"';}?>>Singapore</option>
<option value="Malaysia" <?php if($_GET[country] == "Malaysia"){echo 'selected="selected"';}?>>Malaysia</option>
<option value="Cambodia" <?php if($_GET[country] == "Cambodia"){echo 'selected="selected"';}?>>Cambodia</option>
<option value="Vietnam" <?php if($_GET[country] == "Vietnam"){echo 'selected="selected"';}?>>Vietnam</option>
<option value="Sri Lanka" <?php if($_GET[country] == "Sri Lanka"){echo 'selected="selected"';}?>>Sri Lanka</option>
<option value="Dubai / UAE" <?php if($_GET[country] == "Dubai / UAE"){echo 'selected="selected"';}?>>Dubai / UAE</option>
<option value="China" <?php if($_GET[country] == "China"){echo 'selected="selected"';}?>>China</option>
<option value="Egypt" <?php if($_GET[country] == "Egypt"){echo 'selected="selected"';}?>>Egypt</option>
<option value="Philippine" <?php if($_GET[country] == "Philippine"){echo 'selected="selected"';}?>>Philippine</option>
<option value="Myanmar" <?php if($_GET[country] == "Myanmar"){echo 'selected="selected"';}?>>Myanmar</option>
<option value="Nepal" <?php if($_GET[country] == "Nepal"){echo 'selected="selected"';}?>>Nepal</option>
<option value="Turkey" <?php if($_GET[country] == "Turkey"){echo 'selected="selected"';}?>>Turkey</option>
<option value="Indian" <?php if($_GET[country] == "Indian"){echo 'selected="selected"';}?>>Indian</option>
<option value="Umrah Hajj" <?php if($_GET[country] == "Umrah Hajj"){echo 'selected="selected"';}?>>Umrah Hajj</option>
<option value="Saudi Arabia" <?php if($_GET[country] == "Saudi Arabia"){echo 'selected="selected"';}?>>Saudi Arabia</option>
<option value="Indian" <?php if($_GET[country] == "Indian"){echo 'selected="selected"';}?>>Indian</option>
<option value="Russia" <?php if($_GET[country] == "Russia"){echo 'selected="selected"';}?>>Russia</option>
<option value="Netherlands" <?php if($_GET[country] == "Netherlands"){echo 'selected="selected"';}?>>Netherlands</option>
<option value="New Zealand" <?php if($_GET[country] == "New Zealand"){echo 'selected="selected"';}?>>New Zealand</option>
<option value="Iran" <?php if($_GET[country] == "Iran"){echo 'selected="selected"';}?>>Iran</option>
<option value="Mauritius" <?php if($_GET[country] == "Mauritius"){echo 'selected="selected"';}?>>Mauritius</option>
<option value="Morocco" <?php if($_GET[country] == "Morocco"){echo 'selected="selected"';}?>>Morocco</option>
<option value="Brazil" <?php if($_GET[country] == "Brazil"){echo 'selected="selected"';}?>>Brazil</option>
<option value="Argentina" <?php if($_GET[country] == "Argentina"){echo 'selected="selected"';}?>>Argentina</option>
<option value="Brunei" <?php if($_GET[country] == "Brunei"){echo 'selected="selected"';}?>>Brunei</option>
<option value="Taiwan" <?php if($_GET[country] == "Taiwan"){echo 'selected="selected"';}?>>Taiwan</option>
<option value="Uzbekistan" <?php if($_GET[country] == "Uzbekistan"){echo 'selected="selected"';}?>>Uzbekistan</option>
<option value="USA" <?php if($_GET[country] == "USA"){echo 'selected="selected"';}?>>USA</option>
<option value="Hong Kong" <?php if($_GET[country] == "Hong Kong"){echo 'selected="selected"';}?>>Hong Kong</option>
</select></td>
<td width="21%" align="center" valign="middle" bordercolor="#666666">Search By Status: 
<select name="status1" id="status1" onchange="this.form.submit()">
<option value="" selected="selected" <?php if($_GET[status1] == ""){echo 'selected="selected"';}?>>All</option>
<option value="1 Entry" <?php if($_GET[status1] == "1 Entry"){echo 'selected="selected"';}?>>1 Entry</option>
<option value="2 Receive F.C." <?php if($_GET[status1] == "2 Receive F.C."){echo 'selected="selected"';}?>>2 Receive F.C.</option>
<option value="3 OnProcess" <?php if($_GET[status1] == "3 OnProcess"){echo 'selected="selected"';}?>>3 OnProcess</option>
<option value="4 Submitted" <?php if($_GET[status1] == "4 Submitted"){echo 'selected="selected"';}?>>4 Submitted</option>
<option value="5 Collect F.Imm" <?php if($_GET[status1] == "5 Collect F.Imm"){echo 'selected="selected"';}?>>5 Collect F.Imm</option>
<option value="6 Collect F.Emb" <?php if($_GET[status1] == "6 Collect F.Emb"){echo 'selected="selected"';}?>>6 Collect F.Emb</option>
<option value="7 Delivery B.Co" <?php if($_GET[status1] == "7 Delivery B.Co"){echo 'selected="selected"';}?>>7 Delivery B.Co</option>
<option value="8 Delivery B.Email" <?php if($_GET[status1] == "8 Delivery B.Email"){echo 'selected="selected"';}?>>8 Delivery B.Email</option>
<option value="9 Completed" <?php if($_GET[status1] == "9 Completed"){echo 'selected="selected"';}?>>9 Completed</option>
<option value="j Due" <?php if($_GET[status1] == "j Due"){echo 'selected="selected"';}?>>j Due</option>
<option value="k Hold" <?php if($_GET[status1] == "k Hold"){echo 'selected="selected"';}?>>k Hold</option>
<option value="l Cancell" <?php if($_GET[status1] == "l Cancell"){echo 'selected="selected"';}?>>l Cancell</option>
<option value="m Refunded" <?php if($_GET[status1] == "m Refunded"){echo 'selected="selected"';}?>>m Refunded</option>
</select></td>
<td width="20%" align="center" bordercolor="#666666">Submit / Collect / Delivery 
<select name="orderby" id="orderby">
<option value="" selected="selected" <?php if($_GET[orderby] == ""){echo 'selected="selected"';}?>>All</option>
<option value="dep" <?php if($_GET[orderby] == "dep"){echo 'selected="selected"';}?>>Submit Date</option>
<option value="visa7" <?php if($_GET[orderby] == "visa7"){echo 'selected="selected"';}?>>Collect Date</option>
<option value="visa8" <?php if($_GET[orderby] == "visa8"){echo 'selected="selected"';}?>>Delivery Date</option>
</select></td>
<td width="14%" align="center" bordercolor="#666666">Travel Date
  <select name="select2" id="select2">
    <option value="" selected="selected" <?php if($_GET[orderby] == ""){echo 'selected="selected"';}?>>All</option>
    <option value="dep" <?php if($_GET[orderby] == "dep"){echo 'selected="selected"';}?>>Travel Date</option>
    </select></td>
<td width="13%" align="center" bordercolor="#666666">Entry By :
  <select name="auser" id="auser">
  
<?php 
  $dsresult=mysql_query("select user from  visa where user!=''  group by user order by user asc ");
$dsrow=mysql_fetch_array($dsresult);

?>

    <option value="" <?php if($_GET[auser] == ""){echo 'selected="selected"';}?>>All</option>
<?php do{ ?>
    <option value="<?php echo $dsrow[user]; ?>" <?php if($_GET[auser] == "$dsrow[user]"){echo 'selected="selected"';}?>><?php echo $dsrow[user]; ?></option>
	
	<?php 
	}while($dsrow=mysql_fetch_array($dsresult));
	?>
	
  </select></td>
<td width="14%" align="center" bordercolor="#666666"><input type="submit" name="submit" id="submit" value="Search" /></td>
</tr>
</tbody>
</table>
</form></td>
</tr>
<tr>
<td colspan="13" align="center"><?php if($_GET[info]!=""){echo '<span class="red"><strong>'.$_GET[info].'</strong></span>';}?></td>
</tr>
<?php 
$page_name="status.php?id=$_GET[id]&country=$_GET[country]&status1=$_GET[status1]&orderby=$_GET[orderby]&submit=Search"; 
$limit=$_GET['limit'];
$start=$_GET['start'];								
if(!($start > 0)) {                  
$start = 0;
}
$eu = ($start - 0); 
//this is coming from config /// if($_POST[paiging]!=""){$paiging=$_POST[paiging];}else{$paiging='30';}
$limit = '50';               
$this1 = $eu + $limit; 
$back = $eu - $limit; 
$next = $eu + $limit;
if($_GET[status1]!=""){$status=" and status1='$_GET[status1]' ";}else{$status="";}
if($_GET[country]!=""){$country=" and country='$_GET[country]' ";}else{$country="";}
if($_GET[auser]!=""){$auser=" and user='$_GET[auser]' ";}else{$auser="";}

$ant=mysql_query("select * from visa where id!='' $status $country $auser group by billno order by billno asc ");
$nume=mysql_num_rows($ant);
?>
<tr>
<td colspan="13" class="round_box"><table border="0" align = "center" cellpadding="0" cellspacing="2">
<tr>
<?php // if our variable $back is equal to 0 or more then only we will display the link to move back //
if($back >=0) { 
echo  "<td  align='left' class='paiging' width='60px'><a href='$page_name&start=$back&limit=$limit'><< PREV</a></td>"; 
} 
//// Let us display the page links at  center. We will not display the current page as a link //
?>
<?php 
$i=0;
$l=1;
for($i=0;$i < $nume;
$i=$i+$limit){
if($i <> $eu){
?>
<td width="25px" align="center" class="paiging"><?php 
echo " <a href='$page_name&start=$i&limit=$limit'>$l</a>";
?></td>
<?php 
}else{echo "<td align='center' width='25px'><span class='paiging_red'>$l</span></td>";}
/// Current page is not displayed as link and given font color red
$l=$l+1;
}
?>
<?php ///////////// If we are not in the last page then Next link will be displayed. Here we check that /////
if($this1 < $nume) { 
echo "<td  align='right' class='paiging' width='60px'><a href='$page_name&start=$next&limit=$limit'>NEXT >></a></td>";} 
?>
</tr>
</table>
<table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#999999">
<tr>
<td colspan="21" bgcolor="#6EA749" class="location"><strong>Cost</strong></td>
</tr>
<tr>
<td bgcolor="#CCCCFF"><strong>Sr.</strong></td>
<td width="72" align="center" bgcolor="#CCCCFF"><strong>Entry<br />
Date</strong></td>
<td width="49" align="center" bgcolor="#CCCCFF"><strong>Acc </strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>Agency</strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>Country</strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>Passport<br />
Holder Name</strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>PP No</strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>Vendor</strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>Reference /<br />
Tracking No</strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>Vendor<br /> 
  Fee<br />
</strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>Others Cost</strong></td>
<td align="center" bgcolor="#CCCCFF"><strong>Office Cost</strong></td>
<td width="42" align="center" bgcolor="#CCCCFF"><strong>Inv<br />
No</strong></td>
<td width="45" align="center" bgcolor="#CCCCFF"><strong>All<br />
  Info</strong></td>
<td width="52" align="center" bgcolor="#CCCCFF"><strong>                Bill</strong></td>
<td width="55" align="center" bgcolor="#CCCCFF"><strong>Paid</strong></td>
<td width="47" align="center" bgcolor="#CCCCFF"><strong>Due</strong></td>
<td width="1" align="center" bgcolor="#999999">&nbsp;</td>
<td align="center" bgcolor="#CCCCFF"><strong>Edit</strong></td>
<td width="77" align="center" bgcolor="#CCCCFF"><strong>Entry By</strong></td>
<td width="140" align="center" bgcolor="#CCCCFF"><strong>Status</strong></td>
</tr>
<?php 
if($_GET[orderby] == ""){$orderby="status1";}else{
$orderby="$_GET[orderby]";
}
$result=mysql_query("select * from  visa  where id!='' $status $country $auser group by billno order by $orderby asc  limit $eu, $limit");
$row=mysql_fetch_array($result);
if($row!=""){
$sr=$eu;
$status23=$row[status1];
do{
if($status23!=$row[status1]){
?>
<tr>
<td height="10" colspan="21" bgcolor="#CCCCCC">&nbsp;</td>
</tr>
<?php 
}
$xresult=mysql_query("select sum(total_payeble)as total_payeble,sum(payment_amount)as payment_amount from  visa where billno='$row[billno]'");
$xrow=mysql_fetch_array($xresult);
$sr=$sr+1;    
?>
<tr>
<td width="29" height="25" bgcolor="#D1EFEF"><?php echo $sr;?></td>
<td height="25" align="center" bgcolor="#FFFFFF"><?php echo dtformat($row[date1]);?></td>
<td height="25" align="center" bgcolor="#D1EFEF"><?php
$dresult=mysql_query("select cus_type,company from client where id='$row[customer]' limit 1");
$drow=mysql_fetch_array($dresult);
echo substr($drow[cus_type],0,1);
echo "-";
echo $row[customer];?>
&nbsp;</td>
<td width="69" height="25" align="left" bgcolor="#C4E2AF"><?php 
echo $drow[company];?></td>
<td width="75" height="25" align="left" bgcolor="#FFFFFF"><?php 
echo $row[country];  ?></td>
<td width="213" height="25" align="center" bgcolor="#D1EFEF"><span class="style3">
<?php
$rxresult=mysql_query("select name from  visa where billno='$row[billno]'");
$rxrow=mysql_fetch_array($rxresult);
do{
echo " $rxrow[name]  ";
echo "<br />";
}while($rxrow=mysql_fetch_array($rxresult));
?></span></td>
<td width="85" height="25" align="center" bgcolor="#C4E2AF"><?php
$rxresult=mysql_query("select pp from  visa where billno='$row[billno]'");
$rxrow=mysql_fetch_array($rxresult);
do{
echo " $rxrow[pp]  ";
echo "<br />";
}while($rxrow=mysql_fetch_array($rxresult));
?></td>
<td width="106" align="center" bgcolor="#D1EFEF"><span class="style73"><?php echo $row[visa11]; ?></span></td>
<td width="200" align="center" bgcolor="#9FCA84" class="style73"><?php echo $row[visa6]; ?></td>
<td width="83" height="25" align="center" bgcolor="#D1EFEF"><?php echo $row[visa12]; ?></td>
<td width="83" height="25" align="center" bgcolor="#C4E2AF"><?php echo $row[visa13]; ?></td>
<td width="83" height="25" align="center" bgcolor="#FFFFFF"><?php echo $row[visa14]; ?></td>
<td height="25" align="center" bgcolor="#FFA6A6"><a href="javascript:popUp('print_visa_invoice_voucher.php?id=<?php echo $row[billno];?>');"><?php echo $row[billno];?></a></td>
<td height="25" align="center" bgcolor="#D1EFEF" class="link"><a href="javascript:popUp('print_visa_client_information.php?id=<?php echo $row[billno];?>');"><?php echo $row[billno];?></a></td>
<td height="25" align="center" bgcolor="#FFA6A6" class="link"><?php echo number_format($row[total_payeble]);?></td>
<td height="25" align="center" bgcolor="#C4E2AF" class="link"><?php echo number_format($row[payment_amount]);?></td>
<td height="25" align="center" bgcolor="#FFA6A6" class="link"><?php echo $row[due];?></td>
<td align="center" bgcolor="#999999" class="link">&nbsp;</td>
<td width="35" align="center" bgcolor="#FFFFFF" class="link"><?php 
$show=0;
$today=date("Y-m-d");
if($row[status] == '0'){ 
if($row[date1] == $today){
//-----------------
if($_SESSION[invcox] == "$row[user]"){
$show=1;
?>
<a href="edit_hotel.php?id=<?php echo $row[billno];?>">Edit</a>
<?php }}} 
if($show == '0'){ 
$ssresult=mysql_query("select * from user WHERE userid='$_SESSION[invcox]' and status='1'");
$ssrow=mysql_fetch_array($ssresult);
if($ssrow[editvisa] == '1'){
$today=date("Y-m-d");
$datenewface = date('Y-m-d', strtotime("+$ssrow[editvisadays] day", strtotime("$row[date1]")));
if($today<="$datenewface"){
?>
<a href="edit_hotel.php?id=<?php echo $row[billno];?>">Edit</a>
<?php }}}?> </td>
<td width="77" height="25" align="center" bgcolor="#D1EFEF" class="link"><?php echo $row[user];?></td>
<td align="center" bgcolor="#FFFFFF" class="link">
<?php 
if($ssrow[editstatus] == '1'){
$today=date("Y-m-d");
$datenewface = date('Y-m-d', strtotime("+$ssrow[statusdays] day", strtotime("$row[date1]")));
if($today<="$datenewface"){
?>
<form id="form2" name="form2" method="post" action="update_status.php">
<input name="country" type="hidden" id="country" value="<?php  echo $_GET[country];?>" />
<input name="status2" type="hidden" id="status2" value="<?php  echo $_GET[status1];?>" />
<input name="id" type="hidden" value="<?php  echo $row[id];?>" />
<input name="db" type="hidden" value="visa" />
<input name="url" type="hidden" value="status.php" />
<input name="start" type="hidden" value="<?php  echo $_GET[start];?>" />
<input name="limit" type="hidden" value="<?php  echo $_GET[limit];?>" />
<select name="status1" id="status1" onchange="this.form.submit()">
<option value="1 Entry" selected="selected" <?php if($row[status1] == "1 Entry"){echo 'selected="selected"';}?>>1 Entry</option>
<option value="2 Receive F.C." <?php if($row[status1] == "2 Receive F.C."){echo 'selected="selected"';}?>>2 Receive F.C.</option>
<option value="3 OnProcess" <?php if($row[status1] == "3 OnProcess"){echo 'selected="selected"';}?>>3 OnProcess</option>
<option value="4 Submitted" <?php if($row[status1] == "4 Submitted"){echo 'selected="selected"';}?>>4 Submitted</option>
<option value="5 Collect F.Imm" <?php if($row[status1] == "5 Collect F.Imm"){echo 'selected="selected"';}?>>5 Collect F.Imm</option>
<option value="6 Collect F.Emb" <?php if($row[status1] == "6 Collect F.Emb"){echo 'selected="selected"';}?>>6 Collect F.Emb</option>
<option value="7 Delivery B.Co" <?php if($row[status1] == "7 Delivery B.Co"){echo 'selected="selected"';}?>>7 Delivery B.Co</option>
<option value="8 Delivery B.Email" <?php if($row[status1] == "8 Delivery B.Email"){echo 'selected="selected"';}?>>8 Delivery B.Email</option>
<option value="9 Completed" <?php if($row[status1] == "9 Completed"){echo 'selected="selected"';}?>>9 Completed</option>
<option value="j Due" <?php if($row[status1] == "j Due"){echo 'selected="selected"';}?>>j Due</option>
<option value="k Hold" <?php if($row[status1] == "k Hold"){echo 'selected="selected"';}?>>k Hold</option>
<option value="l Cancell" <?php if($row[status1] == "l Cancell"){echo 'selected="selected"';}?>>l Cancell</option>
<option value="m Refunded" <?php if($row[status1] == "m Refunded"){echo 'selected="selected"';}?>>m Refunded</option>
</select>
</form>
<?php }else{echo "$row[status1]";}}else{echo "$row[status1]";}?></td>
</tr>
<?php 
$status23=$row[status1];
}while($row=mysql_fetch_array($result));?>
<tr>
<td colspan="21" ><table border="0" align = "center" cellpadding="0" cellspacing="2">
<tr>
<?php // if our variable $back is equal to 0 or more then only we will display the link to move back //
if($back >=0) { 
echo  "<td  align='left' class='paiging' width='60px'><a href='$page_name&start=$back&limit=$limit'><< PREV</a></td>"; 
} 
//// Let us display the page links at  center. We will not display the current page as a link //
?>
<?php 
$i=0;
$l=1;
for($i=0;$i < $nume;
$i=$i+$limit){
if($i <> $eu){
?>
<td width="25px" align="center" class="paiging"><?php 
echo " <a href='$page_name&start=$i&limit=$limit'>$l</a>";
?></td>
<?php 
}else{echo "<td align='center' width='25px'><span class='paiging_red'>$l</span></td>";}
/// Current page is not displayed as link and given font color red
$l=$l+1;
}
?>
<?php ///////////// If we are not in the last page then Next link will be displayed. Here we check that /////
if($this1 < $nume) { 
echo "<td  align='right' class='paiging' width='60px'><a href='$page_name&start=$next&limit=$limit'>NEXT >></a></td>";} 
?>
</tr>
</table></td>
</tr>
<?php 
}
?>
</table>
<br /></td>
</tr>
</table></td>
</tr>
<tr>
<td height="25"><?php include("bot.php");?></td>
</tr>
</table>
</body>
</html>
<?php }?>