<?php
$Username = $_GET['Username'];
$time_offset ="600"; 
$time_a = ($time_offset * 120);
$time = date("h:i");

$book = $_POST["booktime"];
$a = $book - $time;



if($a<=1){
                echo "<script>alert('time is nt available')</script>";
				echo "<script language='javascript'>window.location='roombooking.php?Username=$Username'</script>";
}else

?>
<?php
$login=mysql_connect("localhost","wauhaha_karaoke","cross123",'karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
	
	
$Username=$_GET['Username'];
$result = mysql_query("select * from roomtype where roomtype='vvip_room'  ");
$row = mysql_fetch_array($result);
$roomtype = $row['roomtype'];
$result2 = mysql_query("select * from regmember where Username='$Username'  ");
$row2 = mysql_fetch_array($result2);
$Name = $row2['Name'];
$IC = $row2['IC'];
$Contact = $row2['HPhone'];
$Credit =$row2['Credit'];

	?>
</head>

<body style="background-color: #ffffff;background-image:url(rail.jpg);background-repeat: repeat-y">
<center><?php echo"<a href='http://www.wauhaha.com/konline/roombooking.php?Username=$Username'>Back</a>";?></center>
<?php echo "<form name=book method=post action='http://www.wauhaha.com/konline/onlinebookroomaction.php?Username=$Username'>"; ?>
<center>
	<table border=1 style="font-size:20pt";>
		<tr>
			<td>Trans ID:</td>
			<td>
			<?php

		include('obroomtran.php');
	
		?></td>
		</tr>
		<tr>
			<td>Room Type:</td>
			
			<td><?php
		 echo "$roomtype <input type='hidden' name=roomtype value='$roomtype'>";
		?></td>
		</td>
		</tr>
		<tr>
			<td>Username:</td>
			<td><?php
		 echo "$user <input type='hidden' name=Username value='$Username'>";
		?></td>
		</tr>
		<tr>
			<td>Name:</td>
			<td><?php
		 echo "$Name <input type='hidden' name=name value='$Name'>";
		?></td>
		</tr>
		<tr>
			<td>IC:</td>
			<td><?php
		 echo "$IC <input type='hidden' name=ic value='$IC'>";
		?></td>
		</tr>
		<tr>
			<td>Contact:</td>
			<td><?php
		 echo "$Contact <input type='hidden' name=contact value='$Contact'>";
		?></td>
		</tr>
			<tr>
			<td>Balance Credit:</td>
			<td><?php
		 echo "$Credit <input type='hidden' name=credit value='$Credit'>";
		?></td>
		</tr>
		<tr>
			<td>Booking Time:</td>
			<td><?php echo "$book <input type='hidden' name=booktime value='$book'>";?></td>
		</tr>
		<tr>
			<td>Package:	<?php
				
			$result2 = mysql_query("SELECT * FROM roomtype where roomtype='$roomtype' ");
			 if($row2 = mysql_fetch_array($result2)){
			 
				echo "".$row2['price1']." <input type='hidden' name=price1 value=".$row2['price1']." >";
			 }
				?></td>
			<td style="font-size:14pt">
			
			
			
			
		        <select name=people1 >
				<option value=0>0</option>
				<option value=1>1</option>
				<option value=2>2</option>
				<option value=3>3</option>
				<option value=4>4</option>
				<option value=5>5</option>
				<option value=6>6</option>
				<option value=7>7</option>
				<option value=8>8</option>
				<option value=9>9</option>
				<option value=10>10</option>
				<option value=11>11</option>
				<option value=12>12</option>
				<option value=13>13</option>
				<option value=14>14</option>
				<option value=15>15</option>
			</select>
			<?php
				
			$result2 = mysql_query("SELECT * FROM roomtype where roomtype='$roomtype' ");
			 if($row2 = mysql_fetch_array($result2)){
			 
				echo "* RM".$row2['price1']."";
			 }
				?>
				
			</td >
		</tr>
		<tr>
			<td>Package:	<?php
				
			$result2 = mysql_query("SELECT * FROM roomtype where roomtype='$roomtype' ");
			 while($row2 = mysql_fetch_array($result2)){
			 
				echo "".$row2['price2']." <input type='hidden' name=price2 value=".$row2['price2']." >";
			 }
				?></td>
			<td style="font-size:14pt">
			
			
		
			
		        <select name=people2 >
				<option value=0>0</option>
				<option value=1>1</option>
				<option value=2>2</option>
				<option value=3>3</option>
				<option value=4>4</option>
				<option value=5>5</option>
				<option value=6>6</option>
				<option value=7>7</option>
					<option value=8>8</option>
				<option value=9>9</option>
				<option value=10>10</option>
				<option value=11>11</option>
				<option value=12>12</option>
				<option value=13>13</option>
				<option value=14>14</option>
				<option value=15>15</option>
				</select>
						<?php
				
			$result2 = mysql_query("SELECT * FROM roomtype where roomtype='$roomtype' ");
			 if($row2 = mysql_fetch_array($result2)){
			 
				echo "* RM".$row2['price2']."";
			 }
				?>
				
			</td>
		</tr>
		</td>
		</tr>
		<tr>
			<td></td>
			<td><input type=submit value=ok style="width:50"></td>
		</tr>
	</table>
	</center>
<?php 	echo "</form>";?>