|
|
your current orders
· Below is a list of all orders you have placed over the last <%= nodays %> days.
<%
sql="select * FROM products INNER JOIN (orderitems INNER JOIN orders ON orders.orderid=orderitems.orderid) ON products.productid=orderitems.productid where #" & formatdatetime(date,2) & "#-date<=" & nodays & " and custid=" & valid_sql(session("custid")) & " order by orders.orderid"
set rsorders=db.execute(sql)
if rsorders.eof then
%>
No active orders
<%
else
%>
<%
while not rsorders.eof
%>
Order ID: <%=rsorders("orderid") %>
Date Placed: <%= formatdatetime(rsorders("date"),2) %>
|
Deliver to:
|
<%=rsorders("dfname") & " " & rsorders("dlname") %>
<%=rsorders("daddress1") %>
<%=rsorders("daddress2") %>
<%=rsorders("dcity") %>
<%=rsorders("dstate") %> <%=rsorders("dzip") %>
<%=rsorders("dcountry") %>
|
|
|
Item
|
Qty
|
Price Each
|
Total
|
<%
neworder=false
gtotal=0
while not(neworder)
%>
|
"><%=rsorders("productid") %>
|
"><%=rsorders("name") %>
|
<%=rsorders("qty") %>
|
<%=cursymbol & formatnumber(rsorders("priceperunit")) %>
|
<%=cursymbol & formatnumber(rsorders("priceperunit") * rsorders("qty")) %>
|
<%
gtotal=gtotal+(rsorders("priceperunit") * rsorders("qty"))
current_orderid=rsorders("orderid")
rsorders.movenext
if rsorders.eof then
neworder=true
elseif current_orderid<>rsorders("orderid") then
neworder=true
end if
wend
%>
|
|
Grand Total
|
<% =cursymbol & formatnumber(gtotal) %>
|
|
|
<%
wend
%> <%
end if
%>
|