Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2. $procura_alunos = $site->query("SELECT * FROM alunos WHERE curso = '$token' ORDER BY nome ASC");
  3. while ($aluno = $procura_alunos->fetch(PDO::FETCH_OBJ)) {
  4. $procura_chamadas = $chamadas->query("SELECT * FROM chamadas WHERE curso = '$token'");
  5. while ($chamada = $procura_chamadas->fetch(PDO::FETCH_OBJ)) {
  6. $conta_faltas = $chamadas->query("SELECT * FROM $chamada->tabela WHERE turma = '$aluno->turma' AND alunos = '$aluno->chns' AND status = 'F'");
  7. $conta_presencas = $chamadas->query("SELECT * FROM $chamada->tabela WHERE turma = '$aluno->turma' AND alunos = '$aluno->chns' AND status = 'C'");
  8. $faltas = $conta_faltas->rowCount();
  9. $presencas = $conta_presencas->rowCount();
  10. }
  11. ?>
  12. <tr>
  13. <td>
  14. <?php echo $aluno->nome;?>
  15. </td>
  16. <td>
  17. <span style="color: #00ff4e"><strong id="presencas_<?php echo$aluno->id; ?>"><?php echo $presencas;?></strong></span>
  18. </td>
  19. <td>
  20. <span style="color: #ef0c0c"><strong id="faltas_<?php echo$aluno->id; ?>"><?php echo $faltas;?></strong></span>
  21. </td>
  22. </tr>
  23. <?
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement