<%@page import="java.sql.*"%>
Orders History
<%
String type = request.getParameter("type");
String cmd = "select ordid, orddate, totamt,decode(status,'n','New','p','Processed','d','Dispatched','Completed') textstatus,status from orders where userid = " + user.getUserid();
if ( type != null)
{
if ( type.equals("n"))
cmd += " and status = 'n'";
else
if ( type.equals("p"))
cmd += " and status = 'p'";
else
if ( type.equals("d"))
cmd += " and status = 'd'";
else
if ( type.equals("c"))
cmd += " and status = 'c'";
}
Connection con = user.getConnection();
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(cmd);
%>
| Order Id
| Order Date
| Total Amount
| Status
|
<%
while ( rs.next())
{
%>
| <%=rs.getInt(1)%>
| <%= rs.getString(2)%>
| <%= rs.getInt(3)%>
| <%= rs.getString(4)%>
|
<%
}
rs.close();
st.close();
con.close();
%>