forked from MalekAzri/AccesBase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
34 lines (34 loc) · 1.14 KB
/
index.php
File metadata and controls
34 lines (34 loc) · 1.14 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
<?php
include "autoloader.php";
$_bdd = ConnexionBD::getInstance(); //instanciation d'une base de donnee
//requete pour recuperer les etudiants
$rep = $_bdd->query("SELECT * FROM student");
$students = $rep->fetchAll(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Liste des étudiants</title>
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<h1>Liste des étudiants</h1>
<table class="table table-striped">
<tr class="table-success">
<th>ID</th>
<th>Nom</th>
<th>Birthday</th>
<th></th>
</tr>
<?php foreach ($students as $student): ?>
<tr class="table-success">
<td><?= htmlspecialchars($student['id']) ?></td>
<td><?= htmlspecialchars($student['name']) ?></td>
<td><?= htmlspecialchars($student['birthday']) ?></td>
<td><a href="detailEtudiant.php?id=<?= $student['id'] ?>">Details</a></td>
</tr>
<?php endforeach; ?>
</table>
</body>
</html>