-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnote_enseignant.php
More file actions
113 lines (108 loc) · 4.01 KB
/
note_enseignant.php
File metadata and controls
113 lines (108 loc) · 4.01 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
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard des Notes</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<style>
body {
background-color: #f8f9fa;
font-family: Arial, sans-serif;
}
.container {
margin-top: 50px;
}
h1 {
text-align: center;
margin-bottom: 20px;
}
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #343a40;
color: white;
}
tr:nth-child(even) {
background-color: #f2f2f2;
}
tr:hover {
background-color: #ddd;
}
</style>
</head>
<body>
<div class="container">
<h1>Dashboard des Notes</h1>
<table class="table table-striped table-bordered">
<thead class="thead-dark">
<tr>
<th>ID</th>
<th>ID Enseignant</th>
<th>Nom & Prénom</th>
<th>Matière</th>
<th>Classe</th>
<th>Nom de l'Étudiant</th>
<th>Prénom</th>
<th>Matricule</th>
<th>Filière</th>
<th>Enseignant</th>
<th>Note 1</th>
<th>Note 2</th>
<th>Note 3</th>
</tr>
</thead>
<tbody>
<?php
// Connexion à la base de données
$servername = "localhost";
$username = "root"; // Remplacez par votre nom d'utilisateur MySQL
$password = ""; // Remplacez par votre mot de passe MySQL
$dbname = "gestion_notess"; // Remplacez par le nom de votre base de données
$conn = new mysqli($servername, $username, $password, $dbname);
// Vérifier la connexion
if ($conn->connect_error) {
die("Échec de la connexion à la base de données : " . $conn->connect_error);
}
// Exécuter la requête SQL pour récupérer les données de la table "notes"
$sql = "SELECT * FROM notes";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// Parcourir chaque ligne de résultat
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['enseignant_id'] . "</td>";
echo "<td>" . $row['nom_prenom'] . "</td>";
echo "<td>" . $row['matiere'] . "</td>";
echo "<td>" . $row['classe'] . "</td>";
echo "<td>" . $row['nom_etudiant'] . "</td>";
echo "<td>" . $row['prenom'] . "</td>";
echo "<td>" . $row['matricule_s'] . "</td>";
echo "<td>" . $row['filiere'] . "</td>";
echo "<td>" . $row['enseignant'] . "</td>";
echo "<td>" . $row['note1'] . "</td>";
echo "<td>" . $row['note2'] . "</td>";
echo "<td>" . $row['note3'] . "</td>";
echo "</tr>";
}
} else {
echo "<tr><td colspan='13'>Aucune donnée disponible</td></tr>";
}
$conn->close();
?>
</tbody>
</table>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>