%Option explicit%> <% '******************************************************* ' allows user to check the status of their order ' VP-ASP 6.50 Sub affiliate report ' May 29, 2003 '******************************************************* dim customerid affid=Getsess("AffRegister") If affid="" then responseredirect "shopafflogin.asp" end if dim dbc dim UsePassword Dim Fieldname Dim fieldvalue dim fields(10) dim captions(10) dim fieldcount Dim strpassword Dim rc dim affid Dim sAction dim objAffiliateRS SetSess "CurrentUrl","shopaffstatus.asp" ' sAction=Request.form("Action") mypage=Request("page") 'VP-ASP 6.50 - precautionary security fix if not isnumeric(mypage) then mypage = "" end if shoppageheader if mypage<>"" then sql=GetSess("sqlAffStatus") ' on recursive calls we stored sql in sessikon variable displayOrders else mypage=1 DisplayOrders end if ShopPagetrailer Sub DisplayOrders dim xfont xfont=getconfig("xfont") dim maxrecs, cid dim recordcount mypagesize=20 maxrecs=mypagesize OpenOrderDB dbc cid = clng(customerid) sql="SELECT sum(orderamount) as totalsales, count(*) as numberorders, firstname, lastname from orders, affiliates where affiliates.referralid = " & affid & " AND orders.oaffid = affiliates.affid group by firstname, lastname;" SetSess "sqlaffstatus",SQL ShopOpenRecordSet SQL,objRS, mypagesize, mypage if objRS.eof then shopwriteerror getlang("LangAffNoOrders") objRS.Close set objRS=nothing ShopCloseDatabase dbc exit sub end if recordcount=0 Response.write "
" & smallinfofont & getlang("LangCommonPage") & mypage & getlang("LangCommonOf") & maxpages & "
" & smallinfoend %><%= getlang("LangSubaffiliate")%>
<% OrderAffTableHeader While Not objRS.EOF and recordcount < maxrecs OrderFormatRow ' actual row is formatted objRS.MoveNext recordcount=recordcount+1 Wend response.write "" Call PageNavBar (SQL) objRS.Close set objRS=nothing ShopCloseDatabase dbc End Sub ' Sub OrderFormatRow dim i dim xdecimalpoint xdecimalpoint=getconfig("xdecimalpoint") dim fieldvalue response.write "