saveto.jsp
上传用户:helenhuo66
上传日期:2007-06-01
资源大小:865k
文件大小:8k
源码类别:

百货/超市行业

开发平台:

Java

  1. <%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*" errorPage="" %>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  4. <title>购物成功!</title>
  5. <link href=css.css rel=STYLESHEET type=text/css>
  6. <jsp:useBean id="mdb" class="ckstudio.db.faq" scope="page"/>
  7. <%!
  8. private String getStr(String str)
  9. {
  10.   try
  11. {
  12. String temp_p=str;
  13. byte[] temp_t=temp_p.getBytes("ISO8859-1");
  14. String temp=new String(temp_t);
  15. return temp;
  16. }
  17. catch(Exception e)
  18. {
  19. e.printStackTrace();
  20.  }
  21. return "null";
  22. }
  23. %>
  24. </head> 
  25. <body topmargin="0">
  26. <%
  27. if(session.getAttribute("user_name")==null){
  28. %>
  29. <br>1.你尚未登录!请登录后再订购本站商品!<br>2.第一次来本站,请先注册会员(免费)!<br><br>
  30. <%
  31. }else{
  32. String count="";
  33. String hw_id="";
  34. if(request.getParameter("action")=="buy"){
  35. if(request.getParameter("count")==""){
  36.     int intcount=1;
  37.     count=Integer.toString(intcount);
  38. }
  39. else
  40.     count=request.getParameter("count");
  41. if(request.getParameter("hw_id")=="")
  42. out.print("没有此货物!");
  43. else{
  44.     hw_id=request.getParameter("hw_id");
  45. String sql="select * from basket where hw_id='"+hw_id+"' and user_name='"+(String)session.getValue("user_name")+"' and basket_check=false";
  46. ResultSet rs;
  47. rs=mdb.executeQuery(sql);
  48. if(!rs.next()){
  49. String sql1="insert into basket(hw_id,user_name,basket_count,hw_name,hw_cash,user_type) values('"+hw_id+"','"+session.getValue("user_name")+"','"+count+"','"+request.getParameter("hw_name")+"','"+request.getParameter("hw_cash")+"','"+request.getParameter("user_type")+"') where hw_id='"+hw_id+"' and user_name='"+session.getValue("user_name")+"' and basket_check=false";
  50.     mdb.executeInsert(sql1);
  51. }
  52. else{
  53. //rs("basket_count")=int(rs("basket_count"))+int(count)
  54. rs.next();
  55. int basket_count=Integer.parseInt(rs.getString("basket_count"));
  56. basket_count=basket_count+Integer.parseInt(count);
  57. String basket_count2=Integer.toString(basket_count);
  58. String sql2="update basket set basket_count='"+basket_count+"'";
  59. mdb.executeUpdate(sql2);
  60. }
  61. }
  62. }
  63. %>
  64. <br>
  65. <tr> 
  66.     
  67.   <td valign="top"> 
  68.     <tr> 
  69.           
  70.   <td valign="top" height="120"> 
  71.     <table border="0" width="400" cellspacing="0" cellpadding="0" height="5" align="center">
  72.       <tr> 
  73.         <td width="380" height="18"> 
  74.           <div align="center">
  75.             <TABLE cellSpacing=0 cellPadding=0 width=416 
  76.                         align=center border=0>
  77.               <TBODY>
  78.                 <TR> 
  79.                   <TD align=middle bgcolor="#DBC2B0" height="18"><%
  80.         if(request.getParameter("sub_number")=="")
  81.         out.print("没有此订单信息");
  82.         else{
  83.         String sub_to=getStr(request.getParameter("sub_to"));
  84.         String sub_adds=getStr(request.getParameter("sub_adds"));
  85.         String sub_mail=getStr(request.getParameter("sub_mail"));
  86.         String sub_tel=getStr(request.getParameter("sub_tel"));
  87. String sub_post=getStr(request.getParameter("sub_post"));
  88.         String sub_number=getStr(request.getParameter("sub_number"));
  89. String qian=getStr(request.getParameter("qian"));
  90.         String other=getStr(request.getParameter("other"));
  91.         String sql="update sub set sub_to='"+sub_to+"',sub_tel='"+sub_tel+"',sub_post='"+sub_post+"',sub_mail='"+sub_mail+"',sub_adds='"+sub_adds+"',qian='"+qian+"',other='"+other+"' where sub_number='"+sub_number+"'";
  92.         mdb.executeUpdate(sql);
  93.         %><b>购物成功! 您的订单号是:<%=sub_number%></b>
  94.                   </TD>
  95.                 </TR>
  96.               </TBODY>
  97.             </TABLE>
  98.           </div>
  99.         </td>
  100.       </tr>
  101.       <tr> 
  102.         <td width="100%"><table width="100%" height="34" border="0" cellpadding="0" cellspacing="0">
  103.               <td width="398" height="120" valign="bottom" bgcolor="#F5EFE7" ><br>
  104.                   请记牢本订单号,你可以使用本订单号对成交情况进行查询和投诉<br> <br>
  105.                 <div align="center">
  106.                   <center>
  107.                 <table width="80%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111">
  108.                   <tr> 
  109.                     <td width="26%" height="25"> 
  110.                       <div align="right">收货人 :</div>
  111.                     </td>
  112.                     <td width="74%" height="25"> 
  113.                       <div align="center"><%=sub_to%> </div>
  114.                     </td>
  115.                   </tr>
  116.                   <tr> 
  117.                     <td width="26%" height="25"> 
  118.                       <div align="right">地址 :</div>
  119.                     </td>
  120.                     <td width="74%" height="25"> 
  121.                       <div align="center"><%=sub_adds%> </div>
  122.                     </td>
  123.                   </tr>
  124.                   <tr> 
  125.                     <td width="26%" height="25"> 
  126.                       <div align="right">邮编:</div>
  127.                     </td>
  128.                     <td width="74%" height="25"> 
  129.                       <div align="center"><%=sub_post%> </div>
  130.                     </td>
  131.                   </tr>
  132.                   <tr> 
  133.                     <td width="26%" height="25"> 
  134.                       <div align="right">电话:</div>
  135.                     </td>
  136.                     <td width="74%" height="25"> 
  137.                       <div align="center"><%=sub_tel%> </div>
  138.                     </td>
  139.                   </tr>
  140.                   <tr> 
  141.                     <td width="26%" height="25"> 
  142.                       <div align="right">E-mail:</div>
  143.                     </td>
  144.                     <td width="74%" height="25"> 
  145.                       <div align="center"><%=sub_mail%> </div>
  146.                     </td>
  147.                   </tr>
  148.                   <tr> 
  149.                     <td width="26%" height="12"> 
  150.                       <div align="right">付款方式:</div>
  151.                     </td>
  152.                     <td width="74%" height="25"> 
  153.                       <div align="center"><%=qian%> </div>
  154.                     </td>
  155.                   </tr>
  156.                   <tr>
  157.                     <td width="26%" height="12">
  158.                       <div align="right">备注:</div>
  159.                     </td>
  160.                     <td width="74%" height="25"> 
  161.                       <div align="center"><%=other%></div>
  162.                     </td>
  163.                   </tr>
  164.                   <tr> 
  165.                     <td colspan="2" height="21"> 
  166.                       <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center">
  167.                         <tr> 
  168.                           <td> 
  169.                             <p style="word-spacing: 2; line-height: 150%; margin-top: 4; margin-bottom: 6"> 
  170.                               <font color="#FF9900">&nbsp;&nbsp;1.谢谢您在本站购物,如果您选择送货上门服务,请您放心,我们的工作人员会很快将商品送到府上。<br>
  171.                               &nbsp;&nbsp;2.如果您选择银行转帐方式,请您尽快转帐,并在转帐成功后马上给我们打电话或来Email确认,最快只要1小时就给您发货!</font></td>
  172.                         </tr>
  173.                       </table>
  174.                     </td>
  175.                   </tr>
  176.                 </table>
  177.                   </center>
  178.               </div>
  179.                 <div align="center"><a href="javascript:history.go(-1)"><<返回修改收货人信息</a><br>
  180.                 </div>
  181.                 <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
  182.                   <tr> 
  183.                     <td valign="middle"><div align="center"><img src="img/pics/seperator.gif" width="359" height="1"></div></td>
  184.                   </tr>
  185.                 </table></td>
  186.             </tr>
  187.           </table> </td>
  188.         <%}
  189. }
  190. mdb.Close();%>
  191.       </tr>
  192.       
  193.     </table>