Por favor alguem pode me ajudar?
Estou fazendo um sistema onde tem que escolher as opções sim/não em uma checkbox, mas cada linha tem uma opção.
Como faço usando o checkbox e levo essa opção ao banco...!
Desde já Obrigado
<html> <head> <title> Programa de Agendamento de Laboratório </title> </head> <body bgcolor="#cccccc" text="#3333ff"> <p align="center"> <table> <tr> <td> <p align="center"><img src="logo"width="100" height="183"></p> <p align="center"><p><FONT FACE="verdana" color="#191F67"><b><font size="3">Confirmação De Aula</font></b></p> </td> </tr> </table> <form name='form1' method="POST" action="update_agenda.php"> <input type = 'hidden' name = 'id' value = '<? echo("$id");?>'> <input type = 'hidden' name = 'senha' value = '<? echo("$senha");?>'> <input type = 'hidden' name = 'aluno' value = '<? echo("$aluno");?>'> <input type = 'hidden' name = 'status' value='<?echo ("$status");?>'> <?php $data1 = $data1; $data1 = substr($data1,6,4) . "-" .substr($data1,3,2) . "-" .substr($data1,0,2); $data2 = $data2; $data2 = substr($data2,6,4) . "-" .substr($data2,3,2) . "-" .substr($data2,0,2); include "conexao_agenda.php"; $sql = " SELECT * FROM agendamento WHERE data between '$data1' and '$data2' order by data,hora"; $executa=mysql_query($sql); echo "<table border=2 align=center width=autosize height=autosize><tr>"; echo "<tr>"; echo "<td align=center width=autosize><font color=#000080><b>Nº</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Data</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Horário de Inicio</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Horário de Término</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Laboratório</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Material</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Nome Professor</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Curso</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Período</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Quant. Alunos</b></font></td>"; echo "<td align=center width=autosize><font color=#000080><b>Aula Concluida</b></font></td>"; echo "</tr>"; while ($dados=mysql_fetch_array($executa)) { echo "<tr>"; // A data no banco está 2008/06/03- com a subtr transforma em 03/06/2008- ele conta as posições e inverte $novadata = substr($dados[data],8,2) . "/" .substr($dados[data],5,2) . "/" .substr($dados[data],0,4); if ($dados[status] == 'a') { echo "<td align=center width=autosize><b><font color=#0000FF>$dados[id]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$novadata</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$dados[hora]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$dados[hora_fim]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$dados[laboratorio]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$dados[material]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$dados[nome]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$dados[curso]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$dados[periodo]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#0000FF>$dados[aluno]</font></b></td>"; echo "<td> <input type='checkbox' name='Sim' value='Sim'><font color='#0000FF'><b>Sim</b></font>"; echo "<input type='checkbox' name='Não' value='Não'><font color='#0000FF'><b>Não</b></font></td>"; } else if ($dados[status] == 'v') { echo "<td align=center width=autosize><b><font color=#FF0000>$dados[id]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$novadata</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$dados[hora]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$dados[hora_fim]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$dados[laboratorio]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$dados[material]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$dados[nome]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$dados[curso]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$dados[periodo]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#FF0000>$dados[aluno]</font></b></td>"; echo " <td> <input type='checkbox' name='Sim' value='Sim'><font color='#0000FF'><b>Sim</b></font>"; echo " <input type='checkbox' name='Não' value='Não'><font color='#0000FF'><b>Não</b></font></td>"; } else { echo "<td align=center width=autosize><b><font color=#0000FF>$dados[id]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$novadata</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$dados[hora]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$dados[hora_fim]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$dados[laboratorio]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$dados[material]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$dados[nome]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$dados[curso]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$dados[periodo]</font></b></td>"; echo "<td align=center width=autosize><b><font color=#000000>$dados[aluno]</font></b></td>"; echo " <td> <input type='checkbox' name='Sim' value='Sim'><font color='#0000FF'><b>Sim</b></font>"; echo " <input type='checkbox' name='Não' value='Não'><font color='#0000FF'><b>Não</b></font></td>"; } echo "</tr>"; } ?> <table> <tr><BR> <td> <input type = 'hidden' name = 'senha' value = '<? echo("$senha");?>'> <input type = 'hidden' name = 'id' value = '<? echo("$id");?>'> <input type = 'hidden' name = 'aluno' value = '<? echo("$aluno");?>'> <input type="submit" value="Confirmar"style="font-weight: bold"> </td> </td> </form> </tr> </table> <BR> <form method="POST" action ="menu_agenda.php"> <input type = 'hidden' name = 'status' value = '<? echo("$status");?>'> <input type = 'hidden' name = 'aluno' value = '<? echo("$aluno");?>'> <input type = 'hidden' name = 'senha' value = '<? echo("$senha");?>'> <table align="center"> <tr> <td> <input type="submit" align="center" value="<<Voltar"> </td> </tr> </form> </table> </body> </html>
Me ajudem Obrigado!!
Edição feita por: lwirkk, 18/06/2008, 11:21.
Adicionado a tag [code]/[codebox] para melhor visualização do código-fonte.