      
|
Newsletters
<%
Dim sYear
Dim sMonth
sYear = "0"
sMonth = "0"
Dim sRef
Dim sName
For x = 0 to Ubound(arrNews)
sRef = "newsletter.asp#"
If Mid(strReverse(arrNews(x)),1,2) <> "||" Then
sRef = "newsletters/" & strReverse(Mid(strReverse(arrNews(x)),1,Instr(strReverse(arrNews(x)),"||")-1))
end if
If sYear <> Mid(arrNews(x),1,4) Then
if x > 0 then Response.Write " "
sYear = Mid(arrNews(x),1,4)
Response.Write "" & sYear & " "
End if
If sMonth <> Mid(arrNews(x),5,2) Then
sMonth = Mid(arrNews(x),5,2)
' Response.Write "" & MonthName(sMonth) & " "
end if
'response.write mid(arrNews(x),Instr(arrNews(x),"||")+1)
sName = mid(arrNews(x),Instr(arrNews(x),"||")+2)
sName = mid(sName,1,Instr(sName,"||")-1)
If Not sName > " " Then sName = MonthName(sMonth)
If sRef <> "newsletter.asp#" then
Response.Write "" & sName & " "
Else
'Response.Write "" & sName & " "
End If
Next
%>
|
   |
   |
<%
If Request.Form("spost") = 1 then
'Do Sub/UnSub
Dim sAct
Dim eCnt
SQL = "Select Count(strEmail) as Cnt From tblContact Where Upper(strEmail) = " & fnPrepForSQL(UCase(strEmail),8)
Set rs = conn.execute(SQL)
eCnt = rs("Cnt")
rs.close
Set rs = nothing
'response.Write Request.Form("submit")
If Request.Form("submit") = "Subscribe" Then
If eCnt = 0 Then
SQL = "Insert Into tblContact(strEmail,ysnActive) "
SQL = SQL & "Values(" & fnPrepForSQL(Request.Form("strEmail"),8) & ",1)"
'Response.Write SQL
Conn.Execute(SQL)
Response.Write "Thank you for subscribing to our newsletter."
else
Response.Write "You are already subscribed. Please contact us if you are not receiving newsletter emails."
end if
End if
If Request.Form("submit") = "Unsubscribe" Then
If eCnt = 0 then
SQL = "Delete From tblContact Where strEmail = " & fnPrepForSQL(Request.Form("strEmail"),8)
conn.execute(SQL)
Response.Write "We're sorry to see you go. Please feel free to contact us if you have any comments."
Else
Response.Write "You are not subscribed. If you are receiving unwanted email please contact us immediately."
End If
End If
Else %>
<%
End If
%>
|