Jump to content


MCborges

Member Since 26/10/2007
Offline Last Active 28/11/2007, 14:17
-----

Topics I've Started

Sos - Menu/list (deve Ser Difícil - Nenhuma Resposta!)

22/11/2007, 20:45

Olá pessoal, estou com um problema em criar um menu/list baseado em uma informação SQL.

:ph34r: [COMPLETANDO O TÓPICO] - Este form, vai manter os dados da URL e adcionar os dados escolhidos na seleção dentro do mesmo form.
Ex: esta na url: www.site.com.br/categoria.asp?cat_id=39
este form mandara para seguinte url:
www.site.com.br/sub_categoria.asp?cat_id=39&sub_id=3
em negrito é a informação da URL do form e em italico a informação que foi selecionada pela pessoa.
Estou na esperança..... :D


Atualmente a pagina de resposta usa para mostrar os dados uma opção "Horizontal Looper", que envia a opção selecionada para proxima pagina.
No entanto este tipo de "Horizontal Looper" fica muito ruim quando existe muitos itens.

Alguem sabe como montar este "Menu/List" no Dreamweaver?

Ou se existe uma extensão para isso?

Segue o código da pagina: Note que tem a opção em Horizontal Looper" e acima "Menu/List" que estou tentando colocar
.

Neste endereço: tem um Exemplo onde a categoria mostra as sub-categorias em (formato "Horizontal Looper")
http://www.pointofli...dirCat.asp?id=1


