<%@ Language=VBScript %> <% option explicit Response.Buffer = True '@BEGINVERSIONINFO '@APPVERSION: 5.10.10 '@FILENAME: affiliate.asp '@FILEVERSION: 1.0.1 '@VERSIONDATETIME: 2/21/01 '@DESCRIPTION: Affiliate Partners Page '@STARTCOPYRIGHT 'The contents of this file is protected under the United States 'copyright laws and is confidential and proprietary to 'LaGarde, Incorporated. Its use or disclosure in whole or in part without the 'expressed written permission of LaGarde, Incorporated is expressly prohibited. ' '(c) Copyright 2000, 2001 by LaGarde, Incorporated. All rights reserved. '@ENDCOPYRIGHT '@ENDVERSIONINFO %> <% Dim sAction,rsAff,iBookMark,iAffId,sFilter,sName,rsRegAff,sAffiliateId,rsSales,sSQL,sTotalNet,sTotalSTax,sTotalCTax,sTotalShipping,sHandling,sGrandTotal,arrSales,i If Request.Form("affSubmit.x") <> "" or Request.QueryString("AffID") <> "" Then If Request.Form("affSubmit.x") <> "" Then sFilter = "affName = '" & trim(Request.Form("txtAffId")) & "' AND affPassword = '" & trim(Request.Form("passAff")) & "'" If Request.QueryString("AffID") <> "" Then sFilter = "affID = " & Request.QueryString("AffID") Set rsAff = Server.CreateObject("ADODB.Recordset") rsAff.Open "sfAffiliates", cnn, adOpenForwardOnly, adLockReadOnly, adCmdTable rsAff.Filter = sFilter If Not (rsAff.EOF And rsAff.BOF) Then sAffiliateId = trim(rsAff.Fields("affName")) sSQL = "SELECT orderAmount, orderSTax, orderSTax, orderShippingAmount, orderHandling, orderGrandTotal, orderTradingPartner FROM sfOrders WHERE orderTradingPartner = '" & sAffiliateId & "'" Set rsSales = Server.CreateObject("ADODB.RecordSet") rsSales.Open sSQL, cnn, adOpenForwardOnly, adLockReadOnly, adCmdText If Not (rsSales.EOF and rsSales.BOF) Then arrSales = rsSales.GetRows sTotalNet = 0 sTotalSTax = 0 sTotalCTax = 0 sTotalShipping = 0 sHandling = 0 sGrandTotal = 0 rsSales.Close Set rsSales= Nothing If isArray(arrSales) Then For i=0 to uBound(arrSales, 2) If arrSales(0, i) <> "" Then sTotalNet = sTotalNet + cDbl(arrSales(0, i)) If arrSales(1, i) <> "" Then sTotalSTax = sTotalSTax + cDbl(arrSales(1, i)) If arrSales(2, i) <> "" Then sTotalCTax = sTotalCTax + cDbl(arrSales(2, i)) If arrSales(3, i) <> "" Then sTotalShipping = sTotalShipping + cDbl(arrSales(3, i)) If arrSales(4, i) <> "" Then sHandling = sHandling + cDbl(arrSales(4, i)) If arrSales(5, i) <> "" Then sGrandTotal = sGrandTotal + cDbl(arrSales(5, i)) Next End If sAction = "Registered" Else sAction = "Not Found" End If closeObj(rsAff) ElseIf Request.Form("newAffSubmit.x") <> "" Then Set rsAff = Server.CreateObject("ADODB.Recordset") rsAff.CursorLocation = adUseClient rsAff.Open "sfAffiliates ORDER BY affID", cnn, adOpenStatic, adLockOptimistic, adCmdTable sName = trim(Request.Form("txtName")) Do While Not rsAff.EOF If rsAff.Fields("affName") = sName Then sAction="Exists" rsAff.MoveNext Loop If sAction <> "Exists" Then rsAff.AddNew rsAff.Fields("affName") = sName rsAff.Fields("affCompany") = trim(Request.Form("txtCompany")) rsAff.Fields("affAddress1") = trim(Request.Form("txtAdd1")) rsAff.Fields("affAddress2") = trim(Request.Form("txtAdd2")) rsAff.Fields("affCity") = trim(Request.Form("txtCity")) rsAff.Fields("affState") = trim(Request.Form("txtState")) rsAff.Fields("affZip") = trim(Request.Form("txtZip")) rsAff.Fields("affCountry") = trim(Request.Form("txtCountry")) rsAff.Fields("affPhone") = trim(Request.Form("txtPhone")) rsAff.Fields("affFAX") = trim(Request.Form("txtFax")) rsAff.Fields("affEmail") = trim(Request.Form("txtEmail")) rsAff.Fields("affHttpAddr") = trim(Request.Form("txtWeb")) rsAff.Fields("affPassword") = trim(Request.Form("Password")) rsAff.Update iBookMark = rsAff.AbsolutePosition rsAff.Requery rsAff.AbsolutePosition = iBookMark iAffId = rsAff.Fields("affID") End If closeObj(rsAff) If sAction <> "Exists" Then Response.Redirect "Affiliate.asp?AffID=" & iAffId ElseIf Request.QueryString("NewAccount") = "true" Then sAction = "New Account" End If %> SF Affiliate Partners Page
<% If C_BNRBKGRND = "" Then %> <% Else %> <% End If %>
<%= C_STORENAME %>
Affiliate Registration
Enter your affiliate ID and password to view your referred sales. If you would like to establish a new affiliate account, click New Account to begin.
<% If sAction = "Registered" Then %>
Please use this at the end of your link to this shopping order. Be sure the link is to as ASP page in this site.

REFERER=<%= sAffiliateId %>

Example http://www.thisdomain.com/search.asp?REFERER=<%= sAffiliateId %>


Sales Invoice
Net Sales:<%= FormatCurrency(sTotalNet) %>
State/Provence Tax:<%= FormatCurrency(sTotalSTax) %>
Country Tax:<%= FormatCurrency(sTotalCTax) %>
Handling:<%= FormatCurrency(sHandling) %>
Shipping:<%= FormatCurrency(sTotalShipping) %>
Grand Total:<%= FormatCurrency(sGrandTotal) %>
<% ElseIf sAction = "New Account" or sAction = "Exists" Then %>
<% If sAction = "Exists" Then %> <% End If %>
We are sorry but your "Affiliate ID" already exists, please enter a different ID value.
Affiliate ID: ">
Company: ">
Address Line 1: ">
Address Line 2: ">
City: ">
State: ">
Zip/Postal Code: ">
Country: ">
Phone Number: ">
Fax Number: ">
Email: ">
Web Site: ">
Password:
Confirm Password:
<% Else %>
<%If sAction = "Not Found" Then%> Your Affiliate ID and Password did not match a registered user, please create a new account or try again. <%Else%> Please Type In Your Affiliate ID and Password or Click on New Account. <%End If%>
Affiliate ID:
Password:
<% End If closeObj(cnn) %>