-
Notifications
You must be signed in to change notification settings - Fork 2
/
bookings.php
130 lines (112 loc) · 4.01 KB
/
bookings.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
<html>
<title>bookings</title>
<?php
session_start();
if (isset( $_SESSION['user_id'])) {
$idh=$_SESSION['user_id'];
} else {echo 'session expired.';
header("Refresh:0; URL=expiredsess.php");
die();
}
$loc="";
function getPosterLoc($name){
include 'connection.php';
$sql = "SELECT posterLoc FROM moviedb WHERE title='".$name."'";
$result = $conn->query($sql);
if ($result->num_rows == 0 ) {
$GLOBALS['loc']="movieIMG/unavailable.jpg";
}
else{
while($row = $result->fetch_assoc()) {
if($row["posterLoc"]==""){
$GLOBALS['loc']="movieIMG/unavailable.jpg";
}
else{
$GLOBALS['loc']=$row["posterLoc"];
}
}
}
}
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>
<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="6.css" />
<link rel="stylesheet" href="7.css" />
<script>
function cancellor() {
if (confirm("Are you sure?")) {
var name = event.target.id;
window.location.replace('cancelTicket.php?ticketid='.concat(name));
}
}
</script>
</head>
<body style="background-image:url(11.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</a>
<div><a href="logout.php">Logout</a></div>
</div>
<p style="background-color:rgba(170,0,0,0.2);text-align:center;font-size:40px;color:silver;width:1500px;font-family:pristina;margin-top:5px;margin-bottom:10px;">your tickets</p>
<?php
include 'connection.php';
$sql = "SELECT * FROM bookings WHERE userid='".$_SESSION['user_id']."' and cancel_status=1";
$result = $conn->query($sql);
$numtks = $result->num_rows;
if($numtks==0){
echo '<div id="no_bk">no bookings yet !!</div>';
}
else{
while($row=$result->fetch_assoc())
{
getPosterLoc($row["movieName"]);
$out = strlen(ucfirst($row["movieName"])) > 19 ? substr(ucfirst($row["movieName"]),0,19)."..." : ucfirst($row["movieName"]);
echo '
<div class="frame">
<div class="card">
<div style="background-image: url('.$loc.')" class="image">
<div class="overlay">
<div class="btn2" ><a href="https://www.imdb.com/title/tt6933454/?ref_=nv_sr_1" class="bk_inf">
About
</a></div>
</div>
</div>
<button class="cancelbtn" id="'.$row["ticketID"].'" onclick="cancellor();">Cancel</button><br>
<span id="ticketid">Ticket id : '.$row["ticketID"].'
</div>
<div class="tk_details"><span class="movname">Movie : '.$out.'</span><br><br>Theatre : '.ucfirst($row["hall"]).'<br><br>Date : '.$row["dob"].'<br><br>Show Time : '.$row["showTime"].'<br><br>seats : '.$row["numSeats"].'<br><br>Paid : ₹'.$row["amount"].'</div>
</div>';
}
}
?>
</body>
</html>