%
' Comersus Shopping Cart
' Comersus Open Technologies
' United States
' Software License can be found at License.txt
' http://www.comersus.com
' Details: first step of checkout
%>
<%
on error resume next
dim rsTemp, connTemp, mySql, pEmail, pPassword
' get settings
pStoreFrontDemoMode = getSettingKey("pStoreFrontDemoMode")
pCurrencySign = getSettingKey("pCurrencySign")
pDecimalSign = getSettingKey("pDecimalSign")
pCompany = getSettingKey("pCompany")
pCompanyLogo = getSettingKey("pCompanyLogo")
pCustomerPrefix = getSettingKey("pCustomerPrefix")
pUseShippingAddress = getSettingKey("pUseShippingAddress")
pRandomPassword = getSettingKey("pRandomPassword")
pUseVatNumber = getSettingKey("pUseVatNumber")
pEncryptionPassword = getSettingKey("pEncryptionPassword")
pEncryptionMethod = getSettingKey("pEncryptionMethod")
pBonusPointsPerPrice = getSettingKey("pBonusPointsPerPrice")
pDisableState = getSettingKey("pDisableState")
pHeaderKeywords = getSettingKey("pHeaderKeywords")
' custom field names
pCustomerFieldName1 = getSettingKey("customerFieldName1")
pCustomerFieldName2 = getSettingKey("customerFieldName2")
pCustomerFieldName3 = getSettingKey("customerFieldName3")
pAuctions = getSettingKey("pAuctions")
pListBestSellers = getSettingKey("pListBestSellers")
pNewsLetter = getSettingKey("pNewsLetter")
pPriceList = getSettingKey("pPriceList")
pStoreNews = getSettingKey("pStoreNews")
pUseShippingAddress = getSettingKey("pUseShippingAddress")
pByPassShipping = getSettingKey("pByPassShipping")
pIdDbSession = checkSessionData()
pIdDbSessionCart = checkDbSessionCartOpen()
pEmail = getUserInput(request.form("email"),50)
pPassword = getUserInput(request.form("password"),50)
pIdCustomer = getSessionVariable("idCustomer",0)
pWishListIdCustomer = getSessionVariable("wishListIdCustomer",0)
if pIdCustomer<>0 then
' customer already logged in
mySQL="SELECT name, lastName, customerCompany, phone, email, address, zip, state, stateCode, city, countryCode, shippingAddress, shippingZip, shippingStateCode, shippingState, shippingCity, shippingCountryCode, user1, user2, user3, bonusPoints FROM customers WHERE idCustomer=" &pIdCustomer
call getFromDatabase(mySQL, rstemp, "login")
if rstemp.eof then
response.redirect "comersus_message.asp?message="&Server.Urlencode(getMsg(402,"Cannot get customer details."))
end if
else
' verify password for that email
mySQL="SELECT idCustomer, name, lastName, customerCompany, phone, email, address, zip, state, stateCode, city, countryCode, shippingAddress, shippingZip, shippingStateCode, shippingState, shippingCity, shippingCountryCode, user1, user2, user3 FROM customers WHERE email='" &pEmail& "' AND password='" &EnCrypt(pPassword, pEncryptionPassword)& "' AND active=-1"
call getFromDatabase(mySQL, rstemp, "login")
if rstemp.eof then
response.redirect "comersus_message.asp?message="&Server.Urlencode(getMsg(403,"Invalid login information."))
end if
' save logged customer in session
session("idCustomer") = rstemp("idCustomer")
end if
pName = rstemp("name")
pLastName = rstemp("lastName")
pCustomerCompany = rstemp("customerCompany")
pPhone = rstemp("phone")
pEmail = rstemp("email")
pAddress = rstemp("address")
pZip = rstemp("zip")
pStateCode = rstemp("stateCode")
pState = rstemp("state")
pCity = rstemp("city")
pCountryCode = rstemp("countryCode")
pShippingAddress = rstemp("shippingAddress")
pShippingZip = rstemp("shippingZip")
pShippingStateCode = rstemp("shippingStateCode")
pShippingState = rstemp("shippingState")
pShippingCity = rstemp("shippingCity")
pShippingCountryCode = rstemp("shippingCountryCode")
pUser1 = rstemp("user1")
pUser2 = rstemp("user2")
pUser3 = rstemp("user3")
pBonusPoints = rstemp("bonusPoints")
session("customerName") = pName
pIdDbSession = checkSessionData()
pIdDbSessionCart = checkDbSessionCartOpen()
%>
<%=getMsg(404,"checkout")%>