• 0
Sign in to follow this  
Fabio AVILA

Mostrar Alunos por Categoria

Question

Ola amigos ,

Tenho uma pagina que exibe todos os alunos cadastrados do meu sistema para realizar a impressão de suas carterinhs tudo funcionando , porem gostaria de colocar um select aonde eu clique na ctegoria exemplo 1 ANO ele mostre apenas os alunos do 1 ANO ... alguém pode me dar uma força.. abaixo segue mei codigo atual ..

<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="Microsoft FrontPage 5.0"></HEAD>
<BODY bgColor=#efefef><LINK rel=stylesheet type=text/css 
href="estilos.css">
<TABLE border=0 cellSpacing=0 cellPadding=0 width=141 bgColor=#f2fff2 
align=center>
  <TBODY>
  <TR>
    <TD bgColor=#FFFFFF width=812>
      <TABLE style="BORDER-COLLAPSE: collapse" border=0 cellPadding=2 width=625 
      height=1>
        <TBODY>
        <TR>
          <TD bgColor=#efefef height=4 vAlign=center width=777 
            colSpan=2>
          <img border="0" src="Cartei1.jpg" width="765" height="70"></TD></TR>
        <TR>
          <TD bgColor=#FFFFFF height=1 vAlign=center width=569>
            <FORM method=post action=carteirinha.asp>
            <DIV align=left><B><FONT style="FONT-SIZE: 8pt" 
            face="Trebuchet MS">  </FONT>
              <font face="Trebuchet MS" style="font-size: 9pt" color="#015C5B">
              <br>
                       Selecione a Categoria  </font></B><font color="#015C5B"> 
                    <select class=select 
id=fd_estado onChange=java script:fn_MostraOutros() name=Categoria style="font-size: 8 pt; font-family: Tahoma; color:#FFFFFF; font-weight:bold; background-color:#015C5B">
 <option value="1">SUB7</option>
                      <option value="2">SUB9</option>
                    </select>
                    </font><SPAN 
            style="FONT-SIZE: 8pt"><FONT color=#015C5B 
            face="Trebuchet MS"> </FONT></SPAN><FONT color=#008000 
            face="Trebuchet MS">  
                    <INPUT style="BACKGROUND-COLOR: #015C5B; COLOR: #FFFFFF; FONT-SIZE: 8pt; FONT-WEIGHT: bold; font-family:Arial" value=busca type=submit name=submit><SPAN 
            style="FONT-SIZE: 8pt"> </SPAN></FONT></DIV></FORM>
            </TD>
          <TD bgColor=#FFFFFF height=1 vAlign=middle width=204>
            <P align=center><FONT style="FONT-SIZE: 8pt" 
            face="Century Gothic"><A title=Imprimir 
            href="http://takesports.com.br/a">
            &lt;script language=JavaScript1.2>
<!--
function DoPrinting(){
if (!window.print){
alert("Use o Netscape  ou Internet Explorer \n nas vers es 4.0 ou superior!")
return
}
window.print()
}
//-->
            </SCRIPT>
            </A>
             <%      sqlstmt = "SELECT  * FROM jogador "

          Set rs = Server.CreateObject("ADODB.Recordset")
          rs.Open sqlstmt, Dados, 3, 3
TotalRecs = rs.recordcount
x = 0
For x = 1 to 9999
    If rs.eof then
        Exit For
    Else
        date1 = rs("data")
        id = rs("ID")
        name1 = rs("nome")
        name2 = rs("endereco")
          link = "<a href='imprimir_cart2.asp?id=" & id & "'>" & date1 & "</a>"
        description = materia%> </FONT></P></TD></TR></TBODY></TABLE>
      <DIV style="WIDTH: 502px; HEIGHT: 246px" align=center>
      <TABLE style="BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 
      borderColor=#111111 cellPadding=4 width=607 bgColor=#ffffff height="28">
        <TBODY>
        <TR>
          <TH style="BORDER-BOTTOM: medium none; border-left-style:none; border-left-width:medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium" bgColor=#FFFFFF width=39 
          align=left height="14"> </TH>
          <TH style="BORDER-BOTTOM: medium none; border-left-style:none; border-left-width:medium" bgColor=#015C5B width=39 
          align=left height="14"><STRONG>
          <FONT style="FONT-SIZE: 8pt" color=#efefef 
            face="Arial">Cod</FONT></STRONG></TH>
          <TH style="BORDER-BOTTOM: medium none" bgColor=#015C5B width=494 
          align=left height="14"><strong>
          <font face="Arial" style="font-size: 8pt" color="#EFEFEF">Nome do 
          Atleta</font></strong></TH>
          <TH style="BORDER-BOTTOM: medium none" bgColor=#015C5B width=61 
          align=left height="14"><strong>
          <font face="Arial" style="font-size: 8pt" color="#EFEFEF">Nasc</font></strong></TH>
          <TH style="BORDER-BOTTOM: medium none" bgColor=#015C5B width=419 
          align=left height="14"><strong>
          <font face="Arial" style="font-size: 8pt" color="#FFFFFF">Endereco</font></strong></TH>
          <TH style="BORDER-BOTTOM: medium none" bgColor=#015C5B width=15 
          align=left height="14">
            <div align="center"><font face="Arial" style="font-size: 8pt" color="#FFFFFF">Imprimir</font></div></TH>
          </TR>
        
        <TR style="CURSOR: hand" id=869 
        onmouseover="this.className='inputMouse';" 
        onmouseout="this.className='';" onclick="consultarClick('869')" 
         ;>
          <TD 
          style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none" 
          bgColor=#FFFFFF borderColor=#6e9f4d width=39 align=left height="14"> </TD>
          <TD 
          style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none" 
          bgColor=#EBEBEB borderColor=#6e9f4d width=39 align=left height="14">
          <FONT size=1 
            face=Arial><% =id %></FONT></TD>
          <TD 
          style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none" 
          bgColor=#EBEBEB borderColor=#6e9f4d width=494 align=left height="14"><% =name1 %><font size="1" face="Arial">
          </font>    </TD>
          <TD 
          style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none" 
          bgColor=#EBEBEB borderColor=#6e9f4d width=61 align=left height="14">
          <FONT size=1 
            face=Arial><% =date1 %></FONT></TD>
          <TD 
          style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none" 
          bgColor=#EBEBEB borderColor=#6e9f4d width=419 align=left height="14">
          <font face="Arial" size="1"><% =name1 %></font></TD>
          <TD 
          style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: medium none; BORDER-TOP: medium none; BORDER-RIGHT: medium none" 
          bgColor=#EBEBEB borderColor=#6e9f4d width=15 align=center height="14">            
          <font face="Arial" color="#000000" size="1">
          <a href="imprimir_cart2.asp?id=<%=id%>">Imprimir</a></font></TD> <%
rs.MoveNext
End If
Next%>
          </TR>
         </TBODY></TABLE>
      <P align=left> 
      <P align=left><B><FONT style="FONT-SIZE: 8pt" face="Century Gothic">Sua 
      busca foi processada em 5,53 segundos.</FONT><FONT style="FONT-SIZE: 8pt" 
      color=#6e9f4d face="Century Gothic"><BR></FONT></B></P></DIV></TD></TR></TBODY></TABLE>
<P> </P>

</BODY></HTML>

Edited by Fabio AVILA

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Fabio, bom dia!

Seguinte, primeiro as minhas duvidas:

No ato do cadastro desses alunos, existia algum campo que categorizava esses alunos por "ANO". Caso sim, qual nome do campo no BD?

Obs.: Quando for colar o código, tenta "capar" ele, pra não ficar tão dificil de entender, porque 90% do codigo que você botou abaixo é dispensavel, nesse caso(referente a sua duvida), o que importa mesmo é a parte de conexão e select...

Abraço

Edited by evertonviana

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this