-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTabelaNotas.php
More file actions
68 lines (58 loc) · 2.1 KB
/
Copy pathTabelaNotas.php
File metadata and controls
68 lines (58 loc) · 2.1 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="Tabela.css">
</head>
<body>
<div class="table-container">
<?php
session_start();
if (!isset($_SESSION["email"])) {
header("Location: login.php");
exit();
}
include('conexao.php');
$sql = "SELECT * FROM register.users;";
$result = $conexao->query($sql);
if ($result->num_rows > 0) {
echo
"<table class='custom-table'>
<tr>
<th class='header-cell'>Nome</th>
<th class='header-cell'>Matrícula</th>
<th class='header-cell'>Nota 1</th>
<th class='header-cell'>Nota 2</th>
<th class='header-cell'>Média</th>
<th class='header-cell'>Ação</th>
</tr>";
while ($row = $result->fetch_assoc()) {
$media = ($row["nota1"] + $row["nota2"]) / 2;
echo "<tr>
<td class='data-cell'>" . $row["nome"] . "</td>
<td class='data-cell'>" . $row["matricula"] . "</td>
<td class='data-cell'>" . $row["nota1"] . "</td>
<td class='data-cell'>" . $row["nota2"] . "</td>
<td class='data-cell'>" . $media . "</td>
<td class='data-cell'><a class='delete-link' href='DELETE.php?matricula=" . $row["matricula"] . "'>Excluir</a></td>
</tr>";
}
echo "</table>";
} else {
echo "0 resultados";
}
$conexao->close();
?>
</div>
<div class="Botoes">
<form action="CadAlunoHTML.php" method="get">
<button type="submit" class="CadAluno">Cadastrar Aluno</button>
</form>
<form action="logout.php" method="post">
<button type="submit" class="Logout">Finalizar Sessão</button>
</form>
</div>
</body>
</html>