-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshow_draw.php
More file actions
57 lines (50 loc) · 1.54 KB
/
show_draw.php
File metadata and controls
57 lines (50 loc) · 1.54 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
<?php
session_start();
require("pdo/pdo.php");
$users_id = $_SESSION["id"];
$user_name = $_SESSION["user"];
$marequete = $pdo->prepare("SELECT * FROM draw where users_id=:users_id");
// Etape 2 : Executer la requête
$marequete->execute([
"users_id" => $users_id
]);
// Etape 3 : Récupération (Fetch)
$dessins = $marequete->fetchAll(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Les oeuvres de <?= $user_name ?> </title>
<link rel="stylesheet" href="show_draw.css">
</head>
<body>
<div class="touthtml">
<h1>Sauvegarde disponible :</h1>
<table>
<thead>
<tr>
<th>ID</th>
<th>Nom de la sauvegarde</th>
<th>Createur</th>
</tr>
</thead>
<tbody>
<?php foreach($dessins as $dessin): ?>
<tr>
<td><?= $dessin["id"] ?></td>
<td>
<a href="dashboard.php?id=<?= $dessin["id"] ?>"> Dessin<?= $dessin["id"] ?></a>
</td>
<td><?= $user_name ?></td>
<!-- Mettre un png du dessin pour pouvoir le prévisualiser ? -->
</tr>
<?php endforeach; ?>
</tbody>
</table>
<a class="retour" href="dashboard.php">Retour</a>
</div>
</body>
</html>