%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Affiliate Sales Report ' Product : CandyPress Store Administration ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true const adminLevel = 1 %> <% 'Database dim mySQL, cn, rs 'cartHead & customer dim idOrder dim idCust dim idAffiliate dim orderDate dim subTotal dim discTotal dim name dim lastName dim orderStatus dim commPerc dim affiliate 'Work Fields dim dateFrom dim dateFromInt dim dateTo dim dateToInt dim Total dim commTotal dim commSubTotal '************************************************************************* 'Open Database Connection call openDB() 'Store Configuration if loadConfig() = false then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Could not load Store Configuration settings.") end if 'Get idAffiliate idAffiliate = trim(Request("idAffiliate")) if isNull(idAffiliate) or not isNumeric(idAffiliate) then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid Affiliate ID.") end if 'Get dateFrom dateFrom = trim(Request("dateFrom")) if isDate(dateFrom) then dateFromInt = left(dateInt(dateFrom),8) else response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid From Date.") end if 'Get dateTo dateTo = trim(Request("dateTo")) if isDate(dateTo) then dateToInt = left(dateInt(dateTo),8) else response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid To Date.") end if 'Get Customer Record mySQL="SELECT name,LastName,affiliate " _ & "FROM customer " _ & "WHERE idCust = " & idAffiliate set rs = openRSexecute(mySQL) if rs.eof then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Invalid Customer/Affiliate ID.") else name = trim(rs("name")) lastName = trim(rs("lastName")) affiliate = trim(rs("affiliate")) end if call closeRS(rs) 'Set Row Colors dim rowColor, col1, col2 col1 = "#DDDDDD" col2 = "#EEEEEE" %>
Affiliate Sales Report
| Affiliate ID | <%=idAffiliate%> |
| Active Affiliate? | <%=affiliate%> |
| Affiliate Name | <%=name & " " & lastName%> |
| Report Date | <%=dateFrom%> - <%=dateTo%> |
|
No Affiliate Sales matched search criteria. |
|||||
| Order | Date | Customer Name | Sub Total | Perc. | Comm. |
| <%=pOrderPrefix & "-" & idOrder%> | <%=formatTheDate(orderDate)%> | <%=lastName & ", " & name%> | <%=moneyD(subTotal)%> | <%=commPerc%> % | <%=moneyD(commSubTotal)%> |
| Totals : | <%=moneyD(Total)%> | <%=moneyD(commTotal)%> | |||