%@ LANGUAGE = "VBScript" ENABLESESSIONSTATE = True %>
<%Option Explicit%>
<%Response.Buffer = True%>
<%
'***********************************************************
'** Copyright Notice **
'** Tassietek - MailerPro **
'** Copyright 2001-2004 Tassietek All Rights Reserved. **
'***********************************************************
'** PREVENT PAGE FROM BEING CACHED
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"
'** CHECKING TO SEE IF LOGGED IN IF NOT TAKE YOU TO THE LOGIN PAGE
If Request.Cookies("login") = "" Then
Response.Cookies("action") = "error"
Response.Write("")
Response.End
Elseif Request.Cookies("login") = "3" Then
Response.Write("")
End If
If Session("Start") = "" Then
Response.Cookies("a") = "ended"
Response.Redirect"login.asp?logoff=1"
End If
%>
<%
'** DIM VARIABLES
Const ForReading = 1
Dim rs, sql, strfldshow, fso, ots, strtemplate, strlistname, strmessage, stremail, strsubject
'** DELETE ALL RECORDS FROM A CHOSEN LIST
If Request("action") = "delete_subscribers" Then
Set rs = conn.execute("Select Count(ID) as total From " & tbl_prefix & Request("ID"))
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Response.Cookies("delete_subscribers") = "Total records deleted in " & getlistname(Request("ID")) & " " & rs("total") & ""
rs.Close
Set rs = nothing
If DataBaseType = "access" Then
conn.execute "Delete From " & tbl_prefix & Request("ID"), , adExecuteNoRecords
Else
conn.execute "Truncate table " & tbl_prefix & Request("ID"), , adExecuteNoRecords
End If
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
conn.execute "Delete From " & tbl_prefix & "tracking Where listID = " & Request("ID"), , adExecuteNoRecords
conn.execute "Delete From " & tbl_prefix & "tracking_lists Where listID = " & Request("ID"), , adExecuteNoRecords
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Response.Cookies("fldshow") = Request("ID")
Response.Redirect"view_lists.asp"
End If
'** DELETE A CHOSEN LIST AND ALL ASSOCIATE RECORDS
If Request("action") = "delete" Then
Response.Cookies("deleted") = "" & getlistname(Request("ID")) & " as been deleted!"
conn.execute "Delete From " & tbl_prefix & "listnames Where ID = " & Request("ID"), , adExecuteNoRecords
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
conn.execute "Delete From " & tbl_prefix & "tracking Where listID = " & Request("ID"), , adExecuteNoRecords
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
conn.execute("Drop Table " & tbl_prefix & Request("ID"))
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Response.Redirect"view_lists.asp"
End If
'** DELETE UNVERIFIED RECORDS FROM CHOSEN LIST MORE THAN X DAYS OLD
If Request("action") = "delete_unverified" Then
sql = "Select Count(ID) As total From " & tbl_prefix & Request("ID") & " Where verified = 0 And edate <= " & FormatDatabaseDate(dateadd("d",-Session("PurgeUnverified"),SetDate(Now())))
Set rs = conn.execute(sql, adOpenForwardOnly, adLockReadOnly)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Response.Cookies("delete_unverified") = "Unverified Records Deleted " & rs("total") & ""
rs.Close
Set rs = nothing
conn.execute "Delete From " & tbl_prefix & Request("ID") & " Where verified = 0 and edate <= " & FormatDatabaseDate(dateadd("d",-Session("PurgeUnverified"),SetDate(Now()))), , adExecuteNoRecords
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Response.Cookies("fldshow") = Request("ID")
Response.Redirect"view_lists.asp"
End If
'** SEND CONFIRMATION REMINDERS TO A CHOSEN LIST
If Request("action") = "send_reminders" Then
strsubject = "Reminder of confirmation of your email"
sql = "Select list_name From " & tbl_prefix & "listnames Where ID = " & Request("ID")
Set rs = conn.execute(sql, adOpenForwardOnly, adLockReadOnly)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
strlistname = rs("list_name")
rs.Close
Set rs = nothing
Set fso = Server.CreateObject ("Scripting.FileSystemObject")
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Set ots = fso.OpenTextFile (Session("ScriptPath") & "\templates\reminder.txt", ForReading)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
strtemplate = Trim(ots.ReadAll)
ots.Close
Set ots = Nothing
Set fso = Nothing
sql = "Select Count(ID) As total From " & tbl_prefix & Request("ID") & " Where verified = 0 And reminder_sent = 0 And edate <= " & FormatDatabaseDate(dateadd("d",-Session("Reminders"),SetDate(Now())))
Set rs = conn.execute(sql, adOpenForwardOnly, adLockReadOnly)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Response.Cookies("reminder") = "Total Reminders Sent " & rs("total") & ""
rs.Close
Set rs = nothing
sql = "Select * From " & tbl_prefix & Request("ID") & " Where verified = 0 And reminder_sent = 0 And edate <= " & FormatDatabaseDate(dateadd("d",-Session("Reminders"),SetDate(Now())))
Set rs = conn.execute(sql, adOpenForwardOnly, adLockReadOnly)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
Do While Not rs.EOF
stremail = rs("email")
strmessage = Replace(strtemplate,"[sitename]",Session("SiteName"))
strmessage = Replace(strmessage,"[sentdate]",SetDate(Now()))
strmessage = Replace(strmessage,"[subscribedate]", DisplayDate(rs("edate")))
strmessage = Replace(strmessage,"[email]", rs("email"))
strmessage = Replace(strmessage,"[confirmlink]", Session("ScriptUrl") & "/r.asp?a=c&l=" & Request("ID") & "&e=" & rs("email"))
strmessage = Replace(strmessage,"[removallink]", Session("ScriptUrl") & "/r.asp?a=uc&l=" & Request("ID") & "&e=" & rs("email"))
strmessage = Replace(strmessage,"[listname]", strlistname)
strmessage = Replace(strmessage,"[sitename]", Session("SiteName"))
Session("strsubject") = strsubject
Session("stremail") = rs("email")
Session("strmessage") = strmessage
Server.Execute"includes/reminder_function.asp"
conn.execute "Update " & tbl_prefix & Request("ID") & " Set reminder_sent = 1 Where ID = " & rs("ID"), , adExecuteNoRecords
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
rs.MoveNext
Loop
rs.Close
Set rs = nothing
Response.Cookies("fldshow") = Request("ID")
Response.Redirect"view_lists.asp"
End If
%>
<%
'** SELECTING A LIST TO VIEW
If Request("fldshow") = "" Then
sql = "Select * From " & tbl_prefix & "listnames Order by ID DESC"
Else
If Request.Cookies("fldshow") = "" Then
strfldshow = Request("fldshow")
Else
strfldshow = Request.Cookies("fldshow")
End If
Response.Cookies("fldshow") = ""
sql = "Select * From " & tbl_prefix & "listnames Where ID = " & strfldshow & " Order By ID DESC"
End If
Set rs = conn.execute(sql, adOpenForwardOnly, adLockReadOnly)
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
If Not rs.EOF Then
%>
Total Subscribers <%=FormatNumber(totalsubscribers(rs("ID")),0)%> Total Verified <%=FormatNumber(totalverified(rs("ID")),0)%> Total Unverified <%=FormatNumber(totalunverified(rs("ID")),0)%>
List Name
">
Text Type
Optional Field 1
">
Optional Field 2
">
Optional Field 3
">
Optional Field 4
">
Optional Field 5
">
Optional Field 6
">
Optional Field 7
">
Optional Field 8
">
Optional Field 9
">
Optional Field 10
">
Description
Total Unverified over <%=Session("Reminders")%> days with no reminders sent <%=remindersnotsent(rs("ID"))%>
Total Unverified over <%=Session("PurgeUnverified")%> days old <%=purgeunverified(rs("ID"))%>
<%
Else
Response.Write"
No Lists to View.
"
End If
rs.close
Set rs = nothing
%>
User [<%=Request.Cookies("user")%>]
Powered by <%=version%>
<%
Response.Cookies("deleted") = ""
'** ASSURING THAT ALL DATABASE CONNECTIONS ARE CLOSED
On Error Resume Next
rs.close
Set rs = nothing
rsfun.close
Set rsfun = nothing
conn.close
Set conn = nothing
on error goto 0
%>