<% If getconfig("xIncludeCountries")="Yes" Then %> <% End if If getconfig("xIncludeStates")="Yes" Then %> <% End if If getconfig("xvatnumber")="Yes" Then %> <% End if Sub ShopCustomerForm '******************************************************************* ' Customer form used in many places ' CreateCustRow is in shop$colors.asp ' Version 4.50 April 20, 2002 add vat number ' ShippingOtherfields '******************************************************************** Response.Write(TableDef) CreateCustRow LangCustFirstname, "strfirstname", strFirstname,"Yes" CreateCustRow LangCustLastname, "strLastname", strLastname,"Yes" CreateCustRow LangCustAddress, "strAddress", strAddress,"Yes" CreateCustRow LangCustCity, "strCity", strCity,"Yes" If getconfig("xPromptForState")="Yes" then If getconfig("xIncludeStates")="Yes" Then Response.Write(tableRow & tablecolumn & "* " & LangCustState & tablecolumnend & "") ShopStates "strstate", strstate Response.Write("") else CreateCustRow LangCustState, "strState", strState,"Yes" end if end if CreateCustRow langCustPostCode, "StrPostcode", strPostCode,"Yes" CreateCustRow LangCustPhone,"strPhone", strPhone, "Yes" CreateCustRow LangCustEmail, "strEmail", strEmail, "Yes" If getconfig("xPromptForCountry")="Yes" then If getconfig("xIncludeCountries")="Yes" Then If getconfig("xCountryRequired")="Yes" then Response.Write(tableRow & tablecolumn & "* " & langCustCountry & tablecolumnend & "") Else Response.Write(tableRow & tablecolumn & langCustCountry & tablecolumnend & "") End if ShopCountries "StrCountry", strCountry Response.Write("") else If getconfig("xCountryRequired")="Yes" then CreateCustRow LangCustCountry, "strCountry", strCountry,"Yes" Else CreateCustRow LangCustCountry, "strCountry", strCountry,"No" End if end if end if CreateCustRow LangCustCompany, "strCompany", strCompany,"No" If getconfig("xvatnumber")="Yes" then CreateCustRow LangVatnumber,"vatnumber", strvatnumber,"No" end if AddOtherFields AddPassword Response.Write(TableDefEnd) AddCookieMessage AddMaillIst end sub ' Sub AddPassword if getconfig("xpassword")="Yes" then If GetSess("Login")="" then Response.Write("" & getconfig("xfont") & LangCustomerPassword & "") Response.Write(tablerow & tablecolumn & LangPassword & tablecolumnend & "") Response.Write(tablerow & tablecolumn & LangPassword & tablecolumnend & "") end if end if end sub Sub ShopShippingForm 'on error resume next Response.Write(TableDef) If getconfig("xShippingDatabaseRecords")="Yes" then If GetSess("Shipmethodtype")="" and getconfig("xDefaultShippingMethod")<>"Yes" then shipmethodtype=LangCommonSelect end if Response.Write(tableRow & tablecolumn & "* " & LangShippingMethod & tablecolumnend & "") GenerateSelectNV shippingmethods,ShipMethodType,"shipmethodType",shippingcount, LangCommonSelect Response.write "" else if getconfig("xfixedshippingmethod")<>"" then ShipMethodType=getconfig("xfixedshippingmethod") ' user default method SetSess "ShipMethod",getconfig("xfixedshippingmethod") Response.Write(tableRow & tablecolumn & LangShippingMethod & Tablecolumnend & tablecolumn & getconfig("xfixedshippingmethod") ) Response.write "" Response.write Tablecolumnend & "" end if end if CreateCustRow LangShipName,"shipname", strshipname,"No" CreateCustRow LangCustAddress, "shipaddress", strshipaddress,"No" CreateCustRow LangCustCity, "shiptown", strshiptown ,"No" If getconfig("xPromptForState")="Yes" then If getconfig("xIncludeStates")="Yes" Then Response.Write(tableRow & tablecolumn & LangCustState & tablecolumnend & "") ShopStates "shipstate", strshipstate Response.Write("") else CreateCustRow LangCustState,"shipstate",strshipstate,"No" end if end if CreateCustRow LangCustPostCode,"shipzip", strshipzip,"No" If getconfig("xPromptForCountry")="Yes" then If getconfig("xIncludeCountries")="Yes" Then Response.Write(tableRow & tablecolumn & langCustCountry & tablecolumnend & "") ShopCountries "shipCountry", strshipCountry Response.Write("") else CreateCustRow LangCustCountry, "shipcountry", strshipCountry,"No" end if end if CreateCustRow LangCustCompany, "shipcompany", strshipcompany,"No" ShippingAddOtherFields Response.Write(TableDefEnd) ' end if shipping table end sub Sub AddMailList If getconfig("XmailListCheckBox")<>"Yes" then exit sub Response.Write(TableDef) Response.Write tablerow Response.write TableColumn Response.write LangCustAdminMailList Response.write TableColumnEnd Response.write TableColumn If blnmaillist="" then blnmaillist=TRUE end if If blnmaillist then%> <%Else%> <% End if response.write "" end Sub Sub AddOtherFields dim words,wordcount, captions, capcount,customervalues,i redim words(Getconfig("xCustomerMaxotherfields")) redim captions(getconfig("xCustomerMaxotherfields")) if Getconfig("xCustomerOtherFields")<>"" then Customervalues=Getsess("Customervalues") Parserecord Getconfig("xcustomerOtherFields"), words, wordcount,"," Parserecord getconfig("xcustomerOtherCaptions"), captions, capcount,"," for i = 0 to wordcount-1 If isarray(customervalues) then CreateCustRow captions(i),words(i), customervalues(i),"No" else CreateCustRow captions(i),words(i), "","No" end if next end if end sub ' Sub CustomerGetFields dim words,wordcount,customervalues,i, customerfieldcount dim required, requiredcount, testfield, j if getconfig("xCustomerOtherFields")="" then exit sub redim words(Getconfig("xCustomerMaxotherfields")) redim Required(getconfig("xCustomerMaxotherfields")) Customervalues=Getsess("Customervalues") CustomerFieldcount=Getsess("CustomerFieldcount") Parserecord getconfig("xcustomerOtherFields"), words, wordcount,"," If getconfig("xCustomerOtherrequired")<>"" then Parserecord getconfig("xcustomerOtherRequired"), required, requiredcount,"," else requiredcount=0 end if If not isarray(customervalues) then redim customervalues(wordcount) SetSess "customerFieldcount",wordcount customerfieldcount=wordcount end if for i = 0 to wordcount-1 customervalues(i)=request(words(i)) next SetSess "Customervalues",customervalues SetSess "customerFieldcount",wordcount If requiredcount=0 then exit sub for i = 0 to requiredcount-1 testfield=ucase(required(i)) for j=0 to wordcount-1 if testfield=ucase(words(j)) then If customervalues(j)="" Then sError = sError & words(j) & LangCustRequired & "
" end if exit for end if next next End sub Sub AddCookieMessage If getconfig("XCookielogin")<>"Yes" then exit sub Response.Write(TableDef) Response.Write tablerow Response.write TableColumn Response.write LangCookieQuestion Response.write TableColumnEnd Response.write TableColumn If blncookiequestion="" then blncookiequestion=TRUE end if If blncookiequestion then%> <%Else%> <% End if response.write "" end Sub Sub ValidateCustomerFields If strFirstname = "" Then sError = sError & LangCustFirstname & LangCustRequired & "
" End If If strLastname = "" Then sError = sError & LangCustLastname & LangCustRequired & "
" End If If strAddress = "" Then sError = sError & LangCustAddress & LangCustRequired & "
" End If If strCity = "" Then sError = sError & LangCustCity & LangCustRequired & "
" End If If getconfig("xIncludeStates")="Yes" and strState="??" then strstate="" end if If getconfig("xstaterequired")="Yes" then If getconfig("xPromptForState")="Yes" then If strState = "" Then sError = sError & LangCustState & LangCustRequired & "
" End If end if end if If strPostCode = "" Then sError = sError & LangCustPostCode & LangCustRequired & "
" End If If strPhone = "" Then sError = sError & LangCustPhone & LangCustRequired & "
" End If If strEmail = "" Then sError = sError & LangCustEmail & LangCustRequired & "
" Else CustomerValidateEmail stremail end If If getconfig("xCountryRequired")="Yes" then If strCountry="" or strCountry="??" then sError = sError & LangCustCountry & LangCustRequired & "
" End If end if If getconfig("xvatnumber")="Yes" then validatevat strcountry end if end sub ' Sub CustomerValidateEmail (stremail) If Not InStr(strEmail, "@") > 1 Then Serror=Serror & LangInvalidEmail & "
" end if End sub Sub ShippingAddOtherFields dim words,wordcount, captions, capcount,customervalues,i redim words(Getconfig("xCustomerMaxotherfields")) redim captions(getconfig("xCustomerMaxotherfields")) if Getconfig("xShippingOtherFields")<>"" then Customervalues=Getsess("Shippingvalues") Parserecord Getconfig("xShippingOtherFields"), words, wordcount,"," Parserecord getconfig("xShippingOtherCaptions"), captions, capcount,"," for i = 0 to wordcount-1 If isarray(customervalues) then CreateCustRow captions(i),words(i), customervalues(i),"No" else CreateCustRow captions(i),words(i), "","No" end if next end if end sub Sub ShippingGetOtherFields dim words,wordcount,shippingvalues,i, shippingfieldcount dim required, requiredcount, testfield, j if getconfig("xshippingOtherFields")="" then exit sub redim words(Getconfig("xCustomerMaxotherfields")) redim Required(getconfig("xcustomerMaxotherfields")) shippingvalues=Getsess("shippingvalues") shippingFieldcount=Getsess("shippingFieldcount") Parserecord getconfig("xshippingOtherFields"), words, wordcount,"," If getconfig("xshippingOtherrequired")<>"" then Parserecord getconfig("xshippingOtherRequired"), required, requiredcount,"," else requiredcount=0 end if If not isarray(shippingvalues) then redim shippingvalues(wordcount) SetSess "shippingFieldcount",wordcount shippingfieldcount=wordcount end if for i = 0 to wordcount-1 shippingvalues(i)=request(words(i)) next SetSess "shippingvalues",shippingvalues SetSess "shippingFieldcount",wordcount If requiredcount=0 then exit sub for i = 0 to requiredcount-1 testfield=ucase(required(i)) for j=0 to wordcount-1 if testfield=ucase(words(j)) then If shippingvalues(j)="" Then sError = sError & words(j) & LangCustRequired & "
" end if exit for end if next next End sub %>