<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "355, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 386, 828" strThisBackPage = "orders" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== '----------------------------------------------- 'AFFILIATE PAYMENT PAGE 'This shows all the unpaid commissions for a 'specific affiliate, a list of all payments made 'and the ability to group together commissions 'in to one payment '----------------------------------------------- '----------------------------------------------- 'CHECK FOR VALID AFFILIATE ID 'Just check that the given details are all valid ' - if not, if the AF_ID is incorrect, direct to ' sales stats page, else set the month/year to ' today's month/year. '----------------------------------------------- AFP_ID = request.QueryString("AFP_ID") If IsNumeric(AFP_ID) And AFP_ID <> "" Then 'We are deleting AF_ID = request.QueryString("AF_ID") 'Set all those orders with this payment back to 0 so they 'are set as 'unpaid' strQuery = "UPDATE tblCactuShopOrderNumbers SET ON_AffiliatePaymentID = 0 WHERE ON_AffiliatePaymentID = " & AFP_ID call ExecuteSQL(strQuery, numCursorType, objRecordSet) 'Delete the payment record strQuery = strDeleteStatementSyntax & " tblCactuShopAffiliatePayments WHERE AFP_ID = " & AFP_ID call ExecuteSQL(strQuery, numCursorType, objRecordSet) 'Redirect back to the affiliate payment report page response.Redirect("_affiliate_paymentreport.asp?AF_ID=" & AF_ID) else AF_ID = request.form("AF_ID") If Not IsNumeric(AF_ID) Or AF_ID = "" Then response.redirect("_affiliate_list.asp") '----------------------------------------------- 'CHECK TO SEE IF ANYTHING'S BEEN POSTED 'If not, just redirect back to the payment 'report page '----------------------------------------------- strPayCom = request.Form("paycommission") if strPayCom = "" then response.Redirect("_affiliate_paymentreport.asp?AF_ID=" & AF_ID) else 'Insert New Payment Record datDateNow = now strQuery = "INSERT INTO tblCactuShopAffiliatePayments (AFP_DateTime, AFP_AffiliateID) VALUES (" & strDateDelimiter & ReverseFormatYear(datDateNow) & strDateDelimiter & "," & AF_ID & ")" call ExecuteSQL(strQuery, numCursorType, objRecordSet) 'Get out the new ID If strDatabaseType = "mysql" Then strQuery = "SELECT AFP_ID FROM tblCactuShopAffiliatePayments WHERE AFP_DateTime = " & strDateDelimiter & ReverseFormatYear(datDateNow) & strDateDelimiter & " ORDER BY AFP_ID DESC LIMIT 0, 1" Else strQuery = "SELECT TOP 1 AFP_ID FROM tblCactuShopAffiliatePayments WHERE AFP_DateTime = " & strDateDelimiter & ReverseFormatYear(datDateNow) & strDateDelimiter & " ORDER BY AFP_ID DESC" End If call ExecuteSQL(strQuery, numCursorType, objRecordSet) AFP_ID = objRecordSet("AFP_ID") objRecordSet.Close 'Now set all the orders that were selected with the payment ID strQuery = "UPDATE tblCactuShopOrderNumbers SET ON_AffiliatePaymentID = " & AFP_ID & " WHERE ON_ID IN (" & strPayCom & ")" call ExecuteSQL(strQuery, numCursorType, objRecordSet) 'Redirect back to the affiliate payment report page response.Redirect("_affiliate_paymentreport.asp?AF_ID=" & AF_ID) end if end if '----------------------------------------------- %>