<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "359, 391, 392, 393, 394, 395, 396, 397, 399, 401, 402, 472, 478, 561, 700, 701" 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. '=============================================== '----------------------------------------------- 'COLLECT VALUES FROM FORM '----------------------------------------------- AF_ID = request.form("AF_ID") AF_Name = request.form("AF_Name") AF_Address = request.form("AF_Address") AF_TownCity = request.form("AF_TownCity") AF_County = request.form("AF_County") AF_PostCode = request.form("AF_PostCode") AF_Country = request.form("AF_Country") AF_Telephone = request.form("AF_Telephone") AF_EmailAddress = request.form("AF_EmailAddress") AF_Password = request.form("AF_Password") AF_Percentage = request.form("AF_Percentage") strCallMode = request.querystring("strCallMode") strSendEmail = request.form("sendemail") If AF_ID="" then AF_ID = request.querystring("AF_ID") '----------------------------------------------- 'ERROR CHECKING '----------------------------------------------- If strCallMode <> "Delete" then if NOT IsNumeric(AF_Percentage) then numErrorNo = numErrorNo + 1 strErrorText = strErrorText + "" + Cstr(numErrorNo) + ". " + GetString("ContentText_ErrorChkCommision") & "
" end if strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_CustomerName"), AF_Name) strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_StreetAddress"), AF_Address) strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_TownCity"), AF_TownCity) strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_Postcode"), AF_PostCode) strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_Country"), AF_Country) strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_CustomerCode"), AF_Password) strErrorText = CheckNotBlank(strErrorText, numErrorNo, GetString("FormLabel_Email"), AF_EmailAddress) strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_CustomerName"), AF_Name, Application(LICENSENUMBER & "CD_CardholderName_AL")) strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_StreetAddress"), AF_Address, Application(LICENSENUMBER & "CD_CardholderStreetAddress_AL")) strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_TownCity"), AF_TownCity, Application(LICENSENUMBER & "CD_CardholderTownCity_AL")) strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_County"), AF_County, Application(LICENSENUMBER & "CD_CardholderCounty_AL")) strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_Postcode"), AF_PostCode, Application(LICENSENUMBER & "CD_CardholderPostCode_AL")) strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_Email"), AF_EmailAddress, Application(LICENSENUMBER & "CD_EmailAddress_AL")) strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_Telephone"), AF_Telephone, Application(LICENSENUMBER & "CD_Telephone_AL")) strErrorText = ErrorcheckLength(strErrorText, numErrorNo, GetString("FormLabel_CustomerCode"), AF_Password, Application(LICENSENUMBER & "CD_Password_AL")) '----------------------------------------------- 'FORM UPDATE OR INSERT QUERY '----------------------------------------------- If strErrorText ="" then If AF_ID=0 then strQuery = "INSERT INTO tblCactuShopAffiliates (AF_Name,AF_Address,AF_TownCity,AF_County,AF_PostCode,AF_Country,AF_Telephone,AF_EmailAddress,AF_Password,AF_Percentage) VALUES('" &_ sqlsafe(AF_Name) & "','" &_ sqlsafe(AF_Address) & "','" &_ sqlsafe(AF_TownCity) & "','" &_ sqlsafe(AF_County) & "','" &_ sqlsafe(AF_PostCode) & "'," &_ sqlsafe(AF_Country) & ",'" &_ sqlsafe(AF_Telephone) & "','" &_ sqlsafe(AF_EmailAddress) & "','" &_ sqlsafe(AF_Password) & "'," &_ sqlsafe(AF_Percentage) & ")" else strQuery = "UPDATE tblCactuShopAffiliates SET AF_Name='" & sqlsafe(AF_Name) & "'," &_ "AF_Address='" & sqlsafe(AF_Address) & "'," &_ "AF_TownCity='" & sqlsafe(AF_TownCity) & "'," &_ "AF_County='" & sqlsafe(AF_County) & "'," &_ "AF_PostCode='" & sqlsafe(AF_PostCode) & "'," &_ "AF_Country=" & sqlsafe(AF_Country) & "," &_ "AF_Telephone='" & sqlsafe(AF_Telephone) & "'," &_ "AF_EmailAddress='" & sqlsafe(AF_EmailAddress) & "'," &_ "AF_Password='" & sqlsafe(AF_Password) & "'," &_ "AF_Percentage=" & sqlsafe(AF_Percentage) & " WHERE AF_ID=" & AF_ID End if Call ExecuteSQL(strQuery, numCursorType, objRecordSet) If AF_ID=0 then '----------------------------------------------- 'LOOKUP NEW AFFILIATE ID '----------------------------------------------- strQuery = "SELECT * FROM tblCactuShopAffiliates WHERE AF_Name='" & sqlsafe(AF_Name) & "' ORDER BY AF_ID Desc" Call ExecuteSQL(strQuery, numCursorType, objRecordSet) If Not objRecordSet.EOF then AF_ID = objRecordSet("AF_ID") End if '----------------------------------------------- 'AUTO INFORM AFFILIATE OF THEIR ACCOUNT DETAILS '----------------------------------------------- if strSendEmail = "y" then strBodyText = GetString("EmailText_AffiliateAcceptedBodyText") & vbcrlf & vbcrlf strBodyText = strBodyText & Application(LICENSENUMBER & "webshopURL") & "aftrack.asp?ID=" & AF_ID & vbcrlf & vbcrlf strBodyText = strBodyText & GetString("FormLabel_CustomerCode") & ": " & AF_Password & vbcrlf strBodyText = strBodyText & GetString("FormLabel_Commission") & ": " & AF_Percentage & vbcrlf Call SendEMail(Application(LICENSENUMBER & "emailmethod"),Application(LICENSENUMBER & "mailserver"),AF_EmailAddress,"","",strEmailFrom,strEmailFrom,strEmailFrom,strEmailFrom,GetString("EmailText_AffiliateAcceptedSubject"),strBodyText,"",false) end if End if Else '----------------------------------------------- 'DELETE QUERY '----------------------------------------------- strQuery = strDeleteStatementSyntax & " tblCactuShopAffiliateLog WHERE AFLG_AffiliateID = " & AF_ID Call ExecuteSQL(strQuery, numCursorType, objRecordSet) strQuery = strDeleteStatementSyntax & " tblCactuShopAffiliates WHERE AF_ID = " & AF_ID Call ExecuteSQL(strQuery, numCursorType, objRecordSet) response.redirect("_affiliate_list.asp") End if If strErrorText = "" then response.redirect("_affiliate_list.asp") else %> <% =GetString("Config_headtitle") %>
<% WriteString("PageTitle_Problems") %>
<% WriteString("ContentText_PleaseGoBackAndCorrect") %>
<% =strErrorText %>
<< <% WriteString("ContentText_BackLink") %>
<% end if %>