<%Option explicit%> <% '******************************************************* ' allows user to check the status of their order ' VP-ASP 6.50 April 21, 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 'VP-ASP 6.50 - mark orders paid to affiliate Dim affpaid dim paidarray,paidarrayvalues paidarray = array("True","False") paidarrayvalues= array(1,0) SetSess "CurrentUrl","shopaffstatusorders.asp" sAction=Request.form("Action") mypage=Request("page") 'VP-ASP 6.50 - precautionary security fix if not isnumeric(mypage) then mypage = "" end if 'VP-ASP 6.50 - mark orders paid to affiliate affpaid=cleanchars(Request.form("affpaid")) 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 maxrecs, cid dim recordcount mypagesize=getconfig("xeditdisplaymaxrecords") maxrecs=mypagesize OpenOrderDB dbc cid = clng(customerid) SQL= "Select * from orders where oaffid=" & affid 'VP-ASP 6.50 - mark orders paid to affiliate if (affpaid <> "Select") AND (affpaid > "") then sql = sql & " and affpaid =" & affpaid end if Sql=SQL & " order by odate DESC" SetSess "sqlaffstatus",SQL ShopOpenRecordSet SQL,objRS, mypagesize, mypage if objRS.eof then shopwriteerror getlang("LangNoOrders") objRS.Close set objRS=nothing ShopCloseDatabase dbc exit sub end if recordcount=0 response.write "

" & smallinfofont & getlang("langCommonPage") & mypage & getlang("langCommonOf") & maxpages & smallinfoend OrderTableHeader 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 fieldvalue response.write "" for i = 0 to fieldcount Select Case fields(i) case "orderamount" fieldvalue=objrs(fields(i)) fieldvalue=shopformatcurrency(fieldvalue,getconfig("xdecimalpoint")) Case "oprocessed" fieldvalue=objrs(fields(i)) DisplayProcessed fieldvalue ' case "orderid" ' createviewlink fieldvalue, objrs("orderid") case "ostatus" fieldvalue=objrs(fields(i)) DisplayStatus fieldvalue case "commission" fieldvalue=objrs(fields(i)) fieldvalue=shopformatcurrency(fieldvalue,getconfig("xdecimalpoint")) Case Else fieldvalue=objrs(fields(i)) end select response.write ReportDetailColumn & fieldvalue & ReportDetailcolumnEnd next response.write "" end sub Sub DisplayProcessed (fieldvalue) if fieldvalue<>0 then fieldvalue=Getlang("LangcommonYes") else fieldvalue=Getlang("LangCommonNo") end if end sub Sub DisplayStatus (fieldvalue) dim ocardtype If isnull(fieldvalue) then ocardtype=objrs("ocardtype") end if end sub ' Sub OrderTableHeader dim i fields(0)="orderid" fields(1)="orderamount" fields(2)="odate" fields(3)="ostatus" fields(4)="oprocessed" fields(5)="commission" 'VP-ASP 6.50 - mark orders paid to affiliate Fields(6)="Affdatepaid" Captions(0)=getlang("LangStatusOrderNum") Captions(1)=getlang("LangStatusAmount") Captions(2)=getlang("LangStatusDate") Captions(3)=getlang("LangStatusStatus") Captions(4)=getlang("LangStatusProcessed") Captions(5)=getlang("langaffcommission") 'VP-ASP 6.50 - mark orders paid to affiliate Captions(4)="Affiliate Paid Date" fieldcount=5 shopwriteheader getlang("langstatus02") response.write ReportTableDef response.write ReportHeadRow for i = 0 to fieldcount %> <%=ReportHeadColumn%><%=Captions(i)%><%=ReportHeadColumnEnd%> <% next response.write ReportRowEnd end sub %>