forked from shrishail92/App-on-the-Fly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_users.php
executable file
·78 lines (57 loc) · 2.04 KB
/
view_users.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
<html>
<head lang="en">
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="bootstrap-3.2.0-dist\css\bootstrap.css">
<!--css file link in bootstrap folder-->
<title>View Users</title>
</head>
<style>
.login-panel {
margin-top: 150px;
}
.table {
margin-top: 50px;
}
</style>
<body>
<div class="table-scrol">
<h1 align="center">All the Users</h1>
<div class="table-responsive"><!--this is used for responsive display in mobile and other devices-->
<table class="table table-bordered table-hover table-striped" style="table-layout: fixed">
<thead>
<tr>
<th>User Id</th>
<th>User Name</th>
<th>User E-mail</th>
<th>User Pass</th>
<th>Delete User</th>
</tr>
</thead>
<?php
include("database/db_conection.php");
$view_users_query = "select * from users";//select query for viewing users.
$run = mysqli_query($dbcon, $view_users_query);//here run the sql query.
while ($row = mysqli_fetch_array($run))//while look to fetch the result and store in a array $row.
{
$user_id = $row[0];
$user_name = $row[1];
$user_email = $row[2];
$user_pass = $row[3];
?>
<tr>
<!--here showing results in the table -->
<td><?php echo $user_id; ?></td>
<td><?php echo $user_name; ?></td>
<td><?php echo $user_email; ?></td>
<td><?php echo $user_pass; ?></td>
<td><a href="delete.php?del=<?php echo $user_id ?>">
<button class="btn btn-danger">Delete</button>
</a></td>
<!--btn btn-danger is a bootstrap button to show danger-->
</tr>
<?php } ?>
</table>
</div>
</div>
</body>
</html>