-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdmin.php
64 lines (55 loc) · 2.08 KB
/
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
<?php
session_start();
include './Assets/header.php';
include './Assets/admin-nav.php';
require './db.php';
?>
<div class="container">
<div class="card card-body">
<table class="
table
"
>
<thead>
<th>#</th>
<th>ชื่อผู้ใช้</th>
<th>ชื่อจริง</th>
<th>รหัสผ่าน</th>
<th>ที่อยู่ / เบอร์โทรศัพท์</th>
<th>ระดับ</th>
<th>รูป</th>
<th>สถานะ</th>
</thead>
<tbody>
<?php
$resp = $db->query("SELECT * FROM users");
while($row = mysqli_fetch_assoc($resp)):
?>
<tr>
<td><?=$row['UserID']?></td>
<td><?=$row['UserName']?></td>
<td><?=$row['UserRealName']?></td>
<td><?=$row['UserPassword']?></td>
<td><?=$row['UserAddress']." / ".$row['UserPhone']?></td>
<td><?=$row['UserRole']?></td>
<td><img src="./Image/<?=$row['UserImg']?>" alt="" width="64"></td>
<td>
<form action="App/UpdateStatus.php" method="post">
<input type="text" name="status" value="<?=$row['UserStatus']?>" hidden>
<input type="text" name="id" value="<?=$row['UserID']?>" hidden>
<?php
if($row['UserStatus'] == 1){
echo '<button type="submit" class="btn btn-success">อนุมัติแล้ว</button>';
}
if($row['UserStatus'] == 0){
echo '<button type="submit" class="btn btn-danger">ระงับการใช้งาน</button>';
}
?>
</form>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>