<html>
<head>

<?php
$login=mysql_connect('localhost', 'wauhaha_karaoke', 'cross123','wauhaha_karaoke');
	
	mysql_selectDB("wauhaha_karaoke",$login);
	
$BroomID = $_POST["BroomID"];
$Name = $_POST["Name"];
$IC = $_POST["IC"];
$Contact = $_POST["contact"];
$Package = $_POST["package1"];
$People = $_POST["people1"];
$Package2 = $_POST["package2"];
$People2 = $_POST["people2"];
$Package3 = $_POST["package3"];
$People3 = $_POST["people3"];
$roomtype= $_GET["roomtype"];

$date = date("d/m/y",time());
$time_offset ="240"; 
$time_a = ($time_offset * 120);

$time = date("H:i:s",time() + $time_a);


?>
</head>
<body style="background-color: #ffffff;background-image:url(rail.jpg);background-repeat: repeat-y">
<?php echo "<form name=book1 method=post action='http://www.wauhaha.com/karaoke/bookroomaction.php?roomtype=$roomtype '>"; ?>
<center>
	<table style="font-size:20pt" >
		<tr>
			<td>Trans ID:</td>
			<td> <?php  echo "$BroomID <input type='hidden' name=BroomID value='$BroomID'>";  ?> </td>
		</tr>
			<tr>
			<td>Room Type:</td>
		<td>
			<?php
		echo "$roomtype <input type='hidden' name=roomtype value='$roomtype'>";
	
		?></td>
		<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>
	
			<td>Date:</td>
			<td><?php  
		$date = date("d/m/y",time());
			echo "$date <input type='hidden' name=date value='$date'>";
			
			  ?></td>
		</tr>
		<tr>
			<td>Time:</td>
			<td><?php 
			
$time_offset ="240"; 
$time_a = ($time_offset * 120);

$time = date("H:i:s",time() + $time_a);
			
		    echo $time;
			echo "<input type='hidden' name=time value='$time'>";
			?></td>
		</tr>
			<tr>
			<td> </td>
		</tr>
		<tr>
			<td> </td>
		</tr>
		<tr>
			<td> </td>
		</tr>
		<tr>
			<td> </td>
		</tr>
		<tr>
			<td> </td>
		</tr>
		<tr>
			<td> </td>
		</tr>
		
		<tr>
		
			<td>Package:<?php  echo "$Package <input type='hidden' name=package1 value='$Package'>";  ?>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			<td>People :
		
	
			<?php  echo "$People <input type='hidden' name=people1 value='$People'>";  ?>
			
			<?php
				
			$result2 = mysql_query("SELECT * FROM roomtype where roomtype='$roomtype' ");
			 if($row2 = mysql_fetch_array($result2)){
			 $price1=$row2['Price1'];
				echo "* RM".$row2['Price1']."  <input type='hidden' name=price1 value='$price1' >";
			 }
				?>	</td>
			<td><?php   
			$total1= $People * $price1;
					echo "=RM $total1  <input type='hidden' name=total1 value='$total1'>";
			?></td>
		</tr>
		
		<tr>
			<td>Package:<?php  echo "$Package2 <input type='hidden' name=package2 value='$Package2'>";  ?></td>
			<td>People :
			
				
			
			
		  
			
	
		        <?php  echo "$People2  <input type='hidden' name=people2 value='$People2'>";  ?>	<?php
				
			$result2 = mysql_query("SELECT * FROM roomtype where roomtype='$roomtype' ");
			 if($row2 = mysql_fetch_array($result2)){
			 $price2 = $row2['Price2'];
				echo "* RM".$row2['Price2']." <input type='hidden' name=price2 value='$price2'>";
			 }
				?>
				
				</td>
				<td>
				<?php   
			$total2= $People2 * $price2;
					echo "=RM $total2  <input type='hidden' name=total2 value='$total2'>";
			?></td>
		</tr>
		<tr>
		
			<td>Package:<?php  echo "$Package3 <input type='hidden' name=package3 value='$Package3'>";  ?></td>
			<td>People :
		
		
			<?php  echo "$People3 <input type='hidden' name=people3 value='$People3'>";  ?>	<?php
				
			$result2 = mysql_query("SELECT * FROM roomtype where roomtype='$roomtype' ");
			 if($row2 = mysql_fetch_array($result2)){
			 $price3= $row2['Price3'];
				echo "* RM".$row2['Price3']." <input type='hidden' name=price3 value='$price3'>";
			 }
				?></td>
				<td>
				<?php   
			$total3= $People3 * $price3;
					echo "=RM $total3 <input type='hidden' name=total3 value='$total3'>";
			?></td>
		</tr>
		<tr>
		
	
		<td></td>
		<td align=right>		Total  </td><td><?php 
		$total = $total1 + $total2 +$total3;
		echo "=RM $total <input type='hidden' name=total value='$total'>";
		?></td>
		</tr>
		<tr>
			<td></td>
			<td><input type=submit value=ok style="width:100;height:50"></td>
		</tr>
	</table>
<?php	echo "<a href='http://www.wauhaha.com/karaoke/bookroom.php?roomtype=$roomtype'>Back</a>" ?>
	</center>
</form>
<center><button onclick='window.print()' style="width:100;height:50">Print</button></center>
</body>
</html>