<-----------------------Inicio---------------------><%@LANGUAGE="VBSCRIPT"%><!--#include file="../Connections/conn_bank_dados.asp" --><%Dim rsAds__MMColParamrsAds__MMColParam = "1"if (Request.QueryString("cat_id")    <> "") then rsAds__MMColParam = Request.QueryString("cat_id")   %><%Dim rsAdsDim rsAds_cmdDim rsAds_numRowsSet rsAds_cmd = Server.CreateObject ("ADODB.Command")rsAds_cmd.ActiveConnection = MM_conn_bank_dados_STRINGrsAds_cmd.CommandText = "SELECT AD_ID, CAT_ID, SUB_ID, AD_TITLE, AD_DATED, AD_EXPIRED, AD_EXPIRED - Date() AS DAYS, AD_POSTER, AD_PRICE, AD_IMAGE, AD_VIEWED, U_ID, U_CITY, U_STATE, U_ZIP, AD_Tipo, AD_Ano_Modelo, AD_Ano_fabricacao, AD_Combustivel, AD_Fabricante, AD_Modelo, AD_Cambio, AD_Cor, AD_KM, AD_Placa, AD_Portas, AD_Foto1 FROM ADS, USERS WHERE CAT_ID = ? AND U_ID = AD_POSTER AND AD_APPROVED = 1 ORDER BY AD_ID DESC" rsAds_cmd.Prepared = truersAds_cmd.Parameters.Append rsAds_cmd.CreateParameter("param1", 5, 1, -1, rsAds__MMColParam) ' adDoubleSet rsAds = rsAds_cmd.ExecutersAds_numRows = 0%><%Dim rsCat__MMColParamrsCat__MMColParam = "1"if (Request.QueryString("cat_id") <> "") then rsCat__MMColParam = Request.QueryString("cat_id")%><%Dim rsCatDim rsCat_cmdDim rsCat_numRowsSet rsCat_cmd = Server.CreateObject ("ADODB.Command")rsCat_cmd.ActiveConnection = MM_conn_bank_dados_STRINGrsCat_cmd.CommandText = "SELECT CAT_ID, CAT_NAME, CAT_IMAGE FROM CATS WHERE CAT_ID = ?" rsCat_cmd.Prepared = truersCat_cmd.Parameters.Append rsCat_cmd.CreateParameter("param1", 5, 1, -1, rsCat__MMColParam) ' adDoubleSet rsCat = rsCat_cmd.ExecutersCat_numRows = 0%><%Dim rsSub__MMColParamrsSub__MMColParam = "2"if (Request.QueryString("cat_id")  <> "") then rsSub__MMColParam = Request.QueryString("cat_id") %><%set rsSub = Server.CreateObject("ADODB.Recordset")rsSub.ActiveConnection = MM_conn_bank_dados_STRINGrsSub.Source = "SELECT DISTINCTROW SUBS.SUB_ID, SUBS.CAT_ID, SUB_NAME,(SELECT COUNT (*)  FROM ADS WHERE SUBS.SUB_ID = ADS.SUB_ID AND AD_APPROVED = 1) AS TOTAL  FROM SUBS, ADS  WHERE SUBS.CAT_ID = " + Replace(rsSub__MMColParam, "'", "''") + "  ORDER BY SUB_NAME ASC"rsSub.CursorType = 0rsSub.CursorLocation = 2rsSub.LockType = 3rsSub.Open()rsSub_numRows = 0%><%' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters' create the list of parameters which should not be maintainedMM_removeList = "&index="If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""' add the URL parameters to the MM_keepURL stringFor Each Item In Request.QueryString  NextItem = "&" & Item & "="  If (InStr(1,MM_removeList,NextItem,1) = 0) Then    MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))  End IfNext' add the Form variables to the MM_keepForm stringFor Each Item In Request.Form  NextItem = "&" & Item & "="  If (InStr(1,MM_removeList,NextItem,1) = 0) Then    MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))  End IfNext' create the Form + URL string and remove the intial '&' from each of the stringsMM_keepBoth = MM_keepURL & MM_keepFormif (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)if (MM_keepURL <> "")  Then MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)' a utility function used for adding additional parameters to these stringsFunction MM_joinChar(firstItem)  If (firstItem <> "") Then    MM_joinChar = "&"  Else    MM_joinChar = ""  End IfEnd Function%><%Dim HLooper1__numRowsHLooper1__numRows = -6Dim HLooper1__indexHLooper1__index = 0rsSub_numRows = rsSub_numRows + HLooper1__numRows%><html><head><link href="css/css.css" rel="stylesheet" type="text/css"><style type="text/css"><!--.style2 {font-family: sans-serif}.style3 {color: #000099}.style4 {font-size: 12px}.style5 {color: #FFFFFF}.style6 {	font-family: sans-serif;	font-size: 12px;	color: #FFFFFF;}.style7 {	font-size: 12px;	font-family: sans-serif;	font-weight: bold;}.style11 {font-size: 12px; font-family: sans-serif; }.style13 {	font-size: 10px;	color: #666666;	font-weight: bold;}.style14 {	color: #666666;	font-weight: bold;}.style15 {color: #FFFF00}.style16 {font-family: Verdana}.style17 {font-size: 9px}--></style></head>&lt;script language="JavaScript">function MM_reloadPage(init) {  //reloads the window if Nav4 resized  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}MM_reloadPage(true);</script><table width="100%" border="0" cellspacing="0" cellpadding="1" bgcolor="#FFFFFF">  <tr>    <td height="25" align="left" valign="middle" bgcolor="#FFFFFF"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#996600">        <tr bgcolor="#FFFFFF">          <td height="25" align="left" valign="middle" bgcolor="#A6C4E1"><b>&nbsp;</b></td>        </tr>    </table></td>  </tr>  <tr>    <td align="left" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>  </tr>  <tr align="center" valign="top">    <td valign="middle" bgcolor="#FFFFFF"><form name="form2" method="post" action="subAds.asp?cat_id=<%=(rsSub.Fields.Item("SUB_ID").Value)%>" <%If (Not isNull((rsSub.Fields.Item("CAT_ID").Value))) Then If (CStr(rsSub.Fields.Item("SUB_ID").Value) = CStr((rsSub.Fields.Item("CAT_ID").Value))) Then Response.Write("SELECTED") : Response.Write("")%>">        <select name="select">          <%While (NOT rsSub.EOF)%>          <option value="<%=(rsSub.Fields.Item("SUB_ID").Value)%>" <%If (Not isNull((rsSub.Fields.Item("CAT_ID").Value))) Then If (CStr(rsSub.Fields.Item("SUB_ID").Value) = CStr((rsSub.Fields.Item("CAT_ID").Value))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rsSub.Fields.Item("SUB_NAME").Value)%></option>          <%  rsSub.MoveNext()WendIf (rsSub.CursorType > 0) Then  rsSub.MoveFirstElse  rsSub.RequeryEnd If%>        </select>        <input type="submit" name="Submit" value="Submit">    </form></td>  </tr>  <tr align="center" valign="top">    <td valign="middle" bgcolor="#FFFFFF"><table height="19" border="0" cellpadding="0" cellspacing="0">        <%startrw = 0endrw = HLooper1__indexnumberColumns = 6numrows = -1while((numrows <> 0) AND (Not rsSub.EOF))	startrw = endrw + 1	endrw = endrw + numberColumns %>        <tr align="center" valign="top">          <%While ((startrw <= endrw) AND (Not rsSub.EOF))%>          <td><table border="0" cellspacing="2" cellpadding="2">              <tr align="left">                <td valign="middle"><div align="center"><b><a href="subAds.asp?cat_id=<%=(rsSub.Fields.Item("CAT_ID").Value)%>&sub_id=<%=(rsSub.Fields.Item("SUB_ID").Value)%>" class="IconLinks style16 "><font size="-2"><%=(rsSub.Fields.Item("SUB_NAME").Value)%></font></a></b><font face="Verdana, Arial, Helvetica, sans-serif" size="1">-<%=(rsSub.Fields.Item("TOTAL").Value)%></font> </div></td>              </tr>          </table></td>          <%	startrw = startrw + 1	rsSub.MoveNext()	Wend	%>        </tr>        <% numrows=numrows-1 Wend %>    </table></td>  </tr></table></body></html><%rsAds.Close()%><%rsCat.Close()%><%rsSub.Close()%><------------------------------------------------Fim do código ---------------------------------->
Algo parecido pode ser visto em funcionamento
Desde já Grato pela atenção.

MCborges

IPB Skin By Virteq