-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtableau.php
More file actions
69 lines (60 loc) · 2.17 KB
/
Copy pathtableau.php
File metadata and controls
69 lines (60 loc) · 2.17 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
58
59
60
61
62
63
64
65
66
67
68
69
<!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">
<link rel="stylesheet" href="bootstrap.css">
<title>Document</title>
</head>
<body>
<div class="">
<!-- création du tableau -->
<div class="bd-example">
<table class="table">
<h2 class="text-center">Liste Des Etudiants</h2>
<thead class="table-light">
<tr>
<th scope="col">Idetudiant</th>
<th scope="col">Nom</th>
<th scope="col">Prenom</th>
<th scope="col">Date de naissance</th>
<th scope="col">Email</th>
<th scope="col">Numéro</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
<!-- début de la boucle qui va récupérer tout les éléments dans la bd -->
<?php
include_once('config.php');
$req = $pdo->prepare("SELECT * FROM etudiant");
$req->execute();
$result = $req->fetchAll();
?>
<?php foreach ($result as $row): ?>
<tr>
<td><?php echo $row['idetudiant'] ?></td>
<td><?php echo $row['nom'] ?></td>
<td><?php echo $row['prenom'] ?></td>
<td><?php echo $row['date_naissance'] ?></td>
<td><?php echo $row['email'] ?></td>
<td><?php echo $row['numero'] ?></td>
<?php $id = $row['idetudiant'] ?>
<td>
<?php
echo '<a href="delete.php?$idi='.$id.'"><button class="btn btn-danger" type="submit" name="sup">Supprimer</button></a>
';?>
<?php
echo '<a href="mod.php?$idi=' . $id . '"><button class="btn btn-warning ">Modifier</button></a>
';?>
</td>
</tr>
<?php endforeach ?>
<!-- fin de la boucle -->
</tbody>
</table>
</div>
</div>
</body>
</html>