<%@ LANGUAGE = "VBScript" %> <% verify stage=request.querystring("stage") orderid=request.querystring("orderid") if stage="archive" then db.execute("update orders set orderstatus='b' where orderid=" & valid_sql(orderid)) end if if stage="unarchive" then db.execute("update orders set orderstatus='a' where orderid=" & valid_sql(orderid)) end if %> <% =storename %> Administration <% header adminmenu "orders" %>

order details
· Below are the details for the selected order


<% set rsorder=db.execute("SELECT * FROM products INNER JOIN (orderitems INNER JOIN (customers INNER JOIN orders ON orders.custid=customers.custid) ON orders.orderid=orderitems.orderid) ON products.productid=orderitems.productid where orders.orderid=" & request.querystring("orderid")) if rsorder.eof then %> The specified order does not exist! <% else status=rsorder("orderstatus") %> Order ID: <%=rsorder("orderid") %> <% if rsorder("orderstatus")="b" then %> (archived) <% end if %>
Date Placed: <%=formatdatetime(rsorder("date"),1) %>


<% subtotal=0 while not(rsorder.eof) %> <% subtotal=subtotal+(rsorder("qty")*rsorder("priceperunit")) rsorder.movenext wend rsorder.movefirst %>
Product ID Item Quantity Price Each Total
<%= rsorder("productid") %> <%= rsorder("name") %> <%= rsorder("qty") %> <%= cursymbol%><%= formatnumber(rsorder("priceperunit")) %> <%= cursymbol%><%= formatnumber(rsorder("priceperunit") * rsorder("qty")) %>

Total <%= cursymbol %><%= formatnumber(subtotal) %>

Customer Details (Billing):
<%= rsorder("fname") %>  <%= rsorder("lname") %>
<%= rsorder("address1") %>
<%= rsorder("address2") %>
<%= rsorder("city") %>
<%= rsorder("state") %>  <%= rsorder("zip") %>
<%= rsorder("country") %>

Billing Details:
<%= ucase(rsorder("cctype")) %>
<%= rsorder("ccnumber") %>
<%= rsorder("ccexpire") %>
Delivery Details:
<%= rsorder("dfname") %>  <%= rsorder("dlname") %>
<%= rsorder("daddress1") %>
<%= rsorder("daddress2") %>
<%= rsorder("dcity") %>
<%= rsorder("dstate") %>  <%= rsorder("dzip") %>
<%= rsorder("dcountry") %>
<% if status="b" then %> Un-Archive <% else %> Archive <% end if end if %>

<% footer %>