-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathusers.php
More file actions
65 lines (62 loc) · 2.19 KB
/
users.php
File metadata and controls
65 lines (62 loc) · 2.19 KB
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
<?php
include('header.php');
checkUser();
adminArea();
if(isset($_GET['type']) && $_GET['type']=='delete' && isset($_GET['id']) && $_GET['id']>0){
$id=get_safe_value($_GET['id']);
mysqli_query($con,"delete from users where id=$id");
mysqli_query($con,"delete from expense where added_by=$id");
echo "<br/>Data deleted<br/>";
}
$res=mysqli_query($con,"select * from users where role='User' order by id desc");
?>
<script>
setTitle("Users");
selectLink('users_link');
</script>
<div class="main-content">
<div class="section__content section__content--p30">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h2>Users</h2>
<a href="manage_user.php">Add User</a>
<br/><br/>
<div class="table-responsive table--no-card m-b-30">
<table class="table table-borderless table-striped table-earning">
<thead>
<?php
if(mysqli_num_rows($res)>0){
?>
<tr>
<th>ID</th>
<th>Username</th>
<th></th>
</tr>
<tbody>
<?php while($row=mysqli_fetch_assoc($res)){?>
<tr>
<td><?php echo $row['id'];?></td>
<td><?php echo $row['username']?></td>
<td>
<a href="manage_user.php?id=<?php echo $row['id'];?>">Edit</a>
<a href="javascript:void(0)" onclick="delete_confir('<?php echo $row['id'];?>','users.php')">Delete</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<?php }
else{
echo "No data found";
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include('footer.php');
?>