SQLdispo = " SELECT * FROM dispotmp"
Set RSdispo = Conn.Execute(SQLdispo)
IF not RSdispo.EOF Then
Do While Not RSdispo.EOF
SQL = " SELECT * FROM prodotti WHERE codice = '" & RSdispo("codice") & "'"
Set RSecom = Conn4.Execute(SQL)
c = CDbl(RSdispo("prezzolistino"))
s = CDbl(RSdispo("prezzopromo"))
r = CDbl(RSdispo("prezzorivenditore"))
eprezzoc = c * 100
eprezzor = r * 100
eprezzos = s * 100
edata = Data_Testo_Breve(RSdispo("dataagg"))
imgb = RSdispo("imgbig")
imgs = RSdispo("imgsmall")
gfoto = "/ecomm/img/"&imgb
pfoto = "/ecomm/img/marche/"&imgs
IF RSdispo("datapromoda") > 0 Then offerta = "True" Else offerta = "False" End If
IF not RSecom.EOF Then
Do While Not RSecom.EOF
If RSdispo("codice") = RSecom("codice") Then
Conn4.Execute("UPDATE prodotti SET spesespedizione = 900, iva = 20,giacenzainfinita = False, giacenza = '" & RSdispo("dispo") &"', offerta = " & offerta & " , data = '" & edata & "', SPrezzo = '" & eprezzos &"', Rprezzo = '" & eprezzor &"', Cprezzo = '" & eprezzoc &"', Gdescrizione = '" & Change(RSdispo("descestesa")) & "', Prodotto = '" & Change(RSdispo("descrizione")) & "', marca = '" & RSdispo("nomecasaprod") &"', Pfoto = '" & pfoto &"', Gfoto = '" & gfoto & "' WHERE codice = '" & RSdispo("codice") &"'")
End If
RSecom.MoveNext
Loop
Else
Conn4.Execute("INSERT INTO prodotti (spesespedizione, giacenzainfinita, giacenza, data , scategoria, categoria, marca, prodotto, gdescrizione, pfoto, gfoto, Cprezzo, Rprezzo, Sprezzo, codice, offerta, iva) VALUES (900, False, '" & RSdispo("dispo") & "', '" & edata & "', '" & RSdispo("scat") & "', '" & RSdispo("cat") & "', '" & RSdispo("nomecasaprod") & "', '" & Change(RSdispo("descrizione")) & "', '" & Change(RSdispo("descestesa")) & "', '" & pfoto & "', '" & gfoto & "', '" & eprezzoc & "', '" & eprezzor & "', '" & eprezzos & "', '" & RSdispo("codice") & "', " & offerta & ", 20)")
End If
%><%
RSdispo.MoveNext
Loop
End If
%>