-
Notifications
You must be signed in to change notification settings - Fork 3
/
log.php
77 lines (72 loc) · 1.43 KB
/
log.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
<html>
<?php
session_start();
$user=$_SESSION['use'];
$_SESSION['us']=$user;
$servername = "localhost";
$username = "root";
$pass = "";
$dbname = "getmehome";
// Create connection
$conn = new mysqli($servername, $username, $pass, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$result=mysqli_query($conn,"select * from travellog where username='$user';");
echo '<center>';
echo '<table style="width:70%" border=4>';
echo '<th> Passenger Name </th>';
echo '<th> Busno </th>';
echo '<th> From </th>';
echo '<th> To </th>';
echo '<th> Date</th>';
echo '<th> Time</th>';
echo '<th> Fare</th>';
echo '</center>';
while($row = mysqli_fetch_array($result))
{
$pname=$row['Name'];
$from=$row['departure'];
$to=$row['arrival'];
$sp=$row['doj'];
$fa=$row['fare'];
$b=$row['busno'];
$t=$row['toj'];
echo '<center>';
echo '';
echo '<tr>';
echo '<td>';
echo '<center>';
echo "$pname";
echo '</td>';
;
echo '<td>';
echo '<center>';
echo "$b";
echo '</td>';
echo '</td>';
echo '<td>';
echo '<center>';
echo "$from";
echo '</td>';echo '<td>';
echo '<center>';
echo "$to";
echo '</td>';
echo '<td>';
echo '<center>';
echo $sp;
echo '<td>';
echo '<center>';
echo $t;
echo '</td>';
echo '<td>';
echo '<center>';
echo $fa;
}
$conn->close();
echo '</table>';
?>
<br><br>
"<a href='sp.php?$user'> GO BACK </a> ";
</html>