<?php session_start();

if($_SESSION[invcox] == ""){

header("location:login.php?action=need");

}else{



include("config.php");

if($_POST['update'] == "y"){
	
mysql_query("update web_booking SET astatus='$_POST[astatus]'   WHERE id='$_POST[id]'");	
	
echo "update web_booking SET astatus='$_POST[astatus]'   WHERE id='$_POST[id]'<br />";
	}





?>

<!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>Arnim Holidays Accounting Software</title>

<link href="style.css" rel="stylesheet" type="text/css" />

<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=700,height=500,left = 100,top = 100');");

}

// End -->



function cash(i){

document.getElementById('Paid By').style.display = 'none';

document.getElementById(i).style.display = 'block';

}

</script>

<style type="text/css">
<!--
.style2 {color: #DC147B;
	font-weight: bold;
}
.style3 {color: #000000}
-->
</style>
	<?php include("calendar.php")?>
</head>



<body>

<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" class="box-wrap">

  <tr>

    <td><?php include("top.php")?></td>
  </tr>

  <tr>

    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">

      <tr>

        <td height="30" background="images/place_bg.jpg" class="link2"><strong>&nbsp;&nbsp;<a href="index.php">Home</a> &gt; <a href="accounts.php">Accounts &gt; </a>  Add <a href="all_cost.php">Cost </a></strong></td>
      </tr>

    </table></td>
  </tr>

  <tr>

    <td>&nbsp;</td>
  </tr>
  <tr></tr>

  <tr>

    <td align="center" valign="top">&nbsp;</td>
  </tr>

  <tr>

    <td  class="round_box"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
          <tr>
            <td colspan="9">Booking  List </td>
            </tr>
          <tr>
            <td width="10%" bgcolor="#E2E2E2">Name </td>
            <td width="10%" bgcolor="#E2E2E2">Phone No</td>
            <td width="10%" align="center" bgcolor="#E2E2E2">Room No </td>
            <td width="10%" align="center" bgcolor="#E2E2E2">Check In</td>
            <td width="10%" align="center" bgcolor="#E2E2E2">Check Our</td>
            <td width="10%" align="center" bgcolor="#E2E2E2">Person </td>
            <td width="3%" align="center" bgcolor="#E2E2E2">Time</td>
            <td width="3%" align="center" bgcolor="#E2E2E2">ip</td>
            <td width="3%" align="center" bgcolor="#E2E2E2">Status</td>
            </tr>
<?php 
 		$page_name="booking.php?id=$_GET[id]"; 

			$limit=$_GET['limit'];

			$start=$_GET['start'];								

			if(!($start > 0)) {                  

			$start = 0;

			}

			$eu = ($start - 0); 

			$limit = '50';               

			$this1 = $eu + $limit; 

			$back = $eu - $limit; 

			$next = $eu + $limit;

		

		$ant=mysql_query("select * from web_booking");
		$nume=mysql_num_rows($ant);


 $result=mysql_query("select * from web_booking ORDER by id asc  limit $eu, $limit ");
		  $row=mysql_fetch_array($result);
do{
?>
          <tr>
            <td bgcolor="#FFFFFF"><?php echo $row[name];?></td>
            <td bgcolor="#FFFFFF"><?php echo $row[phone];?></td>
            <td align="center" bgcolor="#FFFFFF"><?php echo $row[room];?></td>
            <td align="center" bgcolor="#FFFFFF"><?php echo $row[date1];?></td>
            <td align="center" bgcolor="#FFFFFF"><?php echo $row[date2];?></td>
            <td align="center" bgcolor="#FFFFFF">A:<?php echo $row[vcad];?> C:<?php echo $row[vcch];?></td>
            <td align="center" bgcolor="#FFFFFF"><?php echo $row[input_time];?></td>
            <td align="center" bgcolor="#FFFFFF"><?php echo $row[user_ip];?></td>
            <td align="center" bgcolor="#FFFFFF">
            <form method="post" enctype="multipart/form-data" id="form1">
            <input name="id" type="hidden" id="id" value="<?php echo $row[id];?>" />
            <input name="update" type="hidden" id="update" value="y" />
            <select name="astatus" id="astatus" onchange="this.form.submit();">

            
              <option value="new"  <?php if($row[astatus] == "new"){echo 'selected="selected"';}?>>new</option>
              <option value="Seen"  <?php if($row[astatus] == "Seen"){echo 'selected="selected"';}?>>Seen</option>
              <option value="confirm"  <?php if($row[astatus] == "confirm"){echo 'selected="selected"';}?>>confirm</option>
              <option value="cencel"  <?php if($row[astatus] == "cencel"){echo 'selected="selected"';}?>>cencel</option>
             
            </select>  </form>          </td>
            </tr>
<?php 
}while($row=mysql_fetch_array($result));
?>
        </table></td>
  </tr>

  <tr>

    <td><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>
  <tr>
    <td><?php include("bot.php")?></td>
  </tr>
</table>

</body>

</html>

<?php }?>