chkorder.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:12k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="manage/inc/config.asp"--> 
  4. <!--#include file="inc/conn.asp"--> 
  5. <!--#include file="inc/chk.asp"--> 
  6. <%
  7. dim action,goods,username
  8. username=trim(request.cookies(cookieName)("username"))
  9. if NOT isempty(request.QueryString("action")) then
  10. goods=request.QueryString("dan")
  11. action=request.QueryString("action")
  12. select case action
  13. case "save"
  14. if request("state")<>"" then
  15. set rs=server.CreateObject("adodb.recordset")
  16. rs.Open "select state from orders where goods='"&goods&"'",conn,1,3
  17. do while not rs.EOF
  18. rs("state")=request("state")
  19. rs.Update
  20. rs.MoveNext
  21. loop
  22. rs.Close
  23. if request("state")=5 then
  24. 'response.write "select productnum,id from orders where state=5 and username='"&username&"'"
  25. 'response.end
  26. rs.open "select productnum,id from orders where state=5 and username='"&username&"'",conn,1,1
  27. dim rsSeled
  28. set rsSeled=server.CreateObject("adodb.recordset")
  29. do while not rs.eof
  30. rsSeled.open "select solded from product where id="&rs("id"),conn,1,3
  31. rsSeled("solded")=rsSeled("solded")+rs("productnum")
  32. rsSeled.Update
  33. rsSeled.close
  34. rs.movenext
  35. loop
  36. set rsSeled=nothing
  37. rs.close
  38. end if
  39. 'rs.close
  40. set rs=nothing
  41. end if
  42. call Msgbox("订单状态修改成功!","GoUrl","myorder.asp")
  43. response.End
  44. case "del"
  45. set rs=server.CreateObject("adodb.recordset")
  46. rs.open "select username,goods from orders where goods='"&goods&"' " ,conn,1,1
  47. if request.cookies(cookieName)("username")<>trim(rs("username")) then
  48. call Msgbox("response.Write ","Back","None")
  49. response.End
  50. end if
  51. conn.execute "delete from orders where goods='"&goods&"' "
  52. Call MsgBox("订单删除成功!","GoUrl","myorder.asp")
  53. response.end
  54. end select
  55. end if
  56. %>
  57. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  58. <html>
  59. <head>
  60. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  61. <title>东区网上书店</title>
  62. <link href="style.css" rel="stylesheet" type="text/css">
  63. </head>
  64. <body>
  65. <!--#include file="head.htm"-->
  66. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  67.   <tr>
  68.     <td width="219" align="left" valign="top"><!--#include file="uleft.asp"-->      <br></td><td width="561" align="left" valign="top">
  69.       <br>      <table border="0" cellpadding="0" cellspacing="0">
  70.         <tr>
  71.           <td><img src="images/w.gif" width="18" height="18"></td>
  72.           <td style="color:#415373">订单详细资料</td>
  73.         </tr>
  74.       </table>      <%
  75. goods=request.QueryString("dan")
  76. set rs=server.CreateObject("adodb.recordset")
  77. rs.open "select product.id,product.name,product.price1,product.price2,product.vipprice,orders.actiondate,orders.sex,orders.realname,orders.recepit,orders.goods,orders.postcode,orders.comments,orders.paymethord,orders.deliverymethord,orders.state,orders.paid,orders.useremail,orders.usertel,orders.address,orders.productnum from product inner join orders on product.id=orders.id where orders.username='"&request.cookies(cookieName)("username")&"' and goods='"&goods&"' ",conn,1,1
  78. if rs.eof and rs.bof then
  79. response.write "<center>此订单中有商品已被管理员删除,无法进行正确计算。<br>订单取消,请通知管理员或重新下订单!</center>"
  80. response.End
  81. end if
  82. %>      <br>      <table width="98%" border="0" cellspacing="0" cellpadding="1"  align="center">
  83.         <tr >
  84.           <td colspan="2">
  85.             <div align="center">订单号为:<%=goods%> ,详细资料如下:</div></td>
  86.         </tr>
  87.         <tr >
  88.           <td colspan="2" valign="top">订单状态: <br>
  89.             <br><form name="form1" method="post" action="chkorder.asp?dan=<%=goods%>&action=save">
  90.             <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
  91.             
  92.               <tr>
  93.                 <td><%  grade() %></td>
  94.               </tr>
  95.               <tr>
  96.                 <td align="right">
  97.                   <input type="submit" name="Submit" value="修改订单状态">
  98.                 </td>
  99.               </tr>
  100.             
  101.           </table></form></td>
  102.         </tr>
  103.         <tr >
  104.           <td colspan="2" valign="top">商品列表:<br>
  105.             <br>            <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" >
  106.             <tr  align="center">
  107.               <td>商品名称</td>
  108.               <td width="12%">订购数量</td>
  109.               <td width="12%">市场价</td>
  110.               <td width="12%">会员价</td>
  111.               <td width="16%">VIP会员价</td>
  112.               <td width="16%">金额小计</td>
  113.             </tr>
  114.             <%dim iii
  115. do while not rs.eof%>
  116.             <tr>
  117.               <td style='PADDING-LEFT: 5px'><a href=product.asp?id=<%=rs("id")%> target=_blank><%=trim(rs("name"))%></a></td>
  118.               <td align="center"><%=rs("productnum")%></td>
  119.               <td align="center"><%=rs("price1")%>元</td>
  120.               <td align="center"><%=rs("price2")%>元</td>
  121.               <td align="center"><%=rs("vipprice")%>元</td>
  122.               <td align="center"><%=rs("paid")*rs("productnum")%>元</td>
  123.             </tr>
  124.             <%iii=rs("paid")+iii
  125. rs.movenext
  126. loop
  127. rs.movefirst%>
  128.             <tr bgcolor= #FFFFFF>
  129.               <td colspan="6" height="19" align="center"><br>
  130.                 您选择的送货方式是:
  131.                   <%dim rs2
  132.               set rs2=server.CreateObject("adodb.recordset")
  133.               rs2.Open "select * from delivery where deliveryid="&rs("deliverymethord"),conn,1,1
  134.               if rs2.EOF and rs2.BOF then
  135.               response.Write "方式已经被删除"
  136.               response.write "&nbsp;附加费用:0元"
  137.   response.write "&nbsp;&nbsp;金额总计:"&iii&" 元"
  138.               else
  139.               response.Write trim(rs2("subject"))
  140.               response.write "&nbsp;附加费用:"&rs2("fee")&"元"
  141.   response.write "&nbsp;&nbsp;金额总计:<font color=red>"&iii+rs2("fee")&"</font>&nbsp;元"
  142.   end if
  143.   rs2.Close
  144.   set rs2=nothing
  145.   %>
  146.                   <br>
  147.                   <br>
  148. </td>
  149.             </tr>
  150.           </table></td>
  151.         </tr>
  152.         <tr >
  153.           <td width="17%" style='PADDING-LEFT: 10px'>订货人姓名:</td>
  154.           <td width="83%" style='PADDING-LEFT: 10px'><%=trim(rs("realname"))%></td>
  155.         </tr>
  156.         <tr >
  157.           <td style='PADDING-LEFT: 10px'>收货人姓名:</td>
  158.           <td style='PADDING-LEFT: 10px'><%=trim(rs("recepit"))%></td>
  159.         </tr>
  160.         <tr >
  161.           <td style='PADDING-LEFT: 10px'>收货地址:</td>
  162.           <td style='PADDING-LEFT: 10px'><%=trim(rs("address"))%></td>
  163.         </tr>
  164.         <tr >
  165.           <td style='PADDING-LEFT: 10px'>邮  编:</td>
  166.           <td style='PADDING-LEFT: 10px'><%=trim(rs("postcode"))%></td>
  167.         </tr>
  168.         <tr >
  169.           <td style='PADDING-LEFT: 10px'>联系电话:</td>
  170.           <td style='PADDING-LEFT: 10px'><%=trim(rs("usertel"))%></td>
  171.         </tr>
  172.         <tr >
  173.           <td style='PADDING-LEFT: 10px'>电子邮件:</td>
  174.           <td style='PADDING-LEFT: 10px'><%=trim(rs("useremail"))%></td>
  175.         </tr>
  176.         <tr >
  177.           <td style='PADDING-LEFT: 10px'>送货方式:</td>
  178.           <td style='PADDING-LEFT: 10px'>
  179.             <%set rs2=server.CreateObject("adodb.recordset")
  180.     rs2.Open "select * from delivery where deliveryid="&rs("deliverymethord"),conn,1,1
  181.     response.Write trim(rs2("subject"))
  182.     rs2.Close
  183.     set rs2=nothing%>
  184.           </td>
  185.         </tr>
  186.         <tr >
  187.           <td style='PADDING-LEFT: 10px'>支付方式:</td>
  188.           <td style='PADDING-LEFT: 10px'>
  189.             <%set rs2=server.CreateObject("adodb.recordset")
  190.     rs2.Open "select * from delivery where deliveryid="&rs("paymethord"),conn,1,1
  191.     response.Write trim(rs2("subject"))
  192.     rs2.close
  193.     set rs2=nothing%>
  194.           </td>
  195.         </tr>
  196.         <tr >
  197.           <td style='PADDING-LEFT: 10px'>您的留言:</td>
  198.           <td style='PADDING-LEFT: 10px'><%=trim(rs("comments"))%></td>
  199.         </tr>
  200.         <tr >
  201.           <td style='PADDING-LEFT: 10px'>下单日期:</td>
  202.           <td style='PADDING-LEFT: 10px'><%=rs("actiondate")%></td>
  203.         </tr>
  204.         <tr >
  205.           <td height="32" colspan="2">            <div align="center">
  206.               <%if rs("state")=1 then%>
  207.               <input type="button" name="Submit3" value="删除订单" onClick="location.href='chkorder.asp?action=del&dan=<%=goods%>'">
  208.               <%end if%>
  209.               <input type="button" name="Submit2" value="关闭窗口" onclick="window.close()">
  210.               </div></td>
  211.         </tr>
  212.       </table>      <%sub grade()
  213. select case rs("state")
  214. case "1"%>      <input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>
  215.       未作任何处理<span style='font-family:Wingdings;'>à</span>      <input name="state" type="checkbox" id="state" value="2">
  216.       用户已经划出款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox2" value="checkbox" DISABLED>
  217.       服务商已经收到款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox3" value="checkbox" DISABLED>
  218.       服务商已经发货<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox4" value="checkbox" DISABLED>
  219.       用户已经收到货
  220.       <%case "2"%>      <input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>
  221.       未作任何处理<span style='font-family:Wingdings;'>à</span>      <input name="checkbox" type="checkbox" id="state" value="2" checked DISABLED>
  222.       用户已经划出款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox2" value="checkbox" DISABLED>
  223.       服务商已经收到款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox3" value="checkbox" DISABLED>
  224.       服务商已经发货<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox4" value="checkbox" DISABLED>
  225.       用户已经收到货
  226.       <%case "3"%>      <input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>
  227.       未作任何处理<span style='font-family:Wingdings;'>à</span>      <input name="checkbox" type="checkbox" id="state" value="2" checked DISABLED>
  228.       用户已经划出款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>
  229.       服务商已经收到款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox3" value="checkbox" DISABLED>
  230.       服务商已经发货<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox4" value="checkbox" DISABLED>
  231.       用户已经收到货
  232.       <%case "4"%>      <input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>
  233.       未作任何处理<span style='font-family:Wingdings;'>à</span>      <input name="checkbox" type="checkbox" id="state" value="2" checked DISABLED>
  234.       用户已经划出款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>
  235.       服务商已经收到款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox3" value="checkbox" checked DISABLED>
  236.       服务商已经发货<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="state" value="5" >
  237.       用户已经收到货
  238.       <%case "5"%>      <input name="checkbox" type="checkbox" DISABLED id="checkbox" value="checkbox" checked>
  239.       未作任何处理<span style='font-family:Wingdings;'>à</span>      <input name="checkbox" type="checkbox" id="state" value="2" checked DISABLED>
  240.       用户已经划出款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox2" value="checkbox" checked DISABLED>
  241.       服务商已经收到款<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox3" value="checkbox" checked DISABLED>
  242.       服务商已经发货<span style='font-family:Wingdings;'>à</span>      <input type="checkbox" name="checkbox4" value="checkbox" checked DISABLED>
  243.       用户已经收到货
  244.       <%end select
  245. end sub%>      <br>      <br>
  246.       </td>
  247.   </tr>
  248. </table>
  249. <!--#include file="foot.htm"-->
  250. </body>
  251. </html>