%@LANGUAGE="VBSCRIPT"%>
<%
function get_marca(txt)
pstart=instr(txt,"")
pend=instr(txt,"")
get_marca=replace(mid(txt,pstart+3,pend-4),"'"," ")
end function
function gif_maimeri(f,cod)
Dim rs_testa
Dim rs_testa_numRows
Set rs_testa = Server.CreateObject("ADODB.Recordset")
rs_testa.ActiveConnection = MM_sebino_connection_STRING
rs_testa.Source = "SELECT * FROM conversione WHERE folder='" & f & "'"
rs_testa.CursorType = 0
rs_testa.CursorLocation = 2
rs_testa.LockType = 1
rs_testa.Open()
rs_testa_numRows = 0
if (instr(f,"blu")=0) then
t=rs_testa.fields.item("stringa").value
else
t=""
end if
if (cod<100) then
t=t & "0"
end if
gif_maimeri= t & cod
rs_testa.Close()
Set rs_testa = Nothing
end function
function get_ausiliari(cod)
Dim rs_testa
Dim rs_testa_numRows
Set rs_testa = Server.CreateObject("ADODB.Recordset")
rs_testa.ActiveConnection = MM_sebino_connection_STRING
rs_testa.Source = "SELECT * FROM tipo_ausiliari WHERE tipo='" & cod & "'"
rs_testa.CursorType = 0
rs_testa.CursorLocation = 2
rs_testa.LockType = 1
rs_testa.Open()
rs_testa_numRows = 0
get_ausiliari=rs_testa.fields.item("ausiliario").value & "&tipo2=" & rs_testa.fields.item("ausiliario2").value & "&tipo3=" & rs_testa.fields.item("ausiliario3").value & "&tipo4=" & rs_testa.fields.item("ausiliario4").value
rs_testa.Close()
Set rs_testa = Nothing
end function
%>
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "form1") Then
MM_editConnection = MM_sebino_connection_STRING
MM_editTable = "ordini"
MM_editRedirectUrl = "upgrade.asp"
MM_fieldsStr = "codprod|value|descrizione|value|peso|value|sessionID|value|prezzo|value|quantita|value"
MM_columnsStr = "cod_prod|',none,''|descrizione|',none,''|peso|',none,''|SessionId|',none,''|prezzo|',none,''|quantita|none,none,NULL"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValues
Dim MM_dbValues
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement
MM_tableValues = ""
MM_dbValues = ""
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_tableValues = MM_tableValues & ","
MM_dbValues = MM_dbValues & ","
End If
MM_tableValues = MM_tableValues & MM_columns(MM_i)
MM_dbValues = MM_dbValues & MM_formVal
Next
MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then
' execute the insert
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
on error resume next
MM_editCmd.Execute
if err.number <> 0 then
response.Redirect("noqty.asp")
end if
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
cod1=request("cod")
if cod1=300 then
tipolibri="restauro"
else
tipolibri="belle arti"
end if
if (cod1=200) then
cat="OLIO"
end if
if (cod1=100) then
cat="PIGM"
end if
if (cod1=1000) then
cat="P CERA"
end if
if (cod1=800) then
cat="P SECCHI"
end if
if (cod1=900) then
cat="P OLIO"
end if
if (cod1=400) then
cat="ACQ"
end if
if (cod1=600) then
cat="TEMP"
end if
if (cod1=300) then
cat="REST"
end if
if (cod1=500) then
cat="ACR"
end if
%>
<%
Dim rs_descrizione
Dim rs_descrizione_numRows
n=request("nome")
n=replace(n,"'","''")
Set rs_descrizione = Server.CreateObject("ADODB.Recordset")
rs_descrizione.ActiveConnection = MM_sebino_connection_STRING
rs_descrizione.Source = "SELECT * FROM descrizioni WHERE marca LIKE '" & n & "%'"
rs_descrizione.CursorType = 0
rs_descrizione.CursorLocation = 2
rs_descrizione.LockType = 1
rs_descrizione.Open()
rs_descrizione_numRows = 0
nmarca=replace((request("nome"))," ","")
descriz=(rs_descrizione.Fields.Item("descrizione").Value)
fotomarca="foto_" & lcase(nmarca) & ".jpg"
gifmarca="T_" & lcase(nmarca) & ".gif"
tt=(rs_descrizione.Fields.Item("testotabella").Value)
tmarca=get_marca(tt)
%>
<%
%>
<%
if (request("ord")="") then
ord="ORDER BY cod_prod ASC"
end if
if (request("ord")="codsu") then
ord="ORDER BY cod_prod ASC"
end if
if (request("ord")="codgiu") then
ord="ORDER BY cod_prod DESC"
end if
if (request("ord")="prodsu") then
ord="ORDER BY prodotto ASC"
end if
if (request("ord")="prodgiu") then
ord="ORDER BY prodotto DESC"
end if
cod=request("cod")
nome=replace(request("nome"),"'","''")
%>
<%
Dim rs_colori
Dim rs_colori_numRows
Set rs_colori = Server.CreateObject("ADODB.Recordset")
rs_colori.ActiveConnection = MM_sebino_connection_STRING
rs_colori.Source = "SELECT * FROM colori WHERE cod_macro= '" & cod & "' AND descrizione LIKE '" & nome & "%' " & ord
rs_colori.CursorType = 0
rs_colori.CursorLocation = 2
rs_colori.LockType = 1
rs_colori.Open()
rs_colori_numRows = 0
f=""
numf=0
contcol=0
while (NOT rs_colori.EOF)
contcol=contcol+1
descr=rs_colori.fields.item("descrizione")
'recupero formato
if (instrrev(descr,"ml")<>0) then
stringa=mid(descr,1,instrrev(descr,"ml")-2)
pos=instrrev(stringa," ")
f1=mid(stringa,pos)
fstr="*" & f1 & "*"
end if
if (instr(f,fstr)=0) then
numf=numf+1
f=f & fstr
end if
rs_colori.movenext
wend
if (contcol>0) then
rs_colori.movefirst
end if
%>
Sebino Colori - Tutto per l'arte - colori - pennelli - carta - cavalletti - libri