Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $procura_alunos = $site->query("SELECT * FROM alunos WHERE curso = '$token' ORDER BY nome ASC");
- while ($aluno = $procura_alunos->fetch(PDO::FETCH_OBJ)) {
- $procura_chamadas = $chamadas->query("SELECT * FROM chamadas WHERE curso = '$token'");
- while ($chamada = $procura_chamadas->fetch(PDO::FETCH_OBJ)) {
- $conta_faltas = $chamadas->query("SELECT * FROM $chamada->tabela WHERE turma = '$aluno->turma' AND alunos = '$aluno->chns' AND status = 'F'");
- $conta_presencas = $chamadas->query("SELECT * FROM $chamada->tabela WHERE turma = '$aluno->turma' AND alunos = '$aluno->chns' AND status = 'C'");
- $faltas = $conta_faltas->rowCount();
- $presencas = $conta_presencas->rowCount();
- }
- ?>
- <tr>
- <td>
- <?php echo $aluno->nome;?>
- </td>
- <td>
- <span style="color: #00ff4e"><strong id="presencas_<?php echo$aluno->id; ?>"><?php echo $presencas;?></strong></span>
- </td>
- <td>
- <span style="color: #ef0c0c"><strong id="faltas_<?php echo$aluno->id; ?>"><?php echo $faltas;?></strong></span>
- </td>
- </tr>
- <?
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement