- <%@ page contentType="text/html; charset=GBK" %>
- <%@ page import="java.sql.*"%>
- <%@ page import="java.text.DecimalFormat"%>
- <%
- try{
- String strId = request.getParameter("Form_Id");
- String strLoginSuccess = (String)request.getSession(true).getAttribute("LoginSuccess");
- if (strLoginSuccess == null || strLoginSuccess.equals("")){
- response.sendRedirect("orderlogin.jsp");
- }else{
- Class.forName("oracle.jdbc.driver.OracleDriver");
- String strUrl = "jdbc:oracle:thin:@slight:1521:LOCAL";
- String strUser = "eshop";
- String strPassword = "eshop";
- Connection con = DriverManager.getConnection(strUrl, strUser, strPassword);
- Statement st = con.createStatement();
- String sql = "select * from orderlist where form_id = '" + strId +"'";
- ResultSet rs = st.executeQuery(sql);
- if (rs.next()){
- String strUserid = rs.getString("user_id");
- String strFormId = String.valueOf(rs.getLong("form_id"));
- String strName = rs.getString("name");
- String strAddress = rs.getString("Address");
- String strZip = rs.getString("zip");
- String strPhone = rs.getString("phone");
- String strEmail = rs.getString("Email");
- String strPays = rs.getString("pays");
- String strRemark = rs.getString("remark");
- String strRegtime = rs.getDate("regtime").toString();
- String strFlag = rs.getString("flag");
- if (!strFlag.equals("尚未处理")){
- strFlag = "已经发货";
- }
- if (strLoginSuccess.equals(strUserid)){
- %>
- <html>
- <head>
- <title>
- 客户订货单详细信息
- </title>
- <STYLE type=text/css>
- .main {
- FONT-SIZE: 12px
- }
- .main1 {
- FONT-SIZE: 14px
- }
- .main2 {
- FONT-SIZE: 16px
- }
- .main3 {
- FONT-SIZE: 7px
- }
- .main4 {
- FONT-SIZE: 10px
- }
- A:link {
- COLOR: #ffffff; TEXT-DECORATION: none
- }
- A:visited {
- COLOR: #ffffff; TEXT-DECORATION: none
- }
- A:active {
- COLOR: #ff0000; TEXT-DECORATION: none
- }
- A:hover {
- COLOR: #aa0000; TEXT-DECORATION: underline
- }
- </STYLE>
- <link rel="stylesheet" type="text/css" href="style.css">
- </head>
- <body bgcolor="#ffffff">
- <br> <div align="center">
- <center>
- <form method='POST' action="">
- <TABLE cellSpacing=1 cellPadding=4 width=562 bgColor=#416327 height="159">
- <TBODY>
- <TR vAlign=top bgColor=#eeeeee>
- <TD colSpan=2 width="548" height="10" bgcolor="#006699"></TD></TR>
- <TR vAlign=top bgColor=#eeeeee>
- <TD colSpan=2 width="548" height="32">客户订货单详细资料--</TD></TR>
- <TR bgColor=#eeeeee>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">订货单号:</font></SPAN></TD>
- <TD width=410 height=25> <%=strFormId%></TD></TR>
- <tr>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">收货人姓名:</font></SPAN></TD>
- <TD width=410 height=25 bgcolor="#eeeeee"> <%=strName%></TD></TR>
- <tr>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">收货人联系地址:</font></SPAN></TD>
- <TD width=410 height=25 bgcolor="#eeeeee"> <%=strAddress%></TD>
- </tr>
- <tr>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">邮政编码:</font></SPAN></TD>
- <TD width=410 height=25 bgcolor="#eeeeee"> <%=strZip%></TD>
- </tr>
- <tr>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">联系电话:</font></SPAN></TD>
- <TD width=410 height=25 bgcolor="#eeeeee"> <%=strPhone%></TD>
- </tr>
- <tr>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">电子信箱:</font></SPAN></TD>
- <TD width=410 height=25 bgcolor="#eeeeee"> <%=strEmail%></TD>
- </tr>
- <tr>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">付款方式:</font></SPAN></TD>
- <TD width=410 height=25 bgcolor="#eeeeee"> <%=strPays%></TD>
- </tr>
- <tr>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">备注:</font></SPAN></TD>
- <TD width=410 height=25 bgcolor="#eeeeee"> <%=strRemark%></TD>
- </tr>
- <tr>
- <TD width=126 bgColor=#006699 height=24 align="right"><SPAN
- ><font color="#FFFFFF">订货日期:</font></SPAN></TD>
- <TD width=410 height=24 bgcolor="#eeeeee"> <%=strRegtime%></TD>
- </tr>
- <tr>
- <TD width=126 bgColor=#006699 height=25 align="right"><SPAN
- ><font color="#FFFFFF">订单是否已经处理:</font></SPAN></TD>
- <TD width=410 height=25 bgcolor="#eeeeee"><%=strFlag%></TD>
- </tr>
- <TR vAlign=top bgColor=#eeeeee>
- <TD colSpan=2 width="548" height="31">订货商品细目--</TD></TR>
- <%
- rs.close();
- sql = "select * from shoplist where form_id = '" + strId + "'";
- rs = st.executeQuery(sql);
- DecimalFormat df = new DecimalFormat("0.00");
- %>
- <TR vAlign=top bgColor=#eeeeee>
- <TD colSpan=2 width="548" height="15">
- <div align="center">
- <table border="1" cellpadding="0" cellspacing="0" width="100%" bordercolorlight="#006699" bordercolordark="#eeeeee" height="68">
- <tr>
- <td width="16%" bgcolor="#006699" height="18" align="center"><font color="#FFFFFF">商品编号</font></td>
- <td width="33%" bgcolor="#006699" height="18" align="center"><font color="#FFFFFF">商品名称</font></td>
- <td width="21%" bgcolor="#006699" height="18" align="center"><font color="#FFFFFF">商品价格</font></td>
- <td width="12%" bgcolor="#006699" height="18" align="center"><font color="#FFFFFF">商品数量</font></td>
- <td width="18%" bgcolor="#006699" height="18" align="center"><font color="#FFFFFF">金额小计</font></td>
- </tr>
- <%
- double sum = 0;
- while (rs.next()){
- String strProductId = rs.getString("product_id");
- String strProductName = rs.getString("product_name");
- String strPrice = df.format(rs.getDouble("p_newprice"));
- String strNum = String.valueOf(rs.getLong("number1"));
- String strXj = df.format(rs.getDouble("p_newprice") * rs.getLong("number1"));
- %>
- <tr>
- <td width="22%" align="center" height="22"><%=strProductId%></td>
- <td width="33%" align="center" height="22"><%=strProductName%></td>
- <td width="21%" align="center" height="22"><%=strPrice%></td>
- <td width="12%" align="center" height="22"><%=strNum%></td>
- <td width="18%" align="center" height="22"><%=strXj%>元</td>
- </tr>
- <%
- sum = sum + rs.getDouble("p_newprice") * rs.getLong("number1");
- }
- %>
- </center>
- <tr>
- <td width="100%" colspan="5" height="22">
- <p align="right">总计金额:<%=df.format(sum)%>元</p>
- </td>
- </tr>
- </table>
- </div>
- </TD></TR>
- <center>
- <TR bgColor=#eeeeee>
- <TD colSpan=2 width="548" height="27">
- <p align="center">
- <input type="button" value="返回" name="B4" onclick="javascript:window.close()">
- </TD></TR>
- <TR bgColor=#eeeeee>
- <TD colSpan=2 width="548" height="4" bgcolor="#006699"></TD></TR></TBODY></TABLE>
- </center>
- </div>
- </form>
- <%
- }else{
- out.println("您不能查看不属于您的订单,请重新输入您自己的订单号");
- }
- }else{
- out.println("您输入的订单号不存在或格式不正确,请重新输入");
- }
- }
- %>
- </body>
- </html>
- <%
- }catch(Exception e){
- throw (e);
- }
- %>