Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    Menu' Mega Dropdown, interfacciato con sql

    Ciao a tutti,
    non so se devo postare qui, in Database o ASP.

    Il fatto è questo,
    io ho prelevato un menù MegaDropdown e vorrei farlo interfacciare con SQL, in modo che le voci del menù e sotto meù, con i relativi collegamenti, li prenda in automatico.
    Sinceramente nn sono capace, ci ho provato ma senza riuscirci....
    Io un menù generico che preleva le infomazioni dal DB già ce l'ho ed è questo:
    codice:
    	<table  width="150" cellspacing="0" cellpadding="3" bordercolordark="#E5E5E5" bordercolorlight="#000000" border="0" style="border-left: 0px dotted #C0C0C0; border-right: 1px dotted #C0C0C0; border-bottom: 1px dotted #C0C0C0; border-top-color:#C0C0C0; border-top-width:0px">
    		<tr>
    			<td valign="top" bgcolor="<%=Tabella_Colore_Cella%>" style="border-left-style: none; border-left-width: medium; border-top-style: none; border-top-width: medium">
    				
    
    <%
    	Dim SQLCat, RSCat, Icat, QSSCategoria, SCatArr, CatArr, BoolCategorie, K
    	SQLCat = " SELECT ID, SCategoria FROM SCategorie ORDER by Scategoria asc "
    	Set RScat = Conn.Execute(SQLCat)	
    	If Not RSCat.EOF Then
    		SCatArr = RScat.GetRows
    
    		If QSSCategoria <> "" Then
    			SQLCat = " SELECT ID, Categoria FROM Categorie WHERE SCategoria = " & QSSCategoria
    			Set RSCat = Conn.Execute(SQLCat)
    			If Not RSCat.EOF Then 
    				CatArr = RSCat.GetRows
    				BoolCategorie = True
    			Else
    				BoolCategorie = False
    			End If
    			RSCat.Close
    		End If
    		For Icat = 0 to UBound(SCatArr, 2)%>
    		
    		<div align="left">
    
    
    
    
    <table id="demo" class="ruler" cellpadding="5" style="border:1px solid #FFFFFF; " width="100%">
    <tr>
    <td>				
    		<%
    
    sqlcont = " SELECT COUNT(*) AS TotaleRecord FROM Prodotti WHERE cancellato = false and sCategoria = "&sCatArr(0,ICat)
    Set rscont = Conn.Execute(sqlcont)
    Rectot = (rscont("TotaleRecord"))
    rscont.Close
    Set rscont= Nothing
    %><%if CStr(SCatArr(0,ICat)) = QSSCategoria then%>
    <%if QSCategoria <> "" then %>
    				■  <%=SCatArr(1,ICat)%> (<%Response.Write rectot%>)					
    
    <%end if%>
    <%if QSCategoria = "" then %>
    
    				►  <%=SCatArr(1,ICat)%> (<%Response.Write rectot%>)
    <%end if%>
    <%else%>
    				■  <%=SCatArr(1,ICat)%> (<%Response.Write rectot%>)					
    <%end if%>
    </td>
    </tr>
    </table>
    <%
    			If CStr(SCatArr(0,ICat)) = QSSCategoria Then
    				If boolCategorie Then
    					For K = 0 To UBound(CatArr,2)
    %>
    <% 
    
    sqlcontsc = " SELECT COUNT(*) AS TotaleRecord FROM Prodotti WHERE cancellato = false and Categoria = "&CatArr(0,k)
    Set rscontsc= Conn.Execute(sqlcontsc)
    Rectotsc = (rscontsc("TotaleRecord"))
    rscontsc.Close
    Set rscontsc = Nothing
    %>
    <%if CStr(CatArr(0,k)) = QSCategoria then%>
    <%if SCategoria <> "" then%>
    ▪<%=CatArr(1,k)%> (<%Response.Write rectotsc%>)
    <%end if%>
    <%if SCategoria = "" then%>
    ►<%=CatArr(1,k)%>(<%Response.Write rectotsc%>)
    <%end if%>
    <%
    			SQLCat = " SELECT * FROM S_Categorie WHERE Categoria = " & CatArr(0,k)
    			Set RSCat = Conn.Execute(SQLCat)
    			While Not RSCat.EOF			
    			%>
    			<%
    sqlcontsc2 = " SELECT COUNT(*) AS TotaleRecord FROM Prodotti WHERE cancellato = false and S_Categoria = "&RSCat("ID")
    Set rscontsc2= Conn.Execute(sqlcontsc2)
    Rectotsc2 = (rscontsc2("TotaleRecord"))
    rscontsc2.Close
    Set rscontsc2 = Nothing
    %>
    			<%if StrComp(SCategoria, RSCat("ID")) <> 0 then%>			
    			▪"><%=RSCat("S_Categoria")%> (<%=Rectotsc2%>)
    
    			<%end if%>
    			<%if StrComp(SCategoria, RSCat("ID")) = 0 then%>			
    			►<%=RSCat("S_Categoria")%> (<%=Rectotsc2%>)
    
    			<%end if%>
    
    <%
    RSCat.MoveNext
    Wend
    RSCat.close
    
    %>
    <%else%>
    
    <%if SCategoria = "" then%>
    ▪<%=CatArr(1,k)%> (<%Response.Write rectotsc%>)
    
    <%end if%>
    <%if SCategoria <> "" then%>
    ▪<%=CatArr(1,k)%> (<%Response.Write rectotsc%>)
    
    <%end if%>
    <%end if%>
    <%
    					Next
    				End If
    			End If
    		Next
    	Else
    %>
    				<%=NoCategoria%>
    
    <%
    	End If
    %>
    
    			</td>
    		</tr>
    	</table>
    grazie

  2. #2
    Forse questa nn è la sezione giusta????

    non mi dite niente????

  3. #3
    ^.^ quanto tempo hehe

    ma te hai gia scritto qualcosa? hai un programma? errori?

  4. #4
    CIao,scusa il ritardo.
    Io ho il menù che ho postato (li prelevo le info dal DB)
    Poi ho il classico menù dropdown, sia in verticale che orizzontale, a me piacerebbe realizzarlo in orizzontale,
    ti passo il codice
    codice:
    <div id="menu">
    <ul id="nav">[*]
        <h2>Home</h2>
    [*]
       <h2>Informatica</h2>
       <div class="mega">
          <div>
                <h3>Computer</h3>
    
                <ul>[*]Netbook[*]Portatili[*]Desktop[*]Accessori[/list]
                <h3>Memorie</h3>
    
                <ul>[*]Pendrive USB[*]SD e Micro SD[*]CD, DVD e Blueray[*]Hard disk esterni[*]Masterizzatori
    [/list]
          </div>
          <div>
               <h3>Periferiche</h3>
               <ul>[*]Stampanti ink-jet[*]Stampanti laser
    [*]Speaker[*]Cuffie e microfoni[*]Mouse[*]Monitor[*]VOIP[*]Modem e Wi-Fi
    [*]Altri accessori[/list]
          </div>
        </div>[*]
       <h2>Console e giochi</h2>
        <div class="mega">
               <div>
    
                <h3>Console</h3>
                <ul>[*]Nintendo DS[*]Nintendo Wii[*]Playstation 3[*]Playstation PSP
    [*]XBox[/list]</div>
               <div>
                <h3>Giochi PC</h3>
                <ul>[*]Strategia[*]Azione
    [*]Avventura[*]Offerte[*]I pi&ugrave; venduti[/list]</div>
        </div>
    e così via.
    Potresti darmi una mano, io penso di nn essere capace ad interfacciarli

    grazie

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.