-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadUser.php
More file actions
executable file
·55 lines (52 loc) · 1.72 KB
/
readUser.php
File metadata and controls
executable file
·55 lines (52 loc) · 1.72 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
<?php
session_start();
require_once "connexion.php";
if (!isset($_SESSION['user']) || (isset($_SESSION['user']) && $_SESSION['user']['role_id'] != 1)) {
header('Location: index.php');
exit;
}
$sql = "SELECT
user_id,
username,
email,
create_time,
role_id
FROM
`user`
;
";
$stmt = $conn->prepare($sql);
$stmt->execute();
?>
<html>
<head>
<head>
<title>all user • Fruity Motion</title>
<meta charset="utf-8">
<meta value="notranslate" name="google">
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" name="viewport">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/grid.css">
<link rel="stylesheet" type="text/css" href="form.css">
</head>
<body>
<?php include "header.php"; ?>
<div class="container" style="margin-top: 200px; margin-left:30px;">
<?php
while (false !== $row = $stmt->fetch(PDO::FETCH_ASSOC)) : ?>
<div class="userCard" style="border: 1px solid rgb(209, 209, 209); position: relative; width: 300px; color:rgb(209, 209, 209);">
<p><?=$row["username"]?></p>
<p><?=$row["email"]?></p>
<p><?=$row["create_time"]?></p>
<?php if ($row["role_id"] == 1) : ?>
<p>Admin</p>
<?php else : ?>
<p>User</p>
<a href="deleteUser.php?id=<?=$row["user_id"]?>"><span style="position: absolute; top: 2px; right: 2px; color: black">X</span></a>
<span style="position: absolute; top: 2px; right: 15px; color: black">O</span>
<?php endif ?>
</div>
<?php endwhile; ?>
</div>
</body>
</html>