I am relatively new to the form, so sorry if I make a mistake in posting.
<?php
require_once("login/include/membersite_config.php");
if(!$fgmembersite->CheckLogin())
{
$fgmembersite->RedirectToURL("./login/login.php");
exit;
}
include 'menu.php';
$is_student = $_POST["is_student"];
//echo "<br/> student $is_student <br/>";
?>
<html>
<head>
<title>Seat Selection</title>
<link href="xampp.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1>
<?php
if ($is_student == "no") {
$student = FALSE;
$_SESSION['student'] = FALSE;
} elseif ($is_student == "yes") {
$student = TRUE;
$_SESSION['student'] = TRUE;
} else {
echo "Please select Student or Parent before making reservation.";
die();
}
if ($student)
echo "Student Reservation";
else
echo "Parent Reservation";
?>
</h1>
<h2>Step 1 of 2: Select Seats</h2>
<table>
<?php if ($student) { ?>
<form name="seats" action="confirms.php" method="POST">
<?php } else { ?>
<form name="seats" action="confirm.php" method="POST">
<?php } ?>
<?php
$all_seats = $fgmembersite->GetAllSeats($student); // it's a 2 dimensional array $list[row][col]
// the value of which is another array with seatid and whether it's
// filled or not
$reserved_seats = $fgmembersite->GetAllReservedSeats($student);
//var_dump($reserved_seats);
// merge the reserved seats into all seats
foreach ($reserved_seats as $r => $arr) {
//echo "R =$r <br/>";
//var_dump($arr);
foreach($arr as $c => $seatid) {
//echo "R = $r, C = $c, S = $seatid><br/>";
$all_seats[$r][$c] = array(seatid => $seatid, filled => TRUE);
}
}
foreach ($all_seats as $r => $c) {
echo $r. ">";
foreach ($c as $value) {
if ($value['filled']) {
echo "x";
} else {
echo "<input type=\"checkbox\" name=\"seats[]\" value=\"$value[seatid]\"/>";
}
}
echo "<br/>";
}
?>
<input type="Submit" name="SeatsSelected" value="Select Seats">
</form>
</table>
</body>
</html>
I am trying to use the boolean value from $student to determine which confirmation page it goes to, but when I load the file the code is in (seats.php), it doesn’t load. It acts like the page is missing from the web directory. Any idea what’s up? This might just be my bad coding.
Try this :