<%OrderID = CStr(Request.QueryString("OrderID"))%> <%If Request.Cookies("UserID") = "" Then%>
Login

Please enter your username and password in the space below to login.

Username:
Password:
<%Else%> <%If OrderID = "" Then%>


<% SQL1 = "SELECT * FROM tbl_order_index WHERE UserID = '" & Request.Cookies("UserID") & "' ORDER BY RecordID DESC" Set rstemp1 = conntemp.Execute(SQL1) %> <%If rstemp1.EOF Then%>
You do not have any orders.
<%Else%> <%Do While NOT rstemp1.EOF%> <% rstemp1.movenext Loop rstemp1.close Set rstemp1=Nothing %>
Order ID:Files:Order Date:Order Total:Option:
<%=rstemp1("OrderID")%> <% SQL2 = "SELECT COUNT(*) AS FileCount FROM tbl_order_data WHERE OrderID = '" & rstemp1("OrderID") & "'" Set rstemp2 = conntemp.Execute(SQL2) %> <%If rstemp2.EOF Then%> <%Else%> <%Do While NOT rstemp2.EOF%> <%=rstemp2("FileCount")%> <% rstemp2.movenext Loop rstemp2.close Set rstemp2=Nothing %> <%End If%> <%=rstemp1("OrderDateTime")%> <%=FormatCurrency(rstemp1("OrderTotal"),2)%> ">View Files
<%End If%>
<%Else%>
<% SQL1 = "SELECT TOP 1 * FROM tbl_order_index WHERE UserID = '" & Request.Cookies("UserID") & "' AND OrderID = '" & OrderID & "'" Set rstemp1 = conntemp.Execute(SQL1) %> <%If rstemp1.EOF Then%>

This order could not be found.
<%Else%>
<%Do While NOT rstemp1.EOF%>
My Orders / <%=rstemp1("OrderID")%>

<% SQL2 = "SELECT * FROM tbl_order_data WHERE OrderID = '" & rstemp1("OrderID") & "'" Set rstemp2 = conntemp.Execute(SQL2) %> <%If rstemp2.EOF Then%> <%Else%> <%Do While NOT rstemp2.EOF%> <% rstemp2.movenext Loop rstemp2.close Set rstemp2=Nothing %>
Item:Qty:Price:Options:
<% SQL3 = "SELECT TOP 1 * FROM tbl_product_index, tbl_product_data WHERE tbl_product_index.ProductID = " & rstemp2("ProductID") & " AND tbl_product_data.ProductID = " & rstemp2("ProductID") & " AND tbl_product_data.ItemID = " & rstemp2("ItemID") & "" Set rstemp3 = conntemp.Execute(SQL3) %> <%If rstemp3.EOF THen%> <%Else%> <%Do While NOT rstemp3.EOF%> Series <%=rstemp3("SeriesID")%> - <%=rstemp3("ItemName")%> <% rstemp3.movenext Loop rstemp3.close Set rstemp3=Nothing %> <%End If%> 1 <%=FormatCurrency(rstemp2("ItemPrice"),2)%> <%If rstemp2("StatusID") = 1 Then%>Pending Approval<%Else%>&ItemID=<%=rstemp2("ItemID")%>">Download File<%End If%>
<%End If%> <% rstemp1.movenext Loop rstemp1.close Set rstemp1=Nothing %> <%End If%>
<%End If%> <%End If%>