-
Notifications
You must be signed in to change notification settings - Fork 1
/
bookings.php
72 lines (60 loc) · 1.8 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
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="css/pass-dashboard1.css" type="text/css" />
<link rel="stylesheet" href="css/navbar.css" type="text/css" />
</head>
<body onload="myFunction()">
<?php include 'navbar.php'; ?>
<div class="below-search-area">
<div class="container2">
<div class="available-train">
<h3>My Bookings</h3>
</div>
<div class="available-train-table">
<table class="table">
<thead>
<tr>
<th>PNR Number</th>
<th>Train Number</th>
<th>Train Name</th>
<th>Train StartPoint</th>
<th>Train DestinationPoint</th>
<th>Train Arival Time</th>
<th>Booking Date</th>
<th>Train Fare</th>
<th>Option</th>
</tr>
</thead>
<tbody id="trainTableBody">
</tbody>
</table>
</div>
</div>
</div>
<script>
function myFunction() {
var xhr = new XMLHttpRequest();
// Define the PHP file to be called with query parameters
var url = 'fetch_booking_data.php';
// Open a new GET request to the server
xhr.open('GET', url, true);
// Set up a callback function to handle the response
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
// Insert the response into the table body
document.getElementById('trainTableBody').innerHTML = xhr.responseText;
}
};
// Send the request to the server
xhr.send();
}
</script>
</body>
</html>