-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.php
169 lines (142 loc) · 4.33 KB
/
manage.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
<?php
session_start();
if (isset($_SESSION['username']) == "") {
header("Location: homepage.php");
}
if (isset($_POST['logout'])) {
session_unset();
session_destroy();
header("Location: homepage.php");
exit();
}
require_once "database.php";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$email = $_POST["email"];
$pnr = $_POST["pnr"];
if ($email && $pnr) {
$query = "SELECT t.pnr, t.pax_id, p.name, p.gender, p.dob, p.mob_no, t.flight_no, t.class, t.dot, t.tot_fare
FROM ticket t
INNER JOIN pax p ON t.pax_id = p.pax_id
WHERE t.pnr = '$pnr'
AND p.email = '$email'";
$result = mysqli_query($conn, $query);
if (mysqli_num_rows($result) > 0) {
// Display the ticket details in a new webapge
$row = mysqli_fetch_assoc($result);
$_SESSION["ticket_details"] = $row;
header("Location: ticket_details.php");
exit;
} else {
// PNR does not exist in the database
echo "PNR does not exist in the database or email id does not match with given PNR.";
}
} else {
// PNR or email not provided
echo "Please provide both PNR and email.";
}
}
mysqli_close($conn);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="author" content="Pratyush">
<meta name="author" content="Aadil">
<meta name="author" content="Vidit">
<title>AirMonke-Manage</title>
<link rel="airline-logo.jpg" type="image/x-icon" href="favicon.ico" />
<script src="angular.min.js"></script>
<style>
body {
background-color: #f2f2f2;
font-family: Arial, sans-serif;
}
h1 {
color: #4CAF50;
text-align: center;
}
form {
margin: auto;
width: 50%;
border: 3px solid #f2f2f2;
padding: 10px;
}
input[type=text], input[type=email], input[type=submit] {
width: 100%;
padding: 12px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type=submit] {
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}
input[type=submit]:hover {
background-color: #45a049;
}
label {
display: block;
font-weight: bold;
margin-bottom: 10px;
}
span {
color: red;
font-weight: bold;
}
.a1{
height: 200px;
width: 300px;
background-color: bisque;
margin-top: 150px;
margin-left: 600px;
margin-right: 500px;
border-style: double;
border-color: blue;
text-align: center;
padding-top: 60px;
opacity: 80%;
}
.head1{
background-color: orange;
border-color: blue;
border-style: double;
}
.ht1{
margin-left: 700px;
height: 75px;
}
</style>
</head>
<body ng-app="">
<header class="head1">
<table class="ht1">
<tr>
<td style="text-align: left;width: 25%;"><button class="back1">BACK</button></td>
<td style="text-align: center; width: 50%;"><img src="AIRMONKE1-removebg-preview.png" alt="" style="height: 100px;"></td>
<td style="text-align: right;width: 25%;"><button class="myac1"><a href="dashboard.php">MY ACCOUNT</a></button></td>
</tr>
</table>
</header>
<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" name="manageForm">
<label for="pnr">PNR:</label>
<input type="text" id="pnr" name="pnr" required ng-model="pnr">
<br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required ng-model="email">
<br>
<input type="submit" value="Submit" ng-disabled="!manageForm.$valid || !pnr || !email">
</form>
<script>
function validateLoginForm() {
//Redundant. Replaced with AngularJS.
return true;
}
</script>
</body>
</html>