-
Notifications
You must be signed in to change notification settings - Fork 0
/
users_display.php
36 lines (36 loc) · 1.05 KB
/
users_display.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
<?php require_once('check_connected.php'); ?>
<div id="users_content">
<table class="table">
<tr>
<th>Actions</th>
<th>ID</th>
<th>Login</th>
<th>Nom</th>
<th>Droits</th>
<th>E-mail</th>
</tr>
<?php
require_once('db_constants.php');
try {
$bdd = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=utf8', DB_USERNAME, DB_PASSWORD);
$stmt = $bdd->prepare("SELECT * FROM ". TABLE_USERS);
if ($stmt->execute()) {
while ($row = $stmt->fetch()) {
?>
<tr>
<td><a href="users_add.php?id=<?php echo $row['id']; ?>" class="modify_user">Modifier</a><a class="delete_user" href="users_delete.php?id=<?php echo $row['id'];?>">Supprimer</a></td>
<td><span><?php echo $row['id'];?></td>
<td><span><?php echo $row['user']; ?></span></td>
<td><span><?php echo $row['display_name']; ?></span></td>
<td><span><?php echo $row['rights']; ?></span></td>
<td><span><?php echo $row['mail']; ?></span></td>
</tr>
<?php
}
}
} catch (Exception $e) {
echo 'Erreur : ' . $e->getMessage();
}
?>
</table>
</div>