
<%@ page contentType="text/html;charset=GB2312" %> 
<%@ page import="java.sql.*" %>
<jsp:useBean id="login" class="a1.Login" scope="session" >
</jsp:useBean>
<html>
<BODY>
<%@ include file="head.jsp" %>
<% //如果客户直接进入该页面将被转向登录页面。
   if(session.isNew())
    {response.sendRedirect("userLogin.jsp"); 
    }
   //如果没有成功登录将被转向登录页面
   String success=login.getSuccess();
         if(success==null)
         {success="";
         } 
   if(!(success.equals("ok")))
     {response.sendRedirect("userLogin.jsp"); 
     }
%>
<% //获取订单号：
   String order_number=request.getParameter("order_number");
          if(order_number==null)
            {order_number="";
            }
     byte b[]=order_number.getBytes("ISO-8859-1");
     order_number=new String(b);
   //获取新的定数：
   String newMount=request.getParameter("mount");
          if(newMount==null)
            {newMount="0";
            }
     byte c[]=newMount.getBytes("ISO-8859-1");
     newMount=new String(c);
    Connection con=null;
    Statement sql=null;
    ResultSet rs=null;
       try{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          }
       catch(ClassNotFoundException e){}
       try
      {con=DriverManager.getConnection("jdbc:odbc:shop","","");
       sql=con.createStatement();
       String condition=
    "UPDATE orderform SET mount = "+newMount+" WHERE order_number="+"'"+order_number+"'";
       //更新订单：
       sql.executeUpdate(condition);
       out.print("<BR>"+"订单被更新");
      }
      catch(SQLException e)
       { out.print("<BR>"+"更新失败");
       }
%>
</BODy>
</HTML>
