%
dim showMsgs
Dim archiveFileNameStr(),archiveTitleStr(),archiveDateStr(),archiveFileNoStr()
Dim arrMonthName(12)
arrMonthName(0)="Jan"
arrMonthName(1)="Jan"
arrMonthName(2)="Feb"
arrMonthName(3)="Mar"
arrMonthName(4)="Apr"
arrMonthName(5)="May"
arrMonthName(6)="Jun"
arrMonthName(7)="Jul"
arrMonthName(8)="Aug"
arrMonthName(9)="Sep"
arrMonthName(10)="Oct"
arrMonthName(11)="Nov"
arrMonthName(12)="Dec"
Call getArchiveContents()
%>
|
| » Resources » News Letter Sign Up » Market Alert |
|
| |
|
| Date |
Title |
View |
| <%=archiveDateStr(0)%> |
<%=archiveTitleStr(0)%> |
 |
|
|
|
|
| |
<% if Ubound(archiveFileNameStr)-1=0 then%>
Not found
<%end if%>
<%
Dim i
Dim bgColorVal
For i=1 to Ubound(archiveFileNameStr)-1
classname="Ncm_members_main_list2"
If i mod 2=1 Then
classname="Ncm_members_main_list1"
end if
%>
| <%=i%> |
<%=archiveDateStr(i)%> |
<%=archiveTitleStr(i)%> |
|
<% Next %>
|
| |
| |
 |
Comments Entry Form |
* Mandatory |
 |
|
<%
Dim selArchiveTitleStr,txtNameStr,txtEmailStr,countryStr,txtCommentsStr
Dim IsStored,responseStrc
Dim tmpCountryName,tmpRegionName,tmpCityName,ipAddressVal
Dim styleleft,styleright,styleend
Dim hasSent1234
responseStrc=""
If Ucase(Trim(Request.ServerVariables("REQUEST_METHOD")))="POST" and session("commentsName")="" Then
selArchiveTitleStr=Trim(Request.Form("selArchiveTitle"))
txtNameStr=Trim(Request.Form("txtName"))
txtEmailStr=Trim(Request.Form("txtEmail"))
countryStr=Trim(Request.Form("selCountry"))
txtCommentsStr=Trim(Request.Form("txtComments"))
ipAddressVal=Request.ServerVariables("REMOTE_ADDR")
tmpCountryName=Trim(Request.Form("cnn"))
tmpRegionName=Trim(Request.Form("rgn"))
tmpCityName=Trim(Request.Form("cyn"))
if selArchiveTitleStr="" Then responseStrc="Select your archive title "
if txtNameStr="" then responseStrc="Enter your name "
if txtEmailStr="" then responseStrc=responseStrc & "Enter your email ID "
if countryStr="" then responseStrc=responseStrc & "Select your country "
If txtCommentsStr="" Then responseStrc=responseStrc & "Enter your comments "
dim spamStop1,hasMailSent123
spamStop1 = trim(request.form("EmailAddress"))
if spamStop1 <> "" then
' hasMailSent123=sendMail("routed from mexnepal-"&request.form("EmailAddress"),"routed from mexnepal - Market Alert","info@mexnepal.com","MexNepal","venkat@kappsoft.com","venkat","")
responseStrc=responseStrc&" Invalid Entry"
end if
if responseStrc="" then
If Request.Form("txtChar") <> Session("captcha_code") Then
ErrStr="Your Image character is not valid, Please try again"
SuccessStr=False
else
SuccessStr=True
end if
end if
end if
If SuccessStr=True Then
set dbconn=getDB()
sql="insert into market_alert (archive_title, firstname, email_id, country, comments, entry_date, ipaddress) values('"& fixQuotes(selArchiveTitleStr) &"', '"& fixQuotes(txtNameStr) &"','"& fixQuotes(txtEmailStr) &"','"& fixQuotes(countryStr) &"','"& fixQuotes(txtCommentsStr) &"','"& Now() &"','"& ipAddressVal &"')"
dbconn.execute(sql)
session("commentsName")=txtNameStr
styleleft=""
styleright=""
styleend=""
msg=""
msg=msg &"| | "
msg=msg &"| Market Alert Comments - Mex Nepal | "
msg=msg &"| | "
msg=msg &"| "& styleleft &" Archive Title :"& styleend &" | "& styleright &""& selArchiveTitleStr &""& styleend &" | "
msg=msg &"| "& styleleft &"Name :"& styleend &" | "& styleright &""& txtNameStr &""& styleend &" | "
msg=msg &"| "& styleleft &"Email :"& styleend &" | "& styleright &""& txtEmailStr &""& styleend &" | "
msg=msg &"| "& styleleft &"Country :"& styleend &" | "& styleright &""& countryStr &""& styleend &" | "
msg=msg &"| "& styleleft &"Comments :"& styleend &" | "& styleright &""& txtCommentsStr &""& styleend &" | "
msg=msg &"| "& styleleft &" Submitted Date & Time :"& styleend &" | "& styleright &""& Now() &""& styleend &" | "
msg=msg &"| "& styleleft &" Submitted IP Address :"& styleend &" | "& styleright &""& ipAddressVal &""& styleend &" | "
msg=msg &"| "& styleleft &" Submitted Location :"& styleend &" | "& styleright &""& tmpCountryName & "-" & tmpRegionName & "-" & tmpCityName &""& styleend &" | "
msg=msg &"| | "
msg=msg &" "
msgsubject="Market Alert Comments - MexNepal"
mailfrom="info@mexnepal.com"
mailfromname="MexNepal"
mailto="info@mexnepal.com"
mailtoname="MexNepal"
mailBCC="venkat@kappsoft.com"
hasSent1234=sendMail(msg,msgsubject,mailfrom,mailfromname,mailto,mailtoname,mailBCC)
isStored=True
ElseIf Ucase(Trim(Request.ServerVariables("REQUEST_METHOD")))="POST" and session("commentsName")<>"" Then
txtNameStr=""
txtEmailStr=""
countryStr=""
txtCommentsStr=""
ipAddressVal=""
isStored=True
Else
session("commentsName")=""
End if
%>
<%if isStored=true then%>
Submission Successful.
Thank you for your comments. |
<%Else %>
<%=responseStrc%>
<%If Trim(Request.Form("selCountry"))<>"" Then %>
<%
Else%>
<%End If
End if
%>
|
|
 |
