Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Boris

Busca com combo

Recommended Posts

Galera estou tentando fazer uma busca com combos e não estou conseguindo...

 

Alguem poderia me ajudar...

 

Valew

 

principal.html

 

ASP
<html>

<head>

<title>Moradia Imobiliária</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

<!--

.style1 {

        font-family: arial;

        color: #FFFFFF;

        font-weight: bold;

        font-size: 10px;

}

.cx {

        font-family: verdana;

        font-size: 10px;

        color: #333333;

        text-decoration: none;

}

.textobr {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: bold; color: #FFFFFF; text-decoration: none}

 

-->

</style>

<script type="text/JavaScript">

<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}

//-->

</script>

</head>

 

<body bgcolor="#0000CC" text="#000000" topmargin="52">

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td><img src="seg_asp/Imagens/topo.gif" width="700" height="87"></td>

  </tr>

  <tr>

    <td height="10" align="center" valign="middle"><form name="busca" method="post" action="busca.asp">

      <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

        <tr>

          <td background="seg_asp/Imagens/line_fundo.jpg"><div align="right"><span class="style1"> Tipo</span>

                    <select name="tipo" size="1" class="cx" id="tipo">

                      <option>Imóvel</option>

                      <option value="Apartamento">Apartamento</option>

                      <option value="Casa">Casa</option>

                      <option value="Sobrado">Sobrado</option>

                      <option value="Terreno">Terreno</option>

                                        </select>

                    <select name="aluguel_venda" size="1" class="cx" id="aluguel_venda">

                      <option>Selecione</option>

                      <option value="Aluguel">Aluguel</option>

                      <option value="Venda">Venda</option>

                    </select>

          </div>

                <div align="right"></div></td>

          <td width="119" height="36" background="seg_asp/Imagens/line_fundo.jpg"><label></label>

                <label></label>

                <div align="center"><span class="style1">Ref.

                  <label> </label>

                      <label> </label>

                      <label> </label>

                  </span>

                    <label>

                    <input name="referencia" type="text" class="cx" id="referencia" size="10">

                    </label>

              </div></td>

          <td width="200" background="seg_asp/Imagens/line_fundo.jpg"><div align="center">

            <select name="valor" size="1" class="cx" id="valor">

              <option>Selecione</option>

              <option>De 100,00  até 500,00</option>

              <option>De 501,00  até 1000,00</option>

              <option>De 1001,00 até 1500,00</option>

              <option>Até 120.000,00</option>

              <option>Até 180.000,00</option>

              <option>Até 240.000,00</option>

              <option>Até 300.000,00</option>

              <option>Até 360.000,00</option>

              <option>Indiferente</option>

            </select>

          </div></td>

          <td width="86" background="seg_asp/Imagens/line_fundo.jpg"><label>

            <input type="submit" name="Submit" value="Buscar" class="cx">

            </label></td>

        </tr>

      </table>

    </form></td>

  </tr>

</table>

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td height="300" bgcolor="#FFFFFF"></td>

  </tr>

</table>

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td bgcolor="#0059B3"> </td>

  </tr>

</table>

</body>

</html>

 

 

busca.asp

ASP
<html>

<head>

<title>Moradia Imobiliária</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

<!--

.style1 {

        font-family: arial;

        color: #FFFFFF;

        font-weight: bold;

        font-size: 10px;

}

.cx {

        font-family: verdana;

        font-size: 10px;

        color: #333333;

        text-decoration: none;

}

.textobr {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: bold; color: #FFFFFF; text-decoration: none}

.texto {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #666666; text-decoration: none}

.style7 {color: #FFFFFF; font-weight: bold; font-size: 10px; }

.style8 {font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; text-decoration: none;}

.sombra {            filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=3, OffY=5, Color='#999999', Positive='true')

}

.style3 {font-weight: bold; color: #FF0000; text-decoration: none; font-family: Verdana, Arial, Helvetica, sans-serif;}

.style4 {font-size: 9px}

.texto8 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: normal; color: #333333; text-decoration: none}

.texto8bold {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: bold; color: #3F68AD; text-decoration: none}

.texto8boldred {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 8pt; font-weight: bold; color: #FF0000; text-decoration: none }

 

-->

</style>

<script type="text/JavaScript">

<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0

  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

  if (restore) selObj.selectedIndex=0;

}

//-->

</script>

</head>

<%

tipo                    =request.form ("tipo")

aluguel_venda   =request.Form("aluguel_venda")

referencia              =request.Form("referencia")

valor                =request.form("valor")

%>

<body bgcolor="#0000CC" text="#000000" topmargin="52">

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td><img src="seg_asp/Imagens/topo.gif" width="700" height="87"></td>

  </tr>

  <tr>

    <td height="10" align="center" valign="middle">

        <form name="busca" method="post" action="">

      <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

        <tr>

          <td background="seg_asp/Imagens/line_fundo.jpg"><div align="right"><span class="style1"> Tipo</span>

                  <select name="tipo" size="1" class="cx" id="tipo">

                    <option>Imóvel</option>

                    <option value="Apartamento">Apartamento</option>

                    <option value="Casa">Casa</option>

                    <option value="Sobrado">Sobrado</option>

                    <option value="Terreno">Terreno</option>

                  </select>

                  <select name="aluguel_venda" size="1" class="cx" id="aluguel_venda">

                    <option>Selecione</option>

                    <option value="Aluguel">Aluguel</option>

                    <option value="Venda">Venda</option>

                  </select>

            </div>

              <div align="right"></div></td>

          <td width="119" height="36" background="seg_asp/Imagens/line_fundo.jpg"><label></label>

              <label></label>

              <div align="center"><span class="style1">Ref.

                <label> </label>

                    <label> </label>

                    <label> </label>

                </span>

                  <label>

                  <input name="referencia" type="text" class="cx" id="referencia" size="10">

                  </label>

            </div></td>

          <td width="200" background="seg_asp/Imagens/line_fundo.jpg"><div align="center">

              <select name="valor" size="1" class="cx" id="valor">

                <option>Selecione</option>

                <option>De 100,00  até 500,00</option>

                <option>De 501,00  até 1000,00</option>

                <option>De 1001,00 até 1500,00</option>

                <option>Até 120.000,00</option>

                <option>Até 180.000,00</option>

                <option>Até 240.000,00</option>

                <option>Até 300.000,00</option>

                <option>Até 360.000,00</option>

                <option>Indiferente</option>

              </select>

          </div></td>

          <td width="86" background="seg_asp/Imagens/line_fundo.jpg"><img src="seg_asp/Imagens/buscar.jpg" width="63" height="18"></td>

        </tr>

      </table>

      </form>

    </td>

  </tr>

</table>

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td height="300" valign="top" bgcolor="#FFFFFF"><table width="700" border="0" cellspacing="0" cellpadding="0">

      <tr>

        <td height="10">

                <%

                if tipo=tipo and alugue_venda=alguel=venda and referencia=referencia and valor<=valor then

               

                %>

               

               

               

                <span class="texto8bold">

                <%

                       

 

                       

intConta = 1

imovel = "select * from imovel"

set imovel_rs = cn.Execute(imovel)

if imovel_rs.BOF AND imovel_rs.EOF then

        response.write "Nenhum imóvel cadastrado no momento."

else

        while NOT imovel_rs.EOF AND intConta <=5000

        intConta = intConta + 1

        %>

                </span></td>

      </tr>

    </table>

      <table width="100%" border="0" cellpadding="5" cellspacing="0">

      <tr>

        <td width="15%" height="20" bgcolor="#0033CC" class="texto"><div align="center" class="style7"><a href="modelo.html" class="style8">Referência</a></div></td>

        <td width="33%" class="texto" bgcolor="#0033CC"><div align="center" class="style7"><a href="modelo.html" class="style8">Bairro</a></div></td>

        <td width="16%" class="texto" bgcolor="#0033CC"><div align="center" class="style7">Dormitórios</div></td>

        <td width="11%" class="texto" bgcolor="#0033CC"><div align="center" class="style7">Vagas</div></td>

        <td width="25%" class="texto" bgcolor="#0033CC"><div align="center" class="style7">Preço</div></td>

      </tr>

    </table>

        <table width="100%" border="0" cellspacing="0" cellpadding="5">

 

        <tr>

          <td width="15%" height="24" bgcolor="#F7F7F7" class="texto"><div align="center"><a href="modelo.html" class="texto"></a><span class="texto8boldred"><font class="texto8bold">

            <% response.Write(imovel_rs("referencia")) %>

          </font></span></div></td>

          <td width="33%" class="texto" bgcolor="#F7F7F7"><div align="center"><a href="modelo.html" class="texto"><font class="texto8bold">

            <% response.Write(imovel_rs("bairro")) %>

          </font></a></div></td>

          <td width="16%" class="texto" bgcolor="#F7F7F7"><div align="center"><a href="modelo.html" class="texto"><font class="texto8bold">

            <% response.Write(imovel_rs("dormitorios")) %>

          </font></a></div></td>

          <td width="11%" class="texto" bgcolor="#F7F7F7"><div align="center"><a href="modelo.html" class="texto"><font class="texto8bold">

            <% response.Write(imovel_rs("vagas")) %>

          </font></a></div></td>

          <td width="25%" class="texto" bgcolor="#F7F7F7"><div align="center">R$ <span class="texto8boldred"><font class="texto8boldred">

            <% response.Write(imovel_rs("valor"))%>

          </font></span></div></td>

        </tr>

    </table>

            <% end if %>

       

    </td></tr>

</table>

<table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td bgcolor="#0059B3"> </td>

  </tr>

</table>

</body>

</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não aparece nenhum erro ai está o pior pois não consigo indentificar, estou tentando utilizar uma outra logica pois acho que é isso ...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara

 

Sou novo no ASP, porém sou programador de VB.

Eu não achei no seu codigo, o WEND para fechar o loop do While

e o imovel_rs.movenext para mover o ponteiro da base de dados.

 

Pelo que eu vi ele está em loop eterno, e não vai dar erro mesmo.

 

lá no final do codigo do busca.asp, inclui estas linhas

 

 

<td width="25%" class="texto" bgcolor="#F7F7F7"><div align="center">R$ <span class="texto8boldred"><font class="texto8boldred">			<% response.Write(imovel_rs("valor"))%>		  </font></span></div></td>		</tr>	</table>			 <%wend			imovel_rs.movenext			 end if %>			</td></tr></table><table width="700" border="0" align="center" cellpadding="0" cellspacing="0">  <tr>	<td bgcolor="#0059B3"> </td>  </tr></table></body></html>

Espero que ajude

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.