% option explicit%> <% ' ---- Define the name of this page for form call backs Dim ThisPageName ThisPageName = "reg_check.asp" ' -- Disable caching and set a 4 minute TimeOut period Response.Expires = 0 Server.ScriptTimeout = 240 ' -- This is the string we will use for SQL commands Dim strSQL ' -- This is the RecordSet we will store results in Dim RS WriteDefaultFont ' --- Set up our connection to the database ' --- (Needs to be Cmd for .INC file) Dim Conn, Cmd Set Conn = GetConnection Conn.CommandTimeout = 180 Set Cmd = GetCommand(Conn) Cmd.CommandTimeout = 180 ' --- Allow us to Report for various registrations ' ---- (NOTE: fDumpPartnerID values must map to radio buttons below) ' ---- For easier mapping we use partner_val values (ie PartA = 1, PartB = 2, etc) const c_AAA_partnerID = 1 const c_BBB_partnerID = 2 const c_CCC_partnerID = 4 const c_DDD_partnerID = 5 const c_EEE_partnerID = 7 const c_FFF_partnerID = 21 dim fDumpPartnerID, sDumpGroup, sDS_value fDumpPartnerID = c_AAA_partnerID ' --- Assume that we want AAA reg sDumpGroup = "AAA Partner" sDS_value = Request("DumpSelect") ' ------------------------- AAA -> AAA reg If (sDS_value = "AAA") then fDumpPartnerID = c_AAA_partnerID sDumpGroup = "AAA Partner" ' ------------------------- BBB -> BBB Partner Reg elseif (sDS_value = "BBB") then fDumpPartnerID = c_BBB_partnerID sDumpGroup = "BBB Partner" ' ------------------------- CCC -> CCCink Reg elseif (sDS_value = "CCC") then fDumpPartnerID = c_CCC_partnerID sDumpGroup = "CCC Partner" ' ------------------------- EEE -> EEE Partner Reg elseif (sDS_value = "EEE") then fDumpPartnerID = c_EEE_partnerID sDumpGroup = "EEE Partner" ' ------------------------- DDD -> DDD Partner Reg elseif (sDS_value = "DDD") then fDumpPartnerID = c_DDD_partnerID sDumpGroup = "DDD Partner" ' ------------------------- FFF -> FFF Partner Reg elseif (sDS_value = "FFF") then fDumpPartnerID = c_FFF_partnerID sDumpGroup = "FFF Partner" end if Dim DEBUG_FLAG DEBUG_FLAG = 0 ' --- Set to 1 to dump SQL string %>
"
elseif sDumpGroup = "BBB Partner" Then
Response.write "
"
else
Response.write "
"
end if
%>
Current Day Clicks In Stats Page
Page started at: <% = Now %>
<% ' ------------------------------------------------------------------------- ' -- Provide a way of changing the entries shown ... (self referring call) ' -- Make sure the page being called is this one... ' ------------------------------------------------------------------------- %>
" & VBCRLF
else
Cmd.CommandText = strSQL
Set RS = Cmd.Execute
TotalRegistered = RS("REG")
RS.Close
Set RS = nothing
%>
Total registrations are <% = TotalRegistered %> for <% = Today %> for <% = sDumpGroup %>
(Note: The number above may not match the number below exactly)
<%
end if ' --- of DEBUG_FLAG check
WriteDefaultFont
' ----- The headers below need to match the WriteTableRow() format
%>
| Campaign | Name | Home Page | Registrations | % total Reg | % Home Page |
<% ' -------------------------------------------------------------- ' ------------------ Now show YESTERDAYS reg ------------------- ' -------------------------------------------------------------- Today = date Start_date = DateAdd("d", -1, Today) End_date = DateAdd("d", 0, Today) TheDate = DateAdd("d", -1, Now) ' -- since we want YESTERDAY DateParts = Split(TheDate, " ") Today = DateParts(0) FormattedDate = DateConvert (Today) ' --- Get current total registered users strSQL = _ " select count(user_id) as REG " & _ " from user_info_table (nolock) " & _ " where partner_val = " & fDumpPartnerID & _ " and date_joined between '" & Start_date & "' " & _ " and '" & End_Date & "' " if DEBUG_FLAG = 1 then response.write strSQL & "
" & VBCRLF else Cmd.CommandText = strSQL Set RS = Cmd.Execute TotalRegistered = RS("REG") RS.Close Set RS = nothing %>
Total registrations were <% = TotalRegistered %> for <% = Today %> for <% = sDumpGroup %> <% end if ' --- of DEBUG_FLAG check WriteDefaultFont ' ----- The headers below need to match the WriteTableRow() format %>
| Campaign | Name | Home Page | Registrations | % total Reg | % Home Page | (level 3) |
Page completed at: <% = Now %> <% ' ------------------------------------------------------------------ ' --- This function writes a table row ' --- The format should match the row headers above ' --- If level three not being passed in, then set it to -1 ' ------------------------------------------------------------------ Sub WriteTableRow (iAcqID, sAcqName, iFirstHit, iReg, iFirstReg, Total) Dim fPercent, fPercent_2 If (Total > 0) then fPercent = iReg/Total else fPercent = 0 end if If (FirstHit > 0) then fPercent_2 = iReg/FirstHit else fPercent_2 = 0 end if response.write "