-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodules.php
More file actions
64 lines (49 loc) · 2.09 KB
/
Copy pathmodules.php
File metadata and controls
64 lines (49 loc) · 2.09 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
<?php
require_once('config/db_connect.php');
include("templates/header.php");
include("templates/main_nav.php");
// enregistrer la requete dans une variable
$sql = 'SELECT * FROM modules';
// executer la requetes
$results = mysqli_query($conn, $sql);
// Transformer en un tableau associative
$modules = mysqli_fetch_all($results, MYSQLI_ASSOC);
// Liberer les resultats
mysqli_free_result($results);
// fermer la connexion
mysqli_close($conn);
?>
<section class="container purple-text white">
<table class="highlight responsive-table">
<thead class="purple white-text">
<tr>
<th>Id</th>
<th>Code</th>
<th>Titre</th>
<th>Description</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach($modules as $module): ?>
<tr>
<td><a href="details_module.php?id=<?php echo htmlspecialchars($module['id']); ?>"><?php echo htmlspecialchars($module['id']); ?></a></td>
<td><a href="details_module.php?id=<?php echo htmlspecialchars($module['id']); ?>"><?php echo htmlspecialchars($module['code']); ?></a></td>
<td><?php echo htmlspecialchars($module['titre']); ?></td>
<td><?php echo htmlspecialchars(substr($module['_description'], 0, 20)); ?></td>
<td>
<form action="delete_module.php" method="post" style="display: inline;">
<input hidden type="text" name="id_delete" value="<?php echo htmlspecialchars($module['id']); ?>">
<input type="submit" name="submit" value="Supprimer" class="btn brand z-depth-0">
</form>
<form action="update_module.php" method="post" style="display: inline;">
<input hidden type="text" name="id" value="<?php echo htmlspecialchars($module['id']); ?>">
<input type="submit" name="submit" value="Modifier" class="btn brand z-depth-0">
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</section>
<?php include("templates/footer.php"); ?>