<%
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())%>
| Clicks |
<%if payperlead>0 then%>
Leads |
<%end if%>
# Sales |
Total Sales |
Convert Rate |
Total Earned |
| 0 |
<%if payperlead>0 then%>
0 |
<%end if%>
0 |
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%>
| Clicks |
<%if payperlead>0 then%>
Leads |
<%end if%>
# Sales |
Total Sales |
Convert Rate |
Total Earned |
| <%=hits%> |
<%if payperlead>0 then%>
<%=leads%> |
<%end if%>
<%=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%>
|