<% 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:    Type:    Sorted by:
<% if request("type")="1" then response.redirect "stats.asp?type=" & request("type") & "&month=" & request("month") & "&year=" & request("year") end if hits=0 leads=0 sales=0 sortby=request("sort") if sortby="" then sortby="date" rs.open "SELECT * from AF_Hits WHERE AfUsername ='" & session("AfUsername") & "' and (hits>0 or leads>0 or salesnum<>0 or earn<>0) order by " & sortby & "", conn,1,3 if rs.eof then%>
Affiliate Detailed Activities

<%if payperlead>0 then%> <%end if%> <%if payperlead>0 then%> <%end if%>
ClicksLeadsSales Referred by Banner/
Text Link #
Amount Earned
000 0 0 <%=afcurrency%>0
<%else%> <%if request("month")="" then%> Detailed Activities Report <%elseif request("month")="0" then%> Detailed Activities Report for <%=request("year")%> <%else%> Detailed Activities Report for <%=MonthName(request("month")) & ", " & request("year")%> <%end if%>
<%if payperlead>0 then%> <%end if%> <%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%> <%if payperlead>0 then%> <%end if%> <%end if Rs.MoveNext Loop%>
ClicksLeadsSales Product Name Referred by Banner/
Text Link #
Amount Earned Date
<%=rs("hits")%><%=rs("leads")%> <%if rs("sales")<0 then response.write "" & afcurrency & rs("sales") & "" elseif rs("sales")>0 then response.write afcurrency & rs("sales") end if%> <%if rs("sales")<0 then response.write "" & rs("product_name") & "" elseif rs("sales")>=0 then response.write rs("product_name") end if%> <%=rs("referurl")%> <% if rs("sales")>0 then response.write rs("BannerSales") else response.write rs("banners") end if%> <% totalearned=FormatNumber((rs("Earn")),2) if totalearned<0 then response.write "" & afcurrency & totalearned & "" else response.write afcurrency & totalearned end if%> <%=lcase(rs("date"))%>
<%end if%>