-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers.php
62 lines (44 loc) · 1.65 KB
/
users.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
<?php
require ('connect.php');
session_start();
$query = "SELECT * FROM users";
$statement = $db->prepare($query); // Returns a PDOStatement object.
$statement->execute(); // The query is now executed.
$users= $statement->fetchAll();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Liger Aquariums</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="wrapper">
<div id="header">
<h1><a href="index.php">Liger Aquariums - Users</a></h1>
</div> <!-- END div id="header" -->
<?php require 'menu.php' ?>
<div id="all_blogs">
<br>
<form class="search" action="searchUsers.php">
<input type="text" placeholder="Search users" name="search">
<button type="submit">Search</button>
</form>
<?php foreach(array_reverse($users) as $curent): ?>
<div class = "fish_post">
Username: <?= $curent['username'] ?> Role: <?= $curent['role'] ?> <a href="editUser.php?id=<?=$curent['User_Id'] ?>">edit </a> <br>
</div>
<?php endforeach ?>
<form action="newUser.php">
<p>
<input type="submit" name="command" value="Create new user" />
</p>
</form>
</div> <!-- END div id="wrapper" -->
<div id="footer">
Liger Aquariums 2021
</div> <!-- END div id="footer" -->
</div>
</body>
</html>