|
 |
|
| |
|
|
<%
Private Sub getArchiveContents()
Dim arrRowCnt,cntVal
Dim folderPathStr
Dim tempArchiveFileNameStr
Dim tempArchiveTitleStr
Const adInteger = 3
Const adDate = 7
Const adVarChar = 200
arrRowCnt=0
Dim objFS,objFile,objFolder
Dim rsFSO
folderPathStr=Server.MapPath("../webimages/nl/")
Set rsFSO = Server.CreateObject("ADODB.Recordset")
Set objFS = Server.CreateObject("Scripting.FileSystemObject")
If objFS.FolderExists(folderPathStr)=True Then
Set objFolder = objFS.GetFolder(folderPathStr & "/")
rsFSO.Fields.Append "archiveFileName", adVarChar, 250
rsFSO.Fields.Append "archiveDate",adVarChar, 250
rsFSO.Fields.Append "archiveTitle", adVarChar, 250
rsFSO.Fields.Append "archiveFileNo", adInteger
rsFSO.Open
For Each objFile in objFolder.Files
If lcase(Right(objFile.Name,4)) = ".txt" then
rsFSO.AddNew
tempArchiveFileNameStr=Lcase(Trim(objFile.Name))
rsFSO("archiveFileName") = tempArchiveFileNameStr
rsFSO("archiveDate") = getArchiveDate(tempArchiveFileNameStr)
tempArchiveTitleStr=getFileContents(tempArchiveFileNameStr)
rsFSO("archiveTitle") = tempArchiveTitleStr
rsFSO("archiveFileNo") = Mid(tempArchiveFileNameStr,3,8)
rsFSO.Update
arrRowCnt=arrRowCnt+1
End if
Next
set objFS=nothing
rsFSO.Sort = "archiveFileName DESC "
Redim archiveFileNameStr(arrRowCnt)
Redim archiveTitleStr(arrRowCnt)
Redim archiveDateStr(arrRowCnt)
Redim archiveFileNoStr(arrRowCnt)
cntVal=0
While Not rsFSO.EOF
fileNameStrVal=Lcase(Trim(rsFSO("archiveFileName").Value))
archiveFileNameStr(cntVal)=fileNameStrVal
archiveTitleStr(cntVal)=Trim(rsFSO("archiveTitle").Value)
archiveDateStr(cntVal)=Trim(rsFSO("archiveDate").Value)
archiveFileNoStr(cntVal)=Trim(rsFSO("archiveFileNo").Value)
cntVal=cntVal+1
rsFSO.MoveNext()
Wend
rsFSO.close()
Set rsFSO = Nothing
End If
End Sub
Function getFileContents(argDownFileNameStr)
Dim titleTexts
Dim objFSO
Dim objStream
Dim fileExtStr
argDownFilePathStr=Server.MapPath("..\webimages\nl\")
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objTextStream = objFSO.OpenTextFile(argDownFilePathStr & "\" & argDownFileNameStr,1)
titleTexts = objTextStream.ReadAll
objTextStream.Close
Set objFSO = Nothing
getFileContents=titleTexts
End Function
Function getArchiveDate(fileNameStr)
Dim tempDateStr
Dim yearVal,monthVal,dayVal
yearVal=Mid(fileNameStr,3,4)
monthVal=arrMonthName(Cint(Mid(fileNameStr,7,2)))
dayVal=Cint(Mid(fileNameStr,9,2))
tempDateStr=dayVal & " "& monthVal& ", "& yearVal
getArchiveDate=tempDateStr
End Function
%>