Quantcast
Channel: Últimos conteúdos
Viewing all articles
Browse latest Browse all 14190

Puxar lista de presença na horizontal e vertical

$
0
0

Olá Pessoal,

 

Como faço para puxar do banco de dados a presença de cada aluno na horizontal e vertical conforme cada aluno, como mostra a imagens abaixo:

diario.jpg

Código:

<table>
 <tr>
  	<?
	$re_3 = mysql_query("SELECT * FROM tb_chamadas_gv INNER JOIN tb_alunos_gv ON tb_alunos_gv.id = tb_chamadas_gv.id_aluno 
	WHERE id_disciplina like'%$id_disciplina%' GROUP BY id_aluno ORDER BY tb_alunos_gv.nome");
	while ($rs_3 = mysql_fetch_array($re_3)){
    ?>
    <td width="12"><input type="text" value="<? echo $rs_3['id']; ?>" size="2" /></td>
    <td width="423"><div style="width:400px;"><? echo $rs_3['nome']; ?></div></td>
    
	<?
	$re_4 = mysql_query("SELECT * FROM tb_alunos_gv INNER JOIN tb_chamadas_gv ON tb_chamadas_gv.id_aluno = tb_alunos_gv.id");
 	$count = mysql_num_rows($re_4);
	while($rs_4 = mysql_fetch_array($re_4)){
	?>   
    <td> 

    <div style="width:15px;"><input name="freq[]" type="checkbox" value="SIM" <?php echo $rs_4["freq"] == "SIM" ? "checked=\"checked\"" : ""; ?> /></div>
    <? } ?>
    </td>
    
  </tr>
<? }?> 
</table>

Viewing all articles
Browse latest Browse all 14190

Trending Articles