<% Set conn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") Conn.Open dsn sqlm = "select afcurrency, ConStatus FROM AF_Constants where ConStatus=0" rs.open sqlm, conn if not rs.eof then afcurrency=rs("afcurrency") end if rs.close%> Affiliate Program


Month: <%dim yearSelect, currentYear currentYear=year(date())%>    Year:    Report:
<% if request("type")="2" then response.redirect "statsDetail.asp?type=" & request("type") & "&month=" & request("month") & "&year=" & request("year") end if hits=0 leads=0 sales=0 salesnum=0 rs.open "SELECT * from AF_Hits WHERE AfUsername ='" & session("AfUsername") & "'", conn,1,3 if rs.eof then%>
Statistics for <%=year(date())%>

<%if payperlead>0 then%> <%end if%> <%if payperlead>0 then%> <%end if%>
ClicksLeads# Sales Total Sales Convert Rate Total Earned
000 0 0% <%=afcurrency%>0
<%else Do Until Rs.EOF ShowLine=0 if request("month")>0 or request("year")>0 then if request("year")>0 and request("month")>0 then if cint(Month(rs("date")))=cint(request("month")) and cint(request("year"))=cint(year(rs("date"))) then ShowLine=1 elseif request("year")>0 and request("month")="0" then if cint(request("year"))=cint(year(rs("date"))) then ShowLine=1 end if else ShowLine=1 end if if ShowLine=1 then hits=hits+rs("hits") leads=leads+rs("leads") sales=sales+rs("sales") salesnum=salesnum+rs("salesnum") Earn=Earn+rs("Earn") end if Rs.MoveNext Loop%> <%if request("month")="" then%> Statistics for <%=year(date())%> <%elseif request("month")="0" then%> Statistics for <%=request("year")%> <%else%> Statistics for <%=MonthName(request("month")) & ", " & request("year")%> <%end if%>
<%if payperlead>0 then%> <%end if%> <%if payperlead>0 then%> <%end if%>
ClicksLeads# Sales Total Sales Convert Rate Total Earned
<%=hits%><%=leads%><%=salesnum%> <%=afcurrency & sales%> <% if salesnum=0 then response.write "0%" else if hits=0 then response.write "0%" else response.write FormatNumber((salesnum)/hits*100,2) & "%" end if end if%> <%totalearned=FormatNumber((Earn),2) response.write afcurrency & totalearned%>
<%end if%>