-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathver_curso.php
68 lines (52 loc) · 1.88 KB
/
ver_curso.php
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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script>
function confirmarExclusao(nomeCurso)
{
return confirm("Tem certeza que deseja excluir o curso '" + nomeCurso + "'?");
}
</script>
<title></title>
</head>
<body>
<table border="1">
<thead>
<th>Nome do Curso</th>
<th>Descrição</th>
<th>Carga Horária</th>
<th>Área</th>
<th>Editar</th>
<th>Deletar</th>
</thead>
<tbody>
<?php
include 'conexao.php';
$consulta_curso = "SELECT * FROM curso";
$consulta = mysqli_query($conexao, $consulta_curso);
while ($linha = mysqli_fetch_array($consulta))
{
$nomeCurso = $linha['nome_curso'];
print '<tr><td>' . $linha['nome_curso'] . '</td>';
print '<td>' . $linha['descricao'] . '</td>';
print '<td>' . $linha['carga_horaria'] . '</td>';
print '<td>' . $linha['area'] . '</td>';
?>
<td><a href="edita_curso.php?editar= <?php print $linha['cod_curso']; ?>"><input type="submit" value="EDITAR CURSO"></a></td>
<td>
<a href="deleta_curso.php?cod_curso= <?php print $linha['cod_curso'];?>
"onclick=" return confirmarExclusao('<?php print $nomeCurso; ?>')">
<input type="submit" value="DELETAR CURSO">
</a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
</body>
</html>