-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofesseurs.php
More file actions
125 lines (119 loc) · 5.21 KB
/
Copy pathprofesseurs.php
File metadata and controls
125 lines (119 loc) · 5.21 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<?php
include ('dbconfig.php');
include ('security.php');
secAdmin();
include ('includes/header.php');
include ('includes/navbar.php');
?>
<div class="container-fluid">
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">Profils professeurs
<button type="button" class="btn btn-primary" onclick="window.location.href='Ajouter_professeur.php'">Ajouter</button>
</h6>
</div>
<div class="card-body">
<?php
if (isset($_SESSION['success']) && $_SESSION['success'] != '') {
echo '<h6 class="alert alert-success" role="alert"> ' . $_SESSION['success'] . ' </h6>
<meta http-equiv="refresh" content="5; url = professeurs.php" />';
unset($_SESSION['success']);
}
if (isset($_SESSION['status']) && $_SESSION['status'] != '') {
echo '<h6 class="alert alert-danger" role="alert"> ' . $_SESSION['status'] . ' </h6>';
unset($_SESSION['status']);
}
?>
</div>
<div class="card-body">
<div class="table-responsive">
<?php
$query = "SELECT ProfesseurID, Professeur_name, Professeur_prenom,Password, CIN, Email, Tele, Adresse, Date_debut_travail, Image FROM professeurs";
$query_run = mysqli_query($connection, $query);
?>
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
<thead>
<tr>
<th>ID</th>
<th>Nom</th>
<th>Prénom</th>
<th>CIN</th>
<th>Password</th>
<th>Email</th>
<th>Tele</th>
<th>Adresse</th>
<th>Date début travail</th>
<th>Image</th>
<th>Éditer</th>
<th>Supprimer</th>
</tr>
</thead>
<tbody>
<?php
if (mysqli_num_rows($query_run) > 0) {
while ($row = mysqli_fetch_assoc($query_run)) {
?>
<tr>
<td><?php echo $row['ProfesseurID']; ?></td>
<td><?php echo $row['Professeur_name']; ?></td>
<td><?php echo $row['Professeur_prenom']; ?></td>
<td><?php echo $row['CIN']; ?></td>
<td><?php echo $row['Password']; ?></td>
<td><?php echo $row['Email']; ?></td>
<td><?php echo $row['Tele']; ?></td>
<td><?php echo $row['Adresse']; ?></td>
<td><?php echo $row['Date_debut_travail']; ?></td>
<td>
<?php echo '<img src="upload/images_prof/' . $row['Image'] . '" width="100px;" height="100px;" alt="Image">'; ?>
</td>
<td>
<form action="professeur_edit.php" method="post">
<input type="hidden" name="edit_id" value="<?php echo $row['ProfesseurID']; ?>">
<button type="submit" name="editp_btn" class="btn btn-success">Éditer</button>
</form>
</td>
<td>
<button type="button" class="btn btn-danger" data-toggle="modal"
data-target="#confirmDeleteModal<?php echo $row['ProfesseurID']; ?>">Supprimer</button>
<!-- Ajouter une boîte de dialogue de confirmation de suppression pour chaque visiteur -->
<div class="modal fade" id="confirmDeleteModal<?php echo $row['ProfesseurID']; ?>" tabindex="-1"
role="dialog" aria-labelledby="confirmDeleteModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="confirmDeleteModalLabel">Confirmation de suppression</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
Voulez-vous vraiment supprimer cet étudiant?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
<form action="code.php" method="post">
<input type="hidden" name="deletep_id" value="<?php echo $row['ProfesseurID']; ?>">
<button type="submit" name="deletep_btn" class="btn btn-danger">Supprimer</button>
</form>
</div>
</div>
</div>
</div>
</td>
</tr>
<?php
}
} else {
echo "<tr><td colspan='7'>Aucun enregistrement trouvé</td></tr>";
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php
include ('includes/scripts.php');
include ('includes/footer.php');
?>