%@LANGUAGE="VBSCRIPT"%>
<%
Session.LCID = 1040
%>
<%
dim ConvertDate2American
ConvertDate2American = Month(date)&"/"&Day(date)&"/"&Year(date)
%>
<%
Dim Rs_news
Dim Rs_news_cmd
Dim Rs_news_numRows
Set Rs_news_cmd = Server.CreateObject ("ADODB.Command")
Rs_news_cmd.ActiveConnection = MM_conn_marcia_STRING
Rs_news_cmd.CommandText = "SELECT * FROM news ORDER BY data DESC"
Rs_news_cmd.Prepared = true
Set Rs_news = Rs_news_cmd.Execute
Rs_news_numRows = 0
%>
<%
Dim Rs_gallery
Dim Rs_gallery_cmd
Dim Rs_gallery_numRows
Set Rs_gallery_cmd = Server.CreateObject ("ADODB.Command")
Rs_gallery_cmd.ActiveConnection = MM_conn_marcia_STRING
Rs_gallery_cmd.CommandText = "SELECT * FROM gallery ORDER BY id DESC"
Rs_gallery_cmd.Prepared = true
Set Rs_gallery = Rs_gallery_cmd.Execute
Rs_gallery_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 5
Repeat1__index = 0
Rs_news_numRows = Rs_news_numRows + Repeat1__numRows
%>
<%
Dim HLooper1__numRows
HLooper1__numRows = 9
Dim HLooper1__index
HLooper1__index = 0
Rs_gallery_numRows = Rs_gallery_numRows + HLooper1__numRows
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index
Repeat2__numRows = 3
Repeat2__index = 0
Rs_appuntamenti_numRows = Rs_appuntamenti_numRows + Repeat2__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
' IIf implementation
Function MM_IIf(condition, ifTrue, ifFalse)
If condition = "" Then
MM_IIf = ifFalse
Else
MM_IIf = ifTrue
End If
End Function
%>
<%
If (CStr(Request("MM_insert")) = "form2") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_conn_marcia_STRING
MM_editCmd.CommandText = "INSERT INTO mailing (nome, mail, privacy) VALUES (?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 250, Request.Form("nome")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 250, Request.Form("mail")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 1, MM_IIF(Request.Form("privacy"), "Y", "N")) ' adVarWChar
session("user_ml") = request.form("nome")
session("mail_ml") = request.form("mail")
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "conferma_reg_mailing.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>