-
Notifications
You must be signed in to change notification settings - Fork 3
/
alunos-selecao.php
58 lines (52 loc) · 1.76 KB
/
alunos-selecao.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
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Alunos</title>
<link rel="stylesheet" type="text/css" href="css/base.css">
</head>
<body>
<?php ?>
<div id="global">
<?php
include("php/main.php");
include("php/menu.php");
$id_selecao = isset($_GET['id_selecao']) ? $_GET['id_selecao'] : NULL;
?>
<div class="content">
<section>
<h1>Alunos Cadastrados</h1>
</section>
<section>
<?php
include("php/conexao_banco.php");
echo "<table class='tabela'>";
$conexao_consulta = new Conexao();
$consulta = $conexao_consulta->conectar()->query("SELECT u.matricula,u.nome,u.cpf,de.modalidade,de.curso, df.qtd_familia,df.renda_familia,TRUNCATE(df.renda_familia/df.qtd_familia,2) renda_familiar
FROM usuario u, dado_estudantil de, dado_familia df, selecao_usuario su
WHERE u.matricula = de.matric_usu AND u.matricula = df.matric_usu AND
u.matricula = su.matric_usuario AND su.id_selecao = '$id_selecao'
order by renda_familiar ");
echo "<tr><th>Matricula</th> <th>Nome</th> <th>CPF</th> <th>modalidade</th> <th>Curso</th> <th>Qtd de Pessoas</th> <th>Renda total</th> <th>Renda Familiar</th></tr>";
while ($linha = $consulta->fetch(PDO::FETCH_ASSOC)) {
echo "<tr>
<td>{$linha['matricula']}</td>
<td>{$linha['nome']}</td>
<td>{$linha['cpf']}</td>
<td>{$linha['modalidade']}</td>
<td>{$linha['curso']}</td>
<td>{$linha['qtd_familia']}</td>
<td>{$linha['renda_familia']}</td>
<td>{$linha['renda_familiar']}</td>
</tr>";
}
echo '</table>';
?>
</section>
</div>
</div>
</body>
</html>