<% ' Comersus Sophisticated Cart ' Comersus Open Technologies LC ' 2005 ' Open Source License can be found at documentation/readme.txt ' http://www.comersus.com ' Details: list all orders for one customer %> <% 'on error resume next dim connTemp, rsTemp ' get settings pEmailAdmin = getSettingKey("pEmailAdmin") pCompany = getSettingKey("pCompany") pStoreLocation = getSettingKey("pStoreLocation") pEncryptionPassword = getSettingKey("pEncryptionPassword") pEncryptionMethod = getSettingKey("pEncryptionMethod") pCurrencySign = getSettingKey("pCurrencySign") pOrderPrefix = getSettingKey("pOrderPrefix") pEmail = request.querystring("email") pPassword = EnCrypt(request.querystring("password"), pEncryptionPassword) if trim(pEmail)="" or trim(pPassword)="" then call redirectWap("comersus_wapMessage.asp?message="&Server.UrlEncode("Enter all required data")) end if ' get all orders mySQL="SELECT idCustomer FROM customers WHERE email='" &pEmail& "' AND password='" &pPassword& "'" call getFromDatabase (mySql, rsTemp, "WapShowOrders") if rstemp.eof then call redirectWap("comersus_wapMessage.asp?message="&Server.UrlEncode("Authentication failed for")&pEmail) end If pIdCustomer=rstemp("idCustomer") mySQL="SELECT idOrder, orderDate, total, orderStatus FROM orders WHERE idCustomer=" &pIdCustomer& " ORDER BY idOrder DESC" call getFromDatabase (mySql, rsTemp, "WapShowOrders") if rstemp.eof then call redirectWap("comersus_wapMessage.asp?message="&Server.UrlEncode("You have no orders in this store")) end If pCounter=0 %>

<%do while not rstemp.eof and pCounter<5%> Order Id : <%=pOrderPrefix&rstemp("idOrder")%> - <%=rstemp("orderDate")%>
Order total: <% if pCurrencySign="$" then response.write "$$" & money(rstemp("total")) else response.write pCurrencySign & money(rstemp("total")) end if %>
Status: <% select case rstemp("orderStatus") case 1 response.write "In process" case 2 response.write "Delivered" case 3 response.write "Cancelled" case 4 response.write "Paid" end select %>
<% rstemp.MoveNext pCounter=pCounter+1 loop %>

<%call closeDb()%>