Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 15

Discussione: conta = conta + 1

  1. #1

    conta = conta + 1

    Ragazzi, nn sono proprio capace,
    chiedo gentilmente il Vs prezioso aiuto.

    devo fare stampare a video i nomi prodotti, ma si devono "distribuire" in 4 colonne,potete aiutarmi???
    grazie
    codice:
    <%
    If (QSSCategoria = "") AND (QSCategoria = "") AND (QSQuery = "") AND (SCategoria = "") Then
    			Response.Redirect Request.ServerVariables("HTTP_REFERER")
    		Else
    '---Stampo a video i prodotti delle categorie richieste
    			Set RS = Server.CreateObject("ADODB.RecordSet")
    			RS.PageSize = MaxProdottiPerPagina
    			
    			If QSQuery2 <> "" Then
    				QSQuery2 = Replace(QSQuery2, "'", "''")
    				ArrQuery = Split(QSQuery2, " ")
    				SQL = " SELECT * FROM Prodotti WHERE "
    				For i = 0 to UBound(ArrQuery, 1)
    					SQL = SQL & "(categoriasotto LIKE '%" & ArrQuery(i) & "%' OR categoriasotto LIKE '%" & ArrQuery(i) & "%' OR categoriasotto LIKE '%" & ArrQuery(i) & "%') AND "
    				Next
    				SQL = SQL & "Cancellato = False"
    				RS.Open SQL, Conn, 1
    			Else
    			
    				If (QSCategoria = "") Then
    					SQL = " SELECT * FROM Prodotti WHERE SCategoria = "& [QSSCategoria] &" AND Cancellato = False ORDER BY ID DESC "
    					RS.Open SQL, Conn, 1
    				End If
    	
    				If (QSCategoria <> "") Then
    					SQL = " SELECT * FROM Prodotti WHERE Categoria = "& [QSCategoria] &" AND Cancellato = False ORDER BY ID DESC"
    					RS.Open SQL, Conn, 1
    				End If
    				If (SCategoria <> "") AND (QSCategoria <> "") AND (SCategoria <> "")Then
    					SQL = "SELECT * FROM Prodotti WHERE S_Categoria = "& [SCategoria] &" AND Cancellato = False ORDER BY ID DESC "
    				end if
    
    			End If
    			
    
    			If Not RS.EoF Then 
    				RS.MoveFirst
    				RS.AbsolutePage = QSPg
    
    			Prima = "<img border=0 src=interfaccia/prima.jpg align=center>"
    			Precedente = "<img border=0 src=interfaccia/sinistra.jpg align=center>"
                ultima = "<img border=0 src=interfaccia/ultima.jpg align=center>"
                Successiva = "<img border=0 src=interfaccia/destra.jpg align=center>"
    
                                   If QSPg <> 1 Then
    					Footer = "" & Prima & " "
                                            Footer = Footer & "" & Precedente & " "
    				Else
    					Footer =  " "
                                     Footer = Footer &  " "
    				End If
    				
    					For I = 1 To RS.PageCount
    					If I = QSPg Then
    						Footer = Footer & I & " "
    					Else
    						Footer = Footer & "<font size = 4 color = red ><font size = 2 >"& I &"</font> "
    					End If
    				Next
    				
    
    				If QSPg <> RS.PageCount Then
    					Footer = Footer & "" & Successiva & " "
    					Footer = Footer & "" & ultima & ""
    				Else
    					Footer = Footer & " "
    				End If
    
    				For I = 1 To RS.PageSize
    					If RS.EOF Then Exit For
    if Tabella_Colore_Cella="#FFFFFF" then
    Tabella_Colore_Cella="#DEDEDE"
    else
    Tabella_Colore_Cella="#FFFFFF"
    end if 
    %>
    
    <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0">
      <tr bordercolor="#FF6600" bgcolor="#ececec"> 
        <td height="25" style="border:1px dashed #999999" > "><%=RS("Prodotto")%></td>
      </tr>
    
      <%RS.MoveNext
    				Next%>
      <%Else
    %>
      
    
      <%=NoRecordTrovati%> 
      <%
    			End If
    		End If
    		RS.Close
    %>
    </table>

  2. #2
    nel ciclo for lascia solo il td

    <td height="25" style="border:1px dashed #999999" > "><%=RS("Prodotto")%></td>

    il resto
    <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0">
    <tr bordercolor="#FF6600" bgcolor="#ececec">
    mettilo fuori

    ovvero

    codice:
    ...
    <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0">
      <tr bordercolor="#FF6600" bgcolor="#ececec"> 
    				For I = 1 To RS.PageSize
    					If RS.EOF Then Exit For
    if Tabella_Colore_Cella="#FFFFFF" then
    Tabella_Colore_Cella="#DEDEDE"
    else
    Tabella_Colore_Cella="#FFFFFF"
    end if 
    %>
      <td height="25" style="border:1px dashed #999999" >  "><%=RS("Prodotto")%></td>
       <%RS.MoveNext
    				Next%>
     </tr>
      <%Else
    ...

    poi metti un controllo che a 4 colonne si fermi o vada a capo o quello che deve fare..lo sai te ^.^

  3. #3
    Ciao Grambo,
    buongiorno
    grazie della risposta.
    Io ho fatto in questo modo, solo che sbaglio da qualche parte, perchè mi si "restringe" il tutto.
    Potresti darmi una mano a verificare dov'è l'errore???

    codice:
    <%
    	'VERSIONE FILE 1.5.Ver.3 Moicans & Snake
    %>
    
    <table style="border:1px dashed #999999" border="0" cellPadding="0"width="95%" cellspacing="0" align="center">
      <tr> 
        <td bgcolor="#D6D6D6"> 
          <%
    '---Dichiarazione variabili
    	Dim SQL, RS, I, Footer, RStip, Index, ArrQuery,Precedente, Successiva,prima,ultima
    
    	If (QSSCategoria <> "") Or (QSQuery <> "") Then%>
          <%Dim smSQLCat, smRSCat, smscat, smcat, smdovesei
    		 
    		 if QSSCategoria <>"" then
    		 		smSQLCat = " SELECT ID, SCategoria FROM SCategorie where ID="&Cint(QSSCategoria)
    				smscat=""
    				Set smRScat = Conn.Execute(smSQLCat)
    				If Not smRSCat.EOF Then
    					 smscat=smRScat("Scategoria")
    				end if
    				smRSCat.close	
    			end if	
    			
    			if QSCategoria <>"" then
    				 smSQLCat = " SELECT * FROM Categorie  where ID="&Cint(QSCategoria)
    				 smcat=""
    				 Set smRScat = Conn.Execute(smSQLCat)
    				 If Not smRSCat.EOF Then
    				 		smcat=smRScat("Categoria")
    				 end if
    			smRSCat.close	
    			end if
    			
    			if SCategoria <>"" then
    				 smSQLCat = " SELECT * FROM S_Categorie  where id="&Cint(SCategoria)
    				 smca=""
    				 Set smRScat = Conn.Execute(smSQLCat)
    				 If Not smRSCat.EOF Then
    				 		smca=smRScat("S_Categoria")
    				 end if
    			smRSCat.close	
    			end if		
    						
    						smdovesei="[img]&Path_Img&[/img]"%>
          <%if smscat<>"" then
    				 smdovesei=smdovesei&""&smscat&""
    			end if
    			
    			if smcat<>"" then
    
    				 smdovesei=smdovesei&"[img]&Path_Img&[/img]<font color=#336699>"&smcat&"</font>"
    			end if
    			
    			if smca<>"" then
    
    				 smdovesei=smdovesei&"[img]&Path_Img&[/img]<font color=#336699>"&smcat&"</font>"
    			end if
    
    			if QSQuery2<>"" then
    				 smdovesei=smdovesei&" [img]&Path_Img&[/img]"&QSQuery2&""
    			end if
    			
    			response.write(smdovesei)
    						
    	 
    %>
          <%
    	End If
    %>
        </td>
      </tr>
    </table>
    <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
      <tr> 
        <td> 
          
    
    
    <%
    If (QSSCategoria = "") AND (QSCategoria = "") AND (QSQuery = "") AND (SCategoria = "") Then
    			Response.Redirect Request.ServerVariables("HTTP_REFERER")
    		Else
    '---Stampo a video i prodotti delle categorie richieste
    			Set RS = Server.CreateObject("ADODB.RecordSet")
    			RS.PageSize = MaxProdottiPerPagina
    			'RS.PageSize = 10
    			
    			If QSQuery2 <> "" Then
    				QSQuery2 = Replace(QSQuery2, "'", "''")
    				ArrQuery = Split(QSQuery2, " ")
    				SQL = " SELECT * FROM Prodotti WHERE "
    				For i = 0 to UBound(ArrQuery, 1)
    					SQL = SQL & "(categoriasotto LIKE '%" & ArrQuery(i) & "%' OR categoriasotto LIKE '%" & ArrQuery(i) & "%' OR categoriasotto LIKE '%" & ArrQuery(i) & "%') AND "
    				Next
    				SQL = SQL & "Cancellato = False"
    				RS.Open SQL, Conn, 1
    			Else
    			
    				If (QSCategoria = "") Then
    					SQL = " SELECT * FROM Prodotti WHERE SCategoria = "& [QSSCategoria] &" AND Cancellato = False ORDER BY ID DESC "
    					RS.Open SQL, Conn, 1
    				End If
    	
    				If (QSCategoria <> "") Then
    					SQL = " SELECT * FROM Prodotti WHERE Categoria = "& [QSCategoria] &" AND Cancellato = False ORDER BY ID DESC"
    					RS.Open SQL, Conn, 1
    				End If
    				If (SCategoria <> "") AND (QSCategoria <> "") AND (SCategoria <> "")Then
    					SQL = "SELECT * FROM Prodotti WHERE S_Categoria = "& [SCategoria] &" AND Cancellato = False ORDER BY ID DESC "
    				end if
    
    			End If
    
    			If Not RS.EoF Then 
    				RS.MoveFirst
    				RS.AbsolutePage = QSPg
    
    			Prima = "<img border=0 src=interfaccia/prima.jpg align=center>"
    			Precedente = "<img border=0 src=interfaccia/sinistra.png align=center>"
                ultima = "<img border=0 src=interfaccia/ultima.jpg align=center>"
                Successiva = "<img border=0 src=interfaccia/destra.png align=center>"
    
                                   If QSPg <> 1 Then
    					Footer = "" & Prima & " "
                                            Footer = Footer & "" & Precedente & " "
    				Else
    					Footer =  " "
                                     Footer = Footer &  " "
    				End If
    				
    					For I = 1 To RS.PageCount
    					If I = QSPg Then
    						Footer = Footer & I & " "
    					Else
    						Footer = Footer & "<font size = 4 color = red ><font size = 2 >"& I &"</font> "
    					End If
    				Next
    				
    
    				If QSPg <> RS.PageCount Then
    					Footer = Footer & "" & Successiva & " "
    					Footer = Footer & "" & ultima & ""
    				Else
    					Footer = Footer & " "
    				End If
    
    %>
    <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0">
    <%
    cont=0
    				For I = 1 To RS.PageSize
    cont=cont+1
    
    if cont=1 then
    %>
      <tr bordercolor="#FF6600" bgcolor="#ececec"> 
    <%
    end if				
    					If RS.EOF Then Exit For
    if Tabella_Colore_Cella="#FFFFFF" then
    Tabella_Colore_Cella="#DEDEDE"
    else
    Tabella_Colore_Cella="#FFFFFF"
    end if 
    %>
    <td height="25" style="border:1px dashed #999999" >
    <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0">
    		<tr bordercolor="#FF6600" bgcolor="#ececec"> 
    			<td height="25" style="border:1px dashed #999999" > "><%=RS("Prodotto")%></td>
    		</tr>
    	</table>
    </td>  
      <%if cont=4 then%>
      </tr>
    <%
    cont=0
    end if
    %>
      <%RS.MoveNext
    				Next%>
      <%Else
    %>
      
    
      <%=NoRecordTrovati%> 
      <%
    			End If
    		End If
    		RS.Close
    %>
    <%if cont<4 then
    for a=cont to 3
    %>
    <td></td>
    <%
    next
    %>
    </tr>
    <%end if%>
    </table>
    
    
    
    <p align="center"> <%=Footer%> </p>

  4. #4
    scusa mi passi solo la parte di codice che ti da problema? tra tutte queste tabelle variabili ecc non sto capendo molto anche perchè non posso vedere il risultato ^.^

  5. #5
    Si hai ragione scusa...

  6. #6
    forse ho trovato =)

    codice:
    if cont=1 then
    %>
      <tr bordercolor="#FF6600" bgcolor="#ececec"> 
    <%
    end if				
    					If RS.EOF Then Exit For
    if Tabella_Colore_Cella="#FFFFFF" then
    Tabella_Colore_Cella="#DEDEDE"
    else
    Tabella_Colore_Cella="#FFFFFF"
    end if 
    %>
    <td width="25%" height="25" style="border:1px dashed #999999" >"><%=RS("Prodotto")%></td>  
      <%if cont=4 then%>
      </tr>
    <%
    cont=0
    end if

  7. #7
    Si il problema è li:

    codice:
        <table width="95%" align="center" cellpadding="0" cellspacing="0" border="0">
          <%
    cont=0
    				For I = 1 To RS.PageSize
    cont=cont+1
    
    if cont=1 then
    %>
          <tr bordercolor="#FF6600" bgcolor="#ececec"> 
            <%
    end if				
    %>
            <td height="25" style="border:1px dashed #999999" >  "><%=RS("Prodotto")%> 
           <%if cont=4 then%> </td>
          </tr>
          <%
    cont=0
    end if
    %>
          <%RS.MoveNext
    				Next%>
          <%Else
    %>
          
    
          <%=NoRecordTrovati%> 
          <%
    			End If
    		End If
    		RS.Close
    %>
          <%if cont<4 then
    for a=cont to 3
    %>
          <%end if%><%end if%><%end if%>
        </table>
    ora in questo modo mi restituisce questo errore:
    Microsoft VBScript compilation error '800a0400'

    Expected statement

    /include/inc_catalogo_cartucce.asp, line 180

    end if
    ^

  8. #8
    secondo me ci sono pochi end if
    contali ^.^

  9. #9
    Non è quelo il problema,
    xchè li avevo messi x prova...
    ma l'errore è sempre lo stesso, anche se lascio i suoi 2 ultimi e basta

  10. #10
    posta tutto il codice vediamo se hai qualche end if di troppo o in meno =)

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.