
<%@ page contentType="text/html;charset=GB2312" %>
<%@ page import="java.sql.*" %>
<jsp:useBean id="login" class="a1.Login" scope="session" >
</jsp:useBean>
<% //如果客户直接进入该页面将被转向登录页面。
   if(session.isNew())
    {response.sendRedirect("userLogin.jsp"); 
    }
   //如果没有成功登录将被转向登录页面
   String success=login.getSuccess();
         if(success==null)
         {success="";
         } 
   if(!(success.equals("ok")))
     {response.sendRedirect("userLogin.jsp"); 
     }
%>
<HTML>
<BODY ><Font size=1>
<P>你的订单：
<%  String logname=login.getLogname();
           if(logname==null)
              {logname="";
              }
    Connection con;
    Statement sql; 
    ResultSet rs;
    try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        }
    catch(ClassNotFoundException e){}
    try{ con=DriverManager.getConnection("jdbc:odbc:shop","","");
         sql=con.createStatement();
         String condition="SELECT * FROM orderform WHERE logname = "+"'"+logname+"'";
         rs=sql.executeQuery(condition);
        out.print("<Table Border>");
            out.print("<TR>");
            out.print("<TH width=50>"+"<Font size=1>"+"用户名");
            out.print("<TH width=50>"+"<Font size=1>"+"姓名");
             out.print("<TH width=160>"+"<Font size=1>"+"订购号");
            out.print("<TH width=160>"+"<Font size=1>"+"书名");
            out.print("<TH width=60>"+"<Font size=1>"+"订购数量");
            out.print("<TH width=60>"+"<Font size=1>"+"电话");
            out.print("<TH width=160>"+"<Font size=1>"+"地址");
            out.print("</TR>");
       while(rs.next())
           { out.print("<TR>");
             out.print("<TD >"+"<Font size=1>"+rs.getString(1)+"</TD>"); 
             out.print("<TD >"+"<Font size=1>"+rs.getString(2)+"</TD>");
             out.print("<TD >"+"<Font size=1>"+rs.getString(3)+"</TD>"); 
             out.print("<TD >"+"<Font size=1>"+rs.getString(4)+"</TD>");
             out.print("<TD >"+"<Font size=1>"+rs.getString(5)+"</TD>"); 
             out.print("<TD >"+"<Font size=1>"+rs.getString(6)+"</TD>"); 
             out.print("<TD >"+"<Font size=1>"+rs.getString(7)+"</TD>");       
            out.print("</TR>") ;  
            }
       out.print("</Table>");
       con.close();
       }
     catch(SQLException e)
       { 
       }
%>
</BODY>
</HTML>