<!--#include file="../../owFunctions/I_GeneralFunctions.asp"-->
<%sPath = "../"%>
<!--#include file="../../owTemplates/Template_AllLeft.asp"-->
<%
	'************************************************************************************
	'*																					*
	'*	MODIFICATION TO THIS SCRIPT OR ANY FILES INCLUDED WITH 							*
	'*		ONEWORLDSTORE IS DONE AT YOUR OWN RISK!										*
	'*	Product  : OneWorldStore														*
	'*	Version  : 9.0000																*
	'*	Modified : June 2004															*
	'*	Copyright:	Copyright (C) 2004 OneWorldStore.Com								*
	'*				Registration Number: 1024507										*
	'*				http://strategis.ic.gc.ca/											*
	'*																					*
	'************************************************************************************

	
	'************************************************************************************
	'*																					*
	'*																					*
	'*																					*
	'************************************************************************************
	Sub ActionSubroutine()
	
		if ( NOT bHasAccount ) then
			response.redirect "../owCustomerAuthenticate.asp"
		Else
			sSQLText = "SELECT O.idOrder, O.orderDate, O.total, O.orderstatus FROM Orders O, owAccounts A WHERE O.AccountUnq = A.AccountUnq AND A.AccountUnq = " & iLoginAccountUnq & " AND O.OrderStatus <> " & C_UNFINALIZED & " ORDER BY O.IdOrder DESC"
			Call DB_getFromDatabase (sSQLText, rsStoreData,"")
			if rsStoreData.eof then 
				Response.Write LANG_DT( "LISTORDERS_NOORDERS", "You have no orders in this store." )
			Else
				%>
				<center>
				<table width=<%=sOWStoreTableWidth%> border=0 style='border: 1px solid #000000;' cellspacing=0 cellpadding=5>
					<tr bgcolor="#eeeeee">
						<td colspan=4 style='border-bottom: 1px solid #000000;'>
							<b><%=LANG_DT( "LISTORDERS_ORDERTRACKING", "Order Tracking" )%></b>
						</td>
					</tr>
					<tr>
						<td bgcolor=#eeeecc><b><%=LANG_DT( "LISTORDERS_DATE", "Date of order" )%></b></td>
						<td bgcolor=#eeeecc align=center><b><%=LANG_DT( "LISTORDERS_ORDERNUM", "Order #" )%></b></td>
						<td bgcolor=#eeeecc align=center><b><%=LANG_DT( "LISTORDERS_COST", "Total Cost" )%></b></td>
						<td bgcolor=#eeeecc align=center><b><%=LANG_DT( "LISTORDERS_STATUS", "Status" )%></b></td>
					</tr>
					<%
					While ( NOT rsStoreData.EOF )
						sIDOrder		= rsStoreData("idOrder")
						sOrderDate		= rsStoreData("orderDate")
						sTotal			= rsStoreData("total")
						sOrderStatus	= rsStoreData("orderStatus")
						%>
						<tr> 
							<td><%=sOrderDate%></td>
							<td align=center><a href="owSavedOrderDetails.asp?idOrder=<%=sIDOrder%>"><%=sOWOrderPrefix&sIDOrder%></a></td>
							<td align=center><%=CONVERSION_Currency(sTotal)%></td>
							<td align=center>
								<%
								Select Case sOrderStatus
									Case C_PENDING
										Response.Write LANG_DT( "PENDING", "In Progress" )
									Case C_DELIVERED
										Response.Write LANG_DT( "DELIVERED", "Delivered" )
									Case C_CANCELLED
										Response.Write LANG_DT( "CANCELLED", "Cancelled" )
									Case C_PAID
										Response.Write LANG_DT( "PAID", "Paid" )
									Case C_CHARGEBACK
										Response.Write LANG_DT( "CHARGEBACK", "ChargeBack" )
									Case C_REFUNDED
										Response.Write LANG_DT( "REFUNDED", "Refunded" )
									Case C_UNFINALIZED
										Response.Write LANG_DT( "UNFINALIZED", "Unfinalized" )
								End Select
								%>
							</td>
						</tr>
						<%
						rsStoreData.MoveNext
					Wend
					Call DB_closeRecordset(rsStoreData)
					%>  
				</table>
				<%
			
			End If
		End If

	End Sub
	'************************************************************************************
%>