-
Notifications
You must be signed in to change notification settings - Fork 2
/
saveBooking.php
29 lines (22 loc) · 912 Bytes
/
saveBooking.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
session_start();
include 'connection.php';
if ( isset( $_SESSION['user_id'] ) ) {
$idh=$_SESSION['user_id'];
} else {echo 'session expired.';
header("Refresh:0; URL=expiredsess.php");
die();
}
$sql="INSERT INTO bookings (userid,movieName,hall,showTime,numSeats,amount,dob,cancel_status) VALUES ('$_SESSION[user_id]','$_SESSION[movsel]','$_SESSION[movhall]','$_SESSION[movtime]','$_SESSION[numseats]','$_SESSION[amount]','$_SESSION[dob]',1)";
$result = $conn->query($sql);
if ($result) {
$message="Booking Successful!!";
echo"<script type='text/javascript'> { alert('$message');} window.location.replace('bookings.php');</script>";
}
else {
$message="Booking unsuccessful.";
echo"<script type='text/javascript'> { alert('$message');} window.location.replace('home.php');</script>";
}
?>
</body>
</html>