reservation2.php(second page)
Code:
<?php
include ('dbconn.cfg'); // database configuration file
$connection = @mysql_connect("localhost", "root", "") or die("Cannot connect to server!");
session_start();
//echo 'Your selected date is = ' . $_GET['selected_date'];
//$_SESSION['my_date'] = $_POST['rDate'];
//session_unset($_SESSION['n']);
?>
<?php
if (!(isset($_SESSION['gmemberid']))) {
$redirectUrl = "http://localhost/www2/loginReq.html";
print "<script type=\"text/javascript\">";
print "window.location.href = '$redirectUrl'";
print "</script>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Blue Projection - Reservation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
table, table * {
margin: 0;
padding: 0;
text-align: left;
}
</style>
<script language="JavaScript" type="text/JavaScript">
function validate(which) {
var selects = which.getElementsByTagName('select');
var radios = which.getElementsByTagName('input');
for(sel = 0; sel < selects.length; sel++) {
if(selects[sel].options[selects[sel].selectedIndex].text == 'Select') {
alert('Please select number of ticket!');
return false;
}
}
var rselCount = 0;
for(radio = 0; radio < radios.length; radio++) {
if(radios[radio].checked) {
rselCount++;
}
}
if(rselCount == 0) {
alert('Please select screening time!');
return false;
}
return true;
}
//function GoToNextPage(value){
//if(value != ""){
//document.location = 'reservation3.php?selected_no_ticket=' + value +'selected_time=' + value;
//}
//}
//function GoToNextPage_time(value){
//if(value != ""){
//document.location = 'reservation3.php?selected_time=' + value;
//}
//}
</script>
</head>
<body>
<form action="reservation3.php" method="get" name="movieList"
onSubmit="return validate(this);">
<table width="80%" height="557" border="0" align="center" bgcolor="#CCCCFF">
<tr>
<td colspan="2"> <div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="800" height="300">
<param name="movie" value="flash%20menu/menu2.swf">
<param name="quality" value="high">
<param name="LOOP" value="false">
<embed src="flash%20menu/menu2.swf" width="800" height="300" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object>
</div></td>
</tr>
<tr>
<td width="3%"> </td>
<td width="97%" height="222">
<table width="100%" border="0">
<tr>
<td width="78%" height="29"><font color="#0000FF" size="+2" face="Arial">Online
Reservation</font></td>
<?
if (isset($_SESSION['gmemberid'])) {
?>
<td><b><font color="blue">Logged in as: <? echo $_SESSION['gmemberid']; ?></font></b></td><br><br>
<? } ?>
</tr>
<tr>
<td height="21" colspan="2"><div align="left"><font face="Arial"><img src="images/line2.JPG" width="750" height="4"></font></div></td>
</tr>
<tr>
<td><font face="Arial">
<label>Number of Tickets:</label>
</font>
<font face="Arial">
<select name="rNumber" title="number of ticket">
<option selected>Select</option>
<option>01</option>
<option>02</option>
<option>03</option>
<option>04</option>
<option>05</option>
<option>06</option>
</select>
<label><b>**Ticket price RM 9/ticket**</b></label>
</font></td>
</tr>
<tr>
<td height="40" colspan="2"> <p><font face="Arial">Choose a movie and
its showtime<br>
</font></p></td>
</tr>
<tr><td><label><b><?= $_GET['selected_date']; ?></b></label></td></tr>
<?
if (isset($_SESSION['gmemberid'])) {
$tbl_name = "movie";
$result = mysql_query(sprintf('SELECT name,classification,screeningTime FROM %s
LIMIT 7', $tbl_name)) or die('Cannot execute query.');
//$numrow = mysql_num_rows($result);
while ($rows = mysql_fetch_assoc($result)) {
echo '<table width="100%" border="0"><tr><td height="68">
<table width="100%" height="47" border="0">
---------------------------------------------------------------------------------------------------------<br>';
echo '<strong>' . $rows['name'] . ' (' . $rows['classification'] . ')
<br></strong>';
foreach (explode(',', $rows['screeningTime']) as $time) { ?>
<label>
<input type="radio" name="time[<?php echo $rows['name']; ?>]"
title ="screening time" value="<?php echo $time; ?>">
<?php echo $time; ?>
</label>
<?php } ?>
<?
}
}
?>
<tr>
<td><input name="request" type="submit" value="Submit Request">
<input name="back" type="button" value="Back"
onclick="window.location='reservation.php'"> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="6" colspan="2"><font face="Arial"><img src="images/line2.JPG" width="750" height="4"></font></td>
</tr>
</table></td>
</tr>
<tr>
<td width="3%" height="25"> </td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
Bookmarks