-
Notifications
You must be signed in to change notification settings - Fork 0
/
superadmindashboard.php
90 lines (85 loc) · 3 KB
/
superadmindashboard.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
<?php
session_start();
include("include/connect.php");
if(isset($_SESSION['user']) && ($_SESSION['role'] == "superadmin")) {
$query = "select * from users";
$results = mysqli_query($conn, $query) or die("Cannot connect");
}else{?>
<script>
alert('You Are Not Logged In !! Please Login to access this page');
alert(window.location='login.php');
</script>
<?php
}
?>
<html>
<head>
<title>User Management</title>
<link rel="stylesheet" href="css/semantic.min.css">
<link rel="stylesheet" href="components/reset.min.css">
<link rel="stylesheet" href="components/site.min.css">
<link rel="stylesheet" href="components/container.min.css">
<link rel="stylesheet" href="components/grid.min.css">
<link rel="stylesheet" href="components/header.min.css">
<link rel="stylesheet" href="components/image.min.css">
<link rel="stylesheet" href="components/menu.min.css">
<link rel="stylesheet" href="components/divider.min.css">
<link rel="stylesheet" href="components/list.min.css">
<link rel="stylesheet" href="components/segment.min.css">
<link rel="stylesheet" href="components/dropdown.min.css">
<link rel="stylesheet" href="components/icon.min.css">
<link rel="stylesheet" href="css/semantic.min.css">
<link rel="stylesheet" href="css/themes/default/assets/fonts/icons.woff ">
<link rel="stylesheet" href="css/themes/default/assets/fonts/icons.ttf ">
<link rel="stylesheet" href="css/custom.css">
</head>
<body>
<div class="ui pointing fixed menu">
<div class="ui container">
<a href="#" class="header item">
<img class="logo" src="images/logo.png">
</a>
<a href="index.php" class="item">Bomrel Store</a>
<a href="#" class="item">Special Offers</a>
<a href="#" class="item">Delivery</a>
<a href="#" class="item">Contact Us</a>
<div class="right menu">
<div class="item">Welcome <?php echo strtoupper($_SESSION['user'])?> !!!</div>
<div class="item">
<div class="ui button" onclick="location.href='logout.php';">LogOut</div>
</div>
</div>
</div>
</div>
<div class="ui fluid accordion">
<h2>User List</h2>
<table border="1" class="ui table">
<thead>
<th>Name</th>
<th>Username</th>
<th>Password</th>
<th>Role</th>
<th>Status</th>
<th colspan="2">Action</th>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_assoc($results))
{
?>
<tr>
<td><?php echo stripslashes($row["name"]); ?></td>
<td><?php echo stripslashes($row["username"]); ?></td>
<td><?php echo $row["password"] ?></td>
<td><?php echo $row["role"] ?></td>
<td><?php echo $row["status"] ?></td>
<td><a href="users/edituser.php?id=<?php echo $row["id"]?>">Edit</a></td>
<td><a href="users/deleteuser.php?id=<?php echo $row["id"]?>">Delete</a></td>
</tr>
<?php }?>
</tbody>
</table>
</div>
<?php include ('footer.php')?>
</body>
</html>