forked from prajwals420/Mumbai-Local-Train-Ticket-Booking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmintraindb.php
104 lines (89 loc) · 3.08 KB
/
admintraindb.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
<?php
include 'connect.php' ;
session_start();
if ($_SESSION['log'] == '')
{
header("location:index.php");
}
include 'adminheader.php';
?>
<!DOCTYPE html>
<html>
<link rel='stylesheet' href='index.css'>
<style>
table#data {
font-size:16px;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
border-collapse: collapse;
border-spacing: 0;
width: 100%;
}
#data td, #data th {
border: 1px solid #ddd;
text-align: left;
padding: 8px;
}
#data tr:nth-child(even){background-color: #f2f2f2}
#data th {
padding-top: 11px;
padding-bottom: 11px;
background-color: black;
color: white;
}
</style>
<head>
<title>TRAIN PASSENGERS DATABASE</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css" />
</head>
<body>
<br /><br />
<div class="container">
<h3 align="center">TRAIN PASSENGERS DATABASE</h3>
<br />
<div class="table-responsive">
<table id="data" class="table table-striped table-bordered">
<thead>
<tr>
<th> Date & Time</th>
<th> Booking ID </th>
<th> Name </th>
<th> Source </th>
<th> Destination </th>
<th> Amount Paid</th>
</tr>
</thead>
<tbody>
<?php
$result = mysqli_query($connect , "select * From transactions");
while ($row = mysqli_fetch_assoc($result)):
?>
<tr>
<td><?php echo $row['Date']; ?></td>
<td><?php echo $row['T_No.']; ?></td>
<td><?php echo $row['Name']; ?></td>
<td><?php echo $row['source']; ?></td>
<td><?php echo $row['dest']; ?></td>
<td><?php echo $row['Amt']; ?></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</body>
</html>
<script>
$(document).ready(function(){
$('#data').DataTable({
"order": [[ 1, "desc" ]]
} );
} );
</script>
<table align='center'>
<tr><!--<td><a href='pay.php'><button>Proceed</button></a></td>-->
<td><a href='admin.php'><button style="background-color: black ; border-color:black " ><span style="color:white">Go Back </span> </button></a></td>
</tr>