<?php
 
 
 
 
include("connect.php");
$login=mysql_connect("127.0.0.1","root","");
mysql_selectDB("Cinema",$login);
$pa=$_POST['pa'];
$q=$_POST['q'];
$time=$_POST['time'];
$MovieID=$_GET['MovieID'];
$result1=mysql_query("select * from movie where MovieID='$MovieID'");
$row1 = mysql_fetch_array($result1);
$result2=mysql_query("select * from price where name='$pa'");
$row2 = mysql_fetch_array($result2);
$price=$row2['price'];
 
 
$t = $q * $price;
if($q==""){
echo "<script language=javascript>alert('Please Insert Person Amount!!');window.location='http://localhost/cinema/book.php?MovieID=$MovieID'</script>";
 
 
}else{ 
echo"
 
 
<form method=post action='http://localhost/cinema/bookaction1.php?MovieID=$MovieID'>
<table align=center>
 
 
<tr>
<td align=center colspan=2><img src=".$MovieID.".jpg width=400 height=500></td>
</tr>
 
 
<tr>
<td align=center>Movie Name</td>
<td align=center style='font-size:20pt'>".$row1['MovieName']."</td>
</tr>
<tr>
<td>Trans ID</td>
<td>"; include('TID.php'); echo"
</tr>
<tr>
<td>Time :</td>
<td>$time <input type=hidden name=time value=".$time."></td>
</tr>
<tr>
<td>Person Amount</td>
<td>$q <input type=hidden name=q value=".$q."></td>
</tr>
<tr>
<td>Package</td>
<td>$pa <input type=hidden name=pa value=".$pa."></td>
</tr>
<tr>
<td>Unit Price</td>
<td>RM$price <input type=hidden name=price value=".$price."></td>
</tr>
<tr>
<td>Total Price</td>
<td>RM$t <input type=hidden name=t value=".$t."></td>
</tr>
<tr>
<td colspan=2 align=center><input type=submit value=Book><input type=reset value=Reset></td>
</tr>
</table>
 
 
";
}
?>