-
Notifications
You must be signed in to change notification settings - Fork 2
/
booking.php
183 lines (166 loc) · 5.57 KB
/
booking.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<html>
<title>book</title>
<?php
session_start();
$_SESSION['movsel']=$_GET['movie'];
$_SESSION['movtime']=$_GET['time'];
$_SESSION['movhall']=$_GET['theatre'];
if ( isset( $_SESSION['user_id'] ) ) {
$idh=$_SESSION['user_id'];
} else {echo 'session expired.';
header("Refresh:0; URL=expiredsess.php");
die();
}
function getHallName(){
if($_SESSION['movhall']){ echo $_SESSION['movhall'];}
else{
echo "Unknown";
}
}
function getShowTime(){
if($_SESSION['movtime']){ echo $_SESSION['movtime'];}
else{
echo "Unknown";
}
}
function getMovieName(){
if($_SESSION['movsel']){ echo $_SESSION['movsel'];}
else{
echo "Unknown";
}
}
function getTrailer()
{ $tr= $_SESSION['movsel'];
include 'connection.php';
$sql = "SELECT trailer_link FROM moviedb WHERE title='".$tr."'";
$result = $conn->query($sql);
if ($result->num_rows == 0 ) {
echo "https://www.youtube.com/embed/j8SOfg2pxXk";
}
else{
while($row = $result->fetch_assoc()) {
$link=$row["trailer_link"];
}
echo $link;
}
}
function getName(){
$id=$_SESSION['user_id'];
include 'connection.php';
$sql = "SELECT name FROM login WHERE username='".$id."'";
$result = $conn->query($sql);
if ($result->num_rows == 0 ) {
echo $id;
}
else{
while($row = $result->fetch_assoc()) {
$name=$row["name"];
}
$_SESSION['idname']=$name;
echo $name;
}
}
?>
<head>
<script>
var queryString = decodeURIComponent(window.location.search);
queryString = queryString.substring(1);
var queries = queryString.split("=");
queryString = queries[1];
input.onkeypress=function(evt){
evt.preventDefault();
};
function setAmount() {
var x = document.getElementById("myNumber").value;
var y= 180;
document.getElementById("amt").innerHTML = x*y.toString();
}
function goPaygo(){
var amt= document.getElementById("amt").innerHTML;
var numseats=document.getElementById("myNumber").value;
var dob=document.getElementById("date").innerHTML;
var addr="payment.php?amount=".concat(amt).concat("&numseats=").concat(numseats).concat("&dob=").concat(dob);
window.location.replace(addr);
}
</script>
<base target="_self" />
<link rel="stylesheet" href="1.css" />
<link rel="stylesheet" href="2.css" />
<link rel="stylesheet" href="3.css" />
<link rel="stylesheet" href="4%20booking.css" />
<link rel="stylesheet" href="7.css" />
</head>
<body style="background-image:url(4.jpg)">
<div class="topnav" style="margin-bottom: 10px;">
<a class="active" href="home.php">Home</a>
<div class="dropdown">
<a class="dropbtn" href="">
<?php getName(); ?>
<i class="fa fa-caret-down"></i>
</a>
<div class="dropdown-content">
<a href="fp22.php?idx=<?php echo $idh; ?>">change password</a>
<a href="profile.php">edit profile</a>
</div>
</div>
<a href="bookings.php">Bookings</a>
<div><a href="logout.php">Logout</a></div>
</div>
<div>
<p class="movie_title">
<?php getMovieName(); ?>
</p>
</div>
<div>
<iframe id="video" allowfullscreen="allowfullscreen" mozallowfullscreen="mozallowfullscreen" msallowfullscreen="msallowfullscreen" oallowfullscreen="oallowfullscreen" webkitallowfullscreen="webkitallowfullscreen" width="600px" height="300px" src="<?php getTrailer(); ?>">
</iframe></div>
<div id="bookinfo1">
<table id="thistable">
<tr>
<td>Theatre</td>
<td>
<?php getHallName(); ?>
</td>
</tr>
<tr>
<td>Screen</td>
<td>Screen 1 </td>
</tr>
<tr>
<td>Date</td>
<td id="date">
<script>var myArray = [0, 1, 2, 3,4];
n = new Date();
y = n.getFullYear();
m = n.getMonth() + 1;
d = n.getDate()+myArray[Math.floor(Math.random() * myArray.length)];
if(d>30){
d=1+Math.floor(Math.random() * myArray.length);
m+=1;
}
document.getElementById("date").innerHTML = y + "-" + m + "-" + d;</script>
</td>
</tr>
<tr>
<td>Show Time</td>
<td>
<?php getShowTime(); ?>
</td>
</tr>
<tr>
<td>Number of Seats</td>
<td><input type="number" id="myNumber" value="1" min="1" max="5" onclick="setAmount()" style="text-align:center;background-color:transparent;border:1px solid;color:silver;" onkeydown="return false"> </td>
</tr>
<tr>
<td>Amount</td>
<td>₹ <span id="amt">180</span></td>
</tr>
<tr>
<td colspan="2"><button id="bknow" onclick="goPaygo();">
Book Now
</button></td>
</tr>
</table>
</div>
</body>
</html>