<%option explicit%> <% '************************************************ ' VP-ASP 6.50 Affiliate registration ' March 26, 2004 '************************************************ Dim sAction Dim login Dim loginaffid dim Loginlastname Dim LoginPassword Dim PaymentTypes(10) Dim PaymentCount dim my_to, my_toaddress,my_system,my_from,my_fromaddress,my_subject,mailtype dim mailer, my_attachment dim body InitializeSystem Getpaymenttypes dim Refid, refidinput Refid=request.querystring("refid") If refid<>"" then ValidateReferralid if refid<>"" then lngreferralid=refid setsess "referralid",refid end if end if sAction=Request("Action") if sAction="" then sAction=Request("Action.x") end if 'VP-ASP 6.50 - precautionary security fix Login=cleanchars(request("login")) Serror="" If sAction = "" Then ShopPageHeader WriteAffRegHeader GetExistingAff DisplayForm() ShopPageTrailer Else ValidateData() if sError = "" Then ShoppageHeader WriteAffRegHeader UpdateAffiliate SendMail WriteInfo else ShopPageHeader WriteAffRegHeader DisplayForm ShopPageTrailer end if end if Sub DisplayForm() AddUserInfo 'addLogin 'Response.Write(affFont & "" & getlang("LangAffRegistration") & "
" & affSubject & "
") If sError <> "" Then shopwriteerror sError Response.Write("
") shopwriteheaderpic getlang("langcommoninformation"),"images/icons/user_add.gif" Response.Write "
" Response.Write(TableDef) ' CreateCustRow getlang("LangAffid") & "" & lngAffid & "") CreateCustRow getlang("LangCustFirstname"),"affstrFirstname",affstrFirstName, "Yes" CreateCustRow getlang("LangCustLastname"), "affstrLastname", affstrLastname, "Yes" CreateCustRow getlang("LangCustEmail"),"affstrEmail",affstrEmail,"Yes" CreateCustRow getlang("LangCustaddress"),"affstrAddress", affstrAddress,"Yes" CreateCustRow getlang("LangCustCity"),"affstrCity",affstrCity,"Yes" CreateCustRow getlang("LangCustState"),"affstrState",affstrState,"Yes" CreateCustRow getlang("LangCustPostcode"),"affstrPostcode",affstrPostcode,"Yes" CreateCustRow getlang("LangCustCountry"),"affstrCountry", affstrCountry,"Yes" CreateCustRow getlang("LangCustPhone"),"affstrPhone",affstrPhone,"Yes" CreateCustRowP getlang("LangLoginPassword"),"affstrpassword",affstrPassword,"Yes" Response.write TableRow & "" & getlang("LangAffPaymentType") & "" Response.write "" GenerateSelectNV PaymentTypes,affstrtypeofpayment,"affStrTypeofpayment", paymentCount, getlang("LangCommonSelect") Response.write "" If Getconfig("affmultilevel")="Yes" then If lngreferralid="" then CreateCustRow getlang("LangReferringAffiliate"),"refidinput",refidinput,"No" end if end if CreateCustRow getlang("langCustWebSite"),"affstrWebsite",affstrWebsite,"No" CreateCustRow getlang("LangCustcompany"),"affstrCompany", affstrCompany,"" CreateCustRow getlang("LangCustFax"),"affstrFax",affstrFax,"" CreateCustRow getlang("LangAffComments"),"affstrComment",affstrComment,"" CreateCustRow getlang("LangAffBank"),"affstrBank",affstrBank,"" CreateCustRow getlang("LangAffBankAccount"),"affstrBankaccount",affstrBankaccount,"" CreateCustRow getlang("langAffBankBranch"),"affstrBankbranch",affstrBankbranch,"" CreateCustRow getlang("LangAffBankAddress"),"affstrBankAddress",affstrBankAddress,"" CreateCustRow getlang("LangAffBankOther"),"affstrBankother", affstrBankother,"" Response.Write(TableDefEnd) Response.Write "
" If Getconfig("affmultilevel")="Yes" then If lngReferralid <> "" Then Response.Write("
" & getlang("langReferringAffiliate") & " " & Refid & "  (Referring Affiliate)
") Response.Write("") End If end if Response.Write("") Response.Write "
" If Getconfig("xbuttoncontinue")="" then Response.Write("") else Response.Write("") end if Response.Write "
" addwebsessform Response.Write("
") 'AddNewUser End Sub Sub ValidateData() 'VP-ASP 6.50 - precautionary security fix lngAffid = cleanchars(Request.Form("lngAffid")) lngreferralid=cleanchars(request("refid")) affstrFirstname = cleanchars(Request.Form("affstrFirstname")) affstrLastname = cleanchars(Request.Form("affstrLastname")) affstrAddress = cleanchars(Request.Form("affstrAddress")) affstrCity = cleanchars(Request.Form("affstrCity")) affstrState = cleanchars(Request.Form("affstrState")) affstrPostcode = cleanchars(Request.Form("affstrPostcode")) affstrCountry = cleanchars(Request.Form("affstrCountry")) affstrCompany = cleanchars(Request.Form("affstrCompany")) affstrPhone = cleanchars(Request.Form("affstrPhone")) affstrWebsite = cleanchars(Request.Form("affstrWebsite")) affstrWorkphone = cleanchars(Request.Form("affstrWorkphone")) affstrFax = cleanchars(Request.Form("affstrFax")) affstrEmail = cleanchars(Request.Form("affstrEmail")) affstrComment = cleanchars(Request.Form("affstrComment")) affstrTypeofpayment = cleanchars(Request.Form("affstrTypeofpayment")) affstrBank = cleanchars(Request.Form("affstrBank")) affstrBankaccount = cleanchars(Request.Form("affstrBankaccount")) affstrBankbranch = cleanchars(Request.Form("affstrBankbranch")) affstrBankAddress = cleanchars(Request.Form("affstrBankAddress")) affstrBankother = cleanchars(Request.Form("affstrBankother")) affstrpassword = cleanchars(request.Form("affstrpassword")) refidinput=cleanchars(request.form("refidinput")) If affstrFirstname = "" Then sError = sError & getlang("LangCustFirstname") & "
" End If If affstrLastname = "" Then sError = sError & getlang("LangCustLastname") & "
" End If If affstrAddress = "" Then sError = sError & getlang("LangCustAddress") & "
" End If If affstrCity = "" Then sError = sError & getlang("LangCustCity") & "
" End If If affstrState = "" Then sError = sError & getlang("LangCustState") & "
" End If If affstrPostcode = "" Then sError = sError & getlang("LangCustPostcode") & "
" End If If affstrCountry = "" Then sError = sError & getlang("LangCustCountry") & "
" End If If affstrPhone = "" Then sError = sError & getlang("LangCustPhone") & "
" End If ' If affstrWebsite = "" Then ' sError = sError & getlang("LangCustWebsite") & "
" ' End If If affstrEmail = "" Then sError = sError & getlang("LangCustEmail") & "
" End If If affstrTypeofpayment = "" or affstrtypeofpayment= getlang("Langcommonselect") Then sError = sError & getlang("LangAffPaymentType") & "
" End If If ucase(affstrTypeofpayment)="BANK TRANSFER" then If affstrBank = "" Then sError = sError & getlang("LangaffBank") & "
" End If If affstrBankaccount = "" Then sError = sError & getlang("LangAffBankAccount") & "
" End If If affstrBankbranch = "" Then sError = sError & getlang("LangAffBankbranch") & "
" End If If affstrBankAddress = "" Then sError = sError & getlang("LangAffBankAddress") & "
" End If end if If affstrpassword = "" Then sError = sError & getlang("LangloginPassword") & "
" end if If Serror<>"" then Serror= getlang("LangCommonRequired") & "
" & SError end if If refidinput<>"" then refid=refidinput ValidateReferralid if refid<>"" then lngreferralid=refid setsess "referralid",refid else serror=serror & getlang("LangReferringAffiliate") & " " & refidinput & " " & getlang("LangRecordNotFound") & "
" end if end if 'VP-ASP 6.50 - validate email address If Not InStr(affstrEmail, "@") > 1 Then Serror=Serror & getlang("langInvalidEmail") & "
" end if end sub Sub SendMail dim emailformat, acount If GetSess("AffRegister")<>"" then exit sub ReadAffRecord lngaffid, "", "" ' objRs has the current affiliate record If getconfig("AffTemplateMerchant")<>"" then FormatOtherMail getconfig("affTemplateMerchant"), objRS, Body Setupemailformat getconfig("affTemplateMerchant"), emailformat mailtype=getconfig("xemailtype") my_from=affstrFirstname & " " & affstrLastname my_fromaddress=affstremail my_toaddress=getconfig("xemail") my_to=getconfig("xemailname") my_system=getconfig("xemailsystem") my_subject=getconfig("AffSubject") acount=0 ExecuteMail mailtype,My_from,my_fromaddress,my_to,my_toaddress,my_subject,body,emailformat,my_attachment, acount end if ' Now send to affiliate If getconfig("AffTemplateAffiliate")<>"" then FormatOtherMail getconfig("affTemplateAffiliate"), objRS, Body Setupemailformat getconfig("affTemplateAffiliate"), emailformat mailtype=getconfig("xemailtype") my_from=getconfig("xemailname") my_fromaddress=getconfig("xemail") my_toaddress=affstrEmail my_to=affstrFirstname & " " & affstrLastname my_system=getconfig("xemailsystem") my_subject=getconfig("AffSubject") acount=0 ExecuteMail mailtype,My_from,my_fromaddress,my_to,my_toaddress,my_subject,body,emailformat,my_attachment,acount end if CloseAffRS end sub ' Sub WriteInfo Doinfo Formataffiliate lngaffid, "Register" SetSess "AffRegister",lngaffid ShopPageTrailer End Sub Sub DoInfo Dim linkURL Linkurl = getconfig("Affwebsite") & "/shopaff.asp?affid=" & lngaffid shopwriteheader getlang("LangAff1") & " " & getconfig("Affsubject") & "
" & getlang("LangAff2") If getconfig("affinfoURL") <> "" then%>
><%= getlang("LangAffClickMoreInfo")%>

<%end if%> <%= getlang("LangAffLink")%>
><%=linkURL%>


<% end sub Sub addlogin dim url url="shopafflogin.asp" url=addwebsess(url) response.write ("

" & getlang("LangAdminLogin") & "

") url="shopaffmailpwd.asp" url=addwebsess(url) response.write ("

" & getlang("LangLoginForgot") & "

") end sub Sub addnewUser response.write ("

" & getlang("LangLogin02") & "

") end sub ' Sub AddUserInfo ' Include site specific information %> <% end sub Sub GetExistingAff If Getsess("referralid")<>"" then lngreferralid=getsess("referralid") end if If Getsess("AffRegister")<>"" then ReadAffRecord GetSess("Affregister"), "","" CloseAffRs end if end Sub Sub GetPaymentTypes dim payment Payment=getconfig("affpaymenttypes") if payment="" then paymentcount=0 exit sub end if parserecord payment,paymenttypes,paymentcount,"," end sub Sub Validatereferralid dim objrs, dbc, sql If not isnumeric(refid) then refid="" exit sub end if ShopOpenOtherDB dbc,getconfig("xaffiliateDB") SQL="Select * from affiliates Where affid=" & refid 'debugwrite sql Set objRS = dbc.Execute(SQL) If objRS.EOF Then ' debugwrite "not found" & sql refid="" end if closerecordset objrs shopclosedatabase dbc end sub Sub WriteAffRegHeader if getconfig("xbreadcrumbs") = "Yes" then response.write "" end if Response.Write "

" & getlang("langaffregistration") & "

" End Sub %>