-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage-admin.php
81 lines (65 loc) · 2.26 KB
/
manage-admin.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
<?php
require 'authentication.php'; // admin authentication check
// auth check
$user_id = $_SESSION['admin_id'];
$user_name = $_SESSION['name'];
$security_key = $_SESSION['security_key'];
if ($user_id == NULL || $security_key == NULL) {
header('Location: index.php');
}
// check admin
$user_role = $_SESSION['user_role'];
if ($user_role != 1) {
header('Location: task-info.php');
}
$page_name="Admin";
include("include/sidebar.php");
?>
<div class="row">
<div class="col-md-12">
<div class="well well-custom">
<ul class="nav nav-tabs nav-justified nav-tabs-custom">
<li class="active"><a href="manage-admin.php">Manage Admin</a></li>
<li><a href="admin-manage-user.php">Manage Employee</a></li>
</ul>
<div class="gap"></div>
<div class="table-responsive">
<table class="table table-codensed table-custom">
<thead>
<tr>
<th>Serial No.</th>
<th>Name</th>
<th>Email</th>
<th>Username</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<?php
$sql = "SELECT * FROM tbl_admin WHERE user_role = 1";
$info = $obj_admin->manage_all_info($sql);
$serial = 1;
$total_expense = 0.00;
while( $row = $info->fetch(PDO::FETCH_ASSOC) ){
?>
<tr>
<td><?php echo $serial; $serial++; ?></td>
<td><?php echo $row['fullname']; ?></td>
<td><?php echo $row['email']; ?></td>
<td><?php echo $row['username']; ?></td>
<td><a title="Update Admin" href="update-admin.php?admin_id=<?php echo $row['user_id']; ?>"><span class="glyphicon glyphicon-edit"></span></a> </td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php
if(isset($_SESSION['update_user_pass'])){
echo '<script>alert("Password updated successfully");</script>';
unset($_SESSION['update_user_pass']);
}
include("include/footer.php");
?>