forked from zunaidm/MoneyTransferSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.php
More file actions
71 lines (65 loc) · 1.73 KB
/
Copy pathlist.php
File metadata and controls
71 lines (65 loc) · 1.73 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
66
67
68
69
70
71
<?php include 'config/Database.php' ?>
<?php
session_start();
if($_SESSION['type'] == 'admin'){
include 'inc/headeradmin.php';
}
else if($_SESSION['type'] == 'employee'){
header("Location: "."dashboard.php");
}
else
{
header("Location: "."index.php");
}
$db = new Database();
?>
<?php
if(isset($_GET["id"])){
$uname = $_GET['id'];
$query = "DELETE FROM users WHERE username = '$uname' ";
$db->select($query);
header('Location: '.'list.php');
}
?>
<div class="desh-main-content">
<br>
<div class="title">
User List
</div>
<div class="main">
<div class="transection-table">
<table>
<tr>
<th>Name</th>
<th>Username</th>
<th>Email</th>
<th>Gender</th>
<th>Role</th>
<th>Photo</th>
<th>Option</th>
</tr>
<?php
$query = "SELECT * FROM users";
$users = $db->select($query);
if($users){
while ($result = $users->fetch_assoc()) {
# code...
?>
<tr>
<td><?php echo $result['name']; ?></td>
<td><?php echo $result['username']; ?></td>
<td><?php echo $result['email']; ?></td>
<td><?php echo $result['gender']; ?></td>
<td><?php echo $result['type']; ?></td>
<td><?php echo "<img src=uploads/".$result['img'].'>';?></td>
<td>
<a href= <?php echo "list.php?id=".$result['username'];?> > <span class="fa fa-trash-o"></span></a>
</td>
</tr>
<?php } }?>
</table>
</div>
</div>
</div>
</body>
</html>