-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_user.php
71 lines (61 loc) · 1.08 KB
/
view_user.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
<?php
include "db.php";
session_start();
if (!isset($_SESSION["AID"]))
{
header("location:index.php");
}
?>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Viewing User Details</title>
<style type="text/css">
h1{
color: #4d4952;
margin-left:0.5in;
}
table{
width: 50%;
}
.con{
padding:0;
margin: 0;
text-align: center;
}
</style>
</head>
<body>
<h1>Viewing All User Details</h1>
<div class="con" >
<?php
$sql="SELECT * FROM user1";
$res=$db->query($sql);
if($res->num_rows > 0)
{
echo "<table border='1px'>
<tr><th>SNO</th><th>NAME</th><th>EMIAL</th>
<th>DEPARTMENT</th>
</tr>";
$i=0;
while ($row=$res->fetch_assoc())
{
$i++;
echo "<tr>";
echo "<td>{$i}</td>";
echo "<td>{$row['NAME']}</td>";
echo "<td>{$row['MAIL']}</td>";
echo "<td>{$row['DEP']}</td>";
echo "</tr";
echo "</table>";
}
}
else
{
echo "<p class='error'>No User Records Found</p> ";
}
?>
</div>
</body>
</html>