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

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="inc/config.asp"-->
  4. <!--#include file="inc/conn.asp"--> 
  5. <!--#include file="inc/chk.asp"--> 
  6. <%
  7. if session("rank")>1 then
  8. call Msgbox("对不起,您的权限不够!","Back","None")
  9. response.End
  10. end if
  11. %>
  12. <%
  13. dim action,deliveryid
  14. deliveryid=request.QueryString("id")
  15. action=request.QueryString("action")
  16. set rs=server.CreateObject("adodb.recordset")
  17. select case action
  18. case "deliverysave"
  19. rs.open "select * from delivery where deliveryid="&deliveryid,conn,1,3
  20. rs("subject")=trim(request("subject"))
  21. rs("deliveryidorder")=request("deliveryidorder")
  22. rs("fee")=request("fee")
  23. rs("methord")=0
  24. rs.update
  25. rs.close
  26. call MsgBox("成功修改了送货方式!","GoUrl","delivery.asp?action=delivery")
  27. response.End
  28. case "deliveryadd"
  29. rs.open "select * from delivery",conn,1,3
  30. rs.addnew
  31. rs("subject")=trim(request("subject"))
  32. rs("deliveryidorder")=request("deliveryidorder")
  33. rs("fee")=request("fee")
  34. rs("methord")=0
  35. rs.update
  36. rs.close
  37. call MsgBox("成功添加了新的送货方式!","GoUrl","delivery.asp?action=delivery")
  38. response.End
  39. case "deliverydel"
  40. conn.execute "delete from delivery where deliveryid="&deliveryid
  41. response.redirect "delivery.asp?action=delivery"
  42. case "zhifudel"
  43. conn.execute "delete from delivery where deliveryid="&deliveryid
  44. response.redirect "delivery.asp?action=zhifu"
  45. case "zhifusave"
  46. rs.open "select * from delivery where deliveryid="&deliveryid,conn,1,3
  47. rs("subject")=trim(request("subject"))
  48. rs("deliveryidorder")=request("deliveryidorder")
  49. rs("methord")=1
  50. rs.update
  51. rs.close
  52. call MsgBox("成功修改了支付方式!","GoUrl","delivery.asp?action=zhifu")
  53. response.End
  54. case "zhifuadd"
  55. rs.open "select * from delivery",conn,1,3
  56. rs.addnew
  57. rs("subject")=trim(request("subject"))
  58. rs("deliveryidorder")=request("deliveryidorder")
  59. rs("methord")=1
  60. rs.update
  61. rs.close
  62. call MsgBox("成功添加了新的支付方式!","GoUrl","delivery.asp?action=zhifu")
  63. response.End
  64. end select
  65. set rs=nothing
  66. %>
  67. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  68. <html>
  69. <head>
  70. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  71. <title>406网络书店</title>
  72. <link href="../style.css" rel="stylesheet" type="text/css">
  73. </head>
  74. <body>
  75. <!--#include file="head.htm"-->
  76. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  77.   <tr>
  78.     <td width="219" align="left" valign="top"><br>
  79.       <!--#include file="menu.htm"-->
  80.         <br></td><td width="561" align="left" valign="top">
  81.       <br>      <table border="0" cellpadding="0" cellspacing="0">
  82.         <tr>
  83.           <td><img src="../images/w.gif" width="18" height="18"></td>
  84.           <td style="color:#415373">送货/汇款设置</td>
  85.         </tr>
  86.       </table>      <br>      <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
  87.         <tr align="center" height="20">
  88.           <td><a href="?action=delivery">修改送货方式</a></td>
  89.           <td><a href="?action=zhifu">修改支付方式</a></td>
  90.         </tr>
  91.         <tr>
  92.           <td height="100" colspan="2"><br>
  93.               <%
  94.   select case action
  95. case "delivery"%>
  96.               <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
  97.                 <tr align="center" height="20">
  98.                   <td width="30%">送货方式</td>
  99.                   <td width="25%">加收金额</td>
  100.                   <td width="20%">排 序</td>
  101.                   <td width="25%">操 作 </td>
  102.                 </tr>
  103.                 <%dim i,j
  104. set rs=server.CreateObject("adodb.recordset")
  105. rs.open "select * from delivery where methord=0 order by deliveryidorder",conn,1,1
  106. i=rs.recordcount
  107. do while not rs.eof%>
  108.                 <tr align="center">
  109.                   <form name="form1" method="post" action="delivery.asp?action=deliverysave&id=<%=rs("deliveryid")%>">
  110.                     <td><input name="subject" type="text" id="subject" size="14" value=<%=trim(rs("subject"))%>></td>
  111.                     <td><input name="fee" type="text" id="fee" size="4" value=<%=rs("fee")%> onKeyPress = "return regInput(this, /^d*.?d{0,2}$/, String.fromCharCode(event.keyCode))" 
  112. onpaste = "return regInput(this, /^d*.?d{0,2}$/, window.clipboardData.getData('Text'))"
  113. ondrop = "return regInput(this, /^d*.?d{0,2}$/, event.dataTransfer.getData('Text'))">
  114.                       元</td>
  115.                     <td><input name="deliveryidorder" type="text" id="deliveryidorder" size="2" value=<%=rs("deliveryidorder")%> onKeyPress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
  116. onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
  117. ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))"></td>
  118.                     <td><input type="submit" name="Submit" value="修 改">
  119. &nbsp;<a href="delivery.asp?action=deliverydel&id=<%=rs("deliveryid")%>" onClick="return confirm('您确定进行删除操作吗?')"><font color="#FF0000">删除</font></a> </td>
  120.                   </form>
  121.                 </tr>
  122.                 <%rs.movenext
  123. loop
  124. rs.close
  125. set rs=nothing%>
  126.                 <tr align="center">
  127.                   <form name="form2" method="post" action="delivery.asp?action=deliveryadd">
  128.                     <td><input name="subject" type="text" id="subject" size="14"></td>
  129.                     <td><input name="fee" type="text" id="fee" size="4" onKeyPress = "return regInput(this, /^d*.?d{0,2}$/, String.fromCharCode(event.keyCode))" 
  130. onpaste = "return regInput(this, /^d*.?d{0,2}$/, window.clipboardData.getData('Text'))"
  131. ondrop = "return regInput(this, /^d*.?d{0,2}$/, event.dataTransfer.getData('Text'))">
  132.                     元</td>
  133.                     <td><input name="deliveryidorder" type="text" id="deliveryidorder" value=<%=i+1%> size="2" onKeyPress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
  134. onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
  135. ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))"></td>
  136.                     <td><input type="submit" name="Submit3" value="添 加"></td>
  137.                   </form>
  138.                 </tr>
  139.             </table>
  140.               <%case "zhifu"%>
  141.               <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
  142.                 <tr align="center" height="20">
  143.                   <td width="40%">支付方式</td>
  144.                   <td width="30%">排 序</td>
  145.                   <td width="30%">操作</td>
  146.                 </tr>
  147.                 <%set rs=server.CreateObject("adodb.recordset")
  148.   rs.open "select * from delivery where methord=1 order by deliveryidorder",conn,1,1
  149.   j=rs.recordcount
  150.   do while not rs.eof%>
  151.                 <tr align="center">
  152.                   <form name="form1" method="post" action="delivery.asp?action=zhifusave&id=<%=rs("deliveryid")%>">
  153.                     <td><input name="subject" type="text" id="subject" size="14" value=<%=trim(rs("subject"))%>></td>
  154.                     <td><input name="deliveryidorder" type="text" id="deliveryidorder" size="2" value=<%=rs("deliveryidorder")%> onKeyPress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
  155. onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
  156. ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))"></td>
  157.                     <td><input type="submit" name="Submit2" value="确 认">
  158. &nbsp;<a href="delivery.asp?action=zhifudel&id=<%=rs("deliveryid")%>" onClick="return confirm('您确定进行删除操作吗?')"><font color="#FF0000">删除</font></a> </td>
  159.                   </form>
  160.                   <%rs.movenext
  161.   loop
  162.   rs.close
  163.   set rs=nothing%>
  164.                 </tr>
  165.                 <tr align="center">
  166.                   <form name="form1" method="post" action="delivery.asp?action=zhifuadd">
  167.                     <td><input name="subject" type="text" id="subject" size="14"></td>
  168.                     <td><input name="deliveryidorder" type="text" id="deliveryidorder" value=<%=j+1%> size="2" onKeyPress = "return regInput(this, /^[0-9]*$/, String.fromCharCode(event.keyCode))"
  169. onpaste = "return regInput(this, /^[0-9]*$/, window.clipboardData.getData('Text'))"
  170. ondrop = "return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))"></td>
  171.                     <td><input type="submit" name="Submit32" value="添 加"></td>
  172.                   </form>
  173.                 </tr>
  174.             </table>
  175.               <%end select%>
  176.               <br>
  177.           </td>
  178.         </tr>
  179.       </table>      <br>      <br>
  180.       </td>
  181.   </tr>
  182. </table>
  183. <!--#include file="foot.htm"-->
  184. </body>
  185. </html>