<% M_UAdd = fun_chkRight("Registration","V") if M_UAdd = 0 then %> <% response.end end if%> <% Function fixquotes(theString) fixquotes = Replace(theString,"'","''") End Function regdtfr = fixquotes(Trim(request.form("regdtfr"))) regdtto = fixquotes(Trim(request.form("regdtto"))) if trim(regdtfr) = "" or trim(regdtto) = "" then regdtfr = date() regdtto = date() elseif isdate(regdtfr) = false or isdate(regdtto) = false then regdtfr = date() regdtto = date() end if EMsg = "No referral email data found" set rs = Server.CreateObject("ADODB.Recordset") ''''' Code for paging rs.CursorLocation = adUseClient rs.PageSize = 10 currentPage=trim(Request("currentPage")) if currentPage = "" or isNumeric(currentPage) = False then currentPage = 1 ''''' End Code for paging EMsg = EMsg & " for date range
" & formatdatetime(regdtfr, 1) & " - " & formatdatetime(regdtto, 1) & "
" strSQL = "select a.referid, a.frnname, a.frnemail, a.emailsenton, a.emailclick, a.logdate from refer_friend a where a.logdate between #"& regdtfr &"# and #"& dateadd("d", 1, regdtto) &"# order by a.logdate, a.frnname" 'response.write strSQL 'response.end rs.Open strSQL, con, 3, 3 if not rs.EOF Then ''' Paging if Cint(currentPage)=0 or Cint(currentPage) > rs.PageCount then rs.AbsolutePage = rs.PageCount currentPage = rs.PageCount else rs.AbsolutePage = Cint(currentPage) end if refArr = rs.GetRows() if isEmpty(refArr) = False Then if UBound(refArr,2) >= (rs.PageSize-1) then toctr = (rs.PageSize-1) else toctr = UBound(refArr,2) end if end if '' End Paging end if %> <% if isEmpty(refArr)=False Then %> <% for i = 0 To toctr %> <% next %> <% if rs.pagecount > 1 then %> <%end if%> <% else %> <% end if %>
Referral Emails
Referral Date Range (mm/dd/yyyy) To

Date Name Email
<%=Trim(refArr(5,i))%> <%=Trim(refArr(1,i))%> <%=Trim(refArr(2,i))%>
Page <%=currentPage & " of " & rs.PageCount&" -"%> <% for p = 1 to rs.PageCount if cint(currentpage) <> cint(p) then %> <%=p%>  <% else Response.Write "[" & p & "] " end if next %>
<%=EMsg%>
<% rs.Close set rs = nothing con.close set con = nothing %>