-
Notifications
You must be signed in to change notification settings - Fork 0
/
userDetails.php
75 lines (64 loc) · 1.7 KB
/
userDetails.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
<?php session_start(); ?>
<?php require 'config.php';?>
<?php
//checking if a admin is logged in
if (!isset($_SESSION['id'])) {
header('Location: adminLogIn.php');
}
$userList = '';
$sql = "SELECT * FROM hotel";
if($result=$con->query($sql)){
if($result->num_rows > 0){
echo ("<table border='1'>");
while($row = $result->fetch_assoc()){
$userList .= "<tr>";
$userList .= "<td>" . $row['name'] . "</td>";
$userList .= "<td>" . $row['email'] . "</td>";
$userList .= "<td>" . $row['contact']. "</td>";
$userList .= "<td>" . $row['nic'] . "</td>";
$userList .= "<td>" . $row['checkIn']. "</td>";
$userList .= "<td>" . $row['checkOut']. "</td>";
$userList .= "<td>" . $row['comment']. "</td>";
$userList .= "<td><a href=\"editUser.php?ID={$row['ID']}\">Update</a></td>";
$userList .= "<td><a href=\"userDelete.php?ID={$row['ID']}\">Delete</a></td>";
$userList .= "</tr>";
}
echo ("</table>");
}else{
echo "no results";
}
}
else{
echo "Error:". $con->error;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>UserDetails</title>
<link rel="stylesheet" href="styles/user.css">
</head>
<body>
<h1>Reservation Details</h1>
<header>
<div class="loggedin">WELCOME <?php echo $_SESSION['firstName']; ?> <a href="Adminlogout.php">Log Out</a></div>
</header>
<main>
<table class="masterlist">
<tr>
<th>Full Name</th>
<th>Email</th>
<th>Contact Number</th>
<th>NIC</th>
<th>Check In</th>
<th>Check Out</th>
<th>Remarks</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<?php echo $userList; ?>
</table>
</main>
</body>
</html>