-
Notifications
You must be signed in to change notification settings - Fork 0
/
alt_turma.php
59 lines (50 loc) · 1.66 KB
/
alt_turma.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
<?php
include_once 'testar.php';
include 'navbar.php';
?>
<title>Sysuni - Alteração de dados</title>
<div class="container-alt">
<h2>Alteração de dados - Turma</h2><br>
<div class="table-responsive-sm">
<table class="table table-hover table-dark">
<thead>
<tr>
<th>#</th>
<th>Curso</th>
<th>Letra</th>
<th>Periodo</th>
<th>Ano</th>
<th>Semestre</th>
</tr>
</thead>
<tbody>
<?php
$sql = $pdo->query("SELECT * FROM turma");
while ($row = $sql->fetch(PDO::FETCH_ASSOC)) {
?>
<tr>
<td><?= $row['id'] ?></td>
<?php
$cid = $row['curso_id'];
$inst = "SELECT `nome` FROM `curso` WHERE `id` = {$cid}";
$sql2 = $pdo->query($inst);
$row2 = $sql2->fetch(PDO::FETCH_ASSOC);
?>
<td><?= $cid .' - '. $row2['nome']?></td>
<td><?= $row['letra'] ?></td>
<td><?= $row['periodo'] ?></td>
<td><?= $row['ano'] ?></td>
<td><?= $row['semestre'] ?></td>
<td>
<button type="button" class="btn btn-outline-warning" onclick="window.location.href='alt2_turma.php?id=<?= $row['id'] ?>'">Editar</button>
</td>
<td>
<button type="button" class="btn btn-outline-danger" onclick="window.location.href='exclui_turma.php?id=<?=$row['id']?>'">Excluir</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</body>
</html>