-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathview-ticket.php
55 lines (47 loc) · 1.47 KB
/
view-ticket.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
<?php
session_start();
include "config/connection.php";
$errors = array('pnr' => '');
$pnr = '';
if(isset($_POST['submit'])){
$pnr = $_POST['pnr'];
$pnr = $conn->real_escape_string($pnr);
//CHECK VALID PNR
$query1 = "CALL check_valid_pnr('$pnr');";
if ($conn->query($query1) === FALSE) {
$errors['pnr'] = $conn->error;
}
if(! array_filter($errors)){
$_SESSION['view_pnr'] = $pnr;
$conn->close();
header('Location: view-pnr-details.php');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>View Ticket</title>
</head>
<?php
if(isset($_SESSION['username']))
include "template/header-name.php";
else
include "template/header.php";
?>
<div style="margin-top:200px;">
<form style="padding:50px;" action="view-ticket.php" method=POST>
<label>
<h3 class = "heading">ENTER YOUR PNR NUMBER</h3>
<input type="text" class="input" name="pnr" maxlength=12 value="<?php echo htmlspecialchars($pnr) ?>">
<div class="line-box">
<div class="line"></div>
</div>
<p class= "bg-danger text-white"><?php echo htmlspecialchars($errors['pnr'])?></p>
</label>
<a href="index.php" class="register">Back</a>
<button type="submit" name="submit" value="submit">View Ticket</button>
</form>
</div>
<?php include "template/footer.php" ?>
</html>