-
Notifications
You must be signed in to change notification settings - Fork 8
/
dashboard.php
102 lines (98 loc) · 2.4 KB
/
dashboard.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
<?php
include 'backend/config.php';
$query="select * from users;";
$rs=mysqli_Query($connection,$query);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Penetrate Me! - Dashboard</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.1/css/bulma.min.css">
</head>
<body>
<nav class="navbar" role="navigation" aria-label="main navigation">
<div class="navbar-brand">
<a class="navbar-item" href="dashboard.php">
<h3>Penetrate Me!</h3>
</a>
</div>
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="dashboard.php">
Dashboard
</a>
<?php
session_start();
if (isset($_SESSION['uname'])) {
echo '
<a class="navbar-item" href="admin_insert_h.php">
Add User
</a>
<a class="navbar-item" href="del.php">
Del User
</a>
';
}
?>
</div>
</div>
<div class="navbar-end">
<div class="navbar-item">
<div class="buttons">
<?php
if (isset($_SESSION['uname'])) {
echo '
<a class="button is-primary" href="backend/logout.php">
<strong>Logout</strong>
</a>
';
}else{
echo '
<a class="button is-primary" href="admin_login.html">
<strong>Admin Login</strong>
</a>
';
}
?>
</div>
</div>
</div>
</div>
</nav>
<section class="section">
<div class="container">
<h1 class="title">
List of Current Users
</h1>
<br>
<table class='table'>
<thead>
<tr>
<th>User Id</th>
<th>Username</th>
<th>Email</th>
<th>Account Balance</th>
</tr>
</thead>
<tbody>
<?php
while($row = $rs->fetch_assoc()){
echo '
<tr>
<td><strong>'.$row['user_id'].'</strong></td>
<td>'.$row['username'].'</td>
<td>'.$row['email'].'</td>
<td>'.$row['balance'].'</td>
</tr>
';
}
$connection->close();
?>
</tbody>
</table>
</div>
</section>
</body>
</html>