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

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <!--#include file="inc/config.asp"-->
  3. <!--#include file="inc/conn.asp"--> 
  4. <!--#include file="inc/chk.asp"--> 
  5. <%
  6. if session("rank")>1 then
  7. call Msgbox("对不起,您的权限不够!","Back","None")
  8. response.End
  9. end if
  10. %>
  11. <%
  12. dim categoryid,category,follows
  13. dim action
  14. if NOT isempty("action") then
  15. dim url,i,abc
  16. categoryid=request("categoryid")
  17. category=request.QueryString("category")
  18. action=request.QueryString("action")
  19. select case action
  20. case "add"
  21. set rs=server.CreateObject("adodb.recordset")
  22. rs.open "select * from sorts",conn,1,3
  23. rs.AddNew
  24. rs("sorts")=trim(request("sorts2"))
  25. rs("sortsorder")=int(request("sortsorder2"))
  26. rs("categoryid")=int(request("categoryid"))
  27. rs("first")=int(request("first2"))
  28. rs.Update
  29. rs.Close
  30. set rs=nothing
  31. response.redirect "sub.asp?id="&categoryid&"&category="&category
  32. case "edit"
  33. set rs=server.CreateObject("adodb.recordset")
  34. rs.open "select * from sorts where sortsid="&request.QueryString("id"),conn,1,3
  35. rs("sorts")=trim(request("sorts"))
  36. rs("sortsorder")=int(request("sortsorder"))
  37. rs("first")=int(request("first"))
  38. rs.update
  39. rs.close
  40. set rs=nothing
  41. response.redirect "sub.asp?id="&categoryid&"&category="&category
  42. case "del"
  43. categoryid=request.QueryString("categoryid")
  44. conn.execute ("delete from sorts where sortsid="&request.QueryString("id"))
  45. conn.execute ("delete from product where sortsid="&request.QueryString("id"))
  46. response.redirect "sub.asp?id="&categoryid&"&category="&category
  47. end select
  48. end if
  49. category=request.QueryString("sorts")
  50. categoryid=request.QueryString("id")
  51. %>
  52. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  53. <html>
  54. <head>
  55. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  56. <title>406网络书店</title>
  57. <link href="../style.css" rel="stylesheet" type="text/css">
  58. </head>
  59. <body>
  60. <!--#include file="head.htm"-->
  61. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  62.   <tr>
  63.     <td width="219" align="left" valign="top"><br>
  64.       <!--#include file="menu.htm"-->
  65.         <br></td><td width="561" align="left" valign="top">
  66.       <br>      <table border="0" cellpadding="0" cellspacing="0">
  67.         <tr>
  68.           <td><img src="../images/w.gif" width="18" height="18"></td>
  69.           <td style="color:#415373">商品小类管理</td>
  70.         </tr>
  71.       </table>      <br>      <select name="select" onChange="var jmpURL=this.options[this.selectedIndex].value ; if(jmpURL!='') {window.location=jmpURL;} else {this.selectedIndex=0 ;}" >
  72.         <base target=Right>
  73.         <option selected>选择商品分类</option>
  74.         <%set rs=server.createobject("adodb.recordset")
  75. rs.Open "select * from category order by categoryorder",conn,1,1
  76. do while not rs.eof %>
  77.         <option value="sub.asp?id=<%=rs("categoryid")%>&category=<%=rs("category")%>" ><%=trim(rs("category"))%></option>
  78.         <%rs.movenext
  79. loop
  80. rs.close
  81. set rs=nothing
  82. %>
  83.       </select>      <%if request.QueryString("id")<>"" then
  84.         response.Write "当前查询:"&request.QueryString("category")
  85.         end if%>      <br>      <table width="100%" align="center" border="0" cellpadding="2" cellspacing="1">
  86.         <tr align="center" height="20">
  87.           <td width="40%">分类名称</td>
  88.           <td width="20%">分类排序</td>
  89.           <td width="20%">一级分类</td>
  90.           <td width="20%">确定操作</td>
  91.         </tr>
  92.         <%
  93.         if categoryid="" then
  94.         response.Write "<div align=center><font color=red>请选择左测的分类</font></div>"
  95.         else
  96.         set rs=server.CreateObject("adodb.recordset")
  97.         rs.Open "select * from sorts where categoryid="&categoryid&" order by sortsorder",conn,1,1
  98.          if rs.EOF and rs.BOF then
  99.   response.Write "<div align=center><font color=red>还没有分类</font></center>"
  100.   follows=0
  101.   else
  102.          do while not rs.EOF
  103.          %>
  104.         <form name="form1" method="post" action="sub.asp?action=edit&id=<%=rs("sortsid")%>&category=<%=request.QueryString("category")%>">
  105.           <tr align="center">
  106.             <td><input name="sorts" type="text" id="sorts3" size="16" value="<%=trim(rs("sorts"))%>">
  107.                 <input name="categoryid" type="hidden" value="<%=request.QueryString("id")%>" id="categoryid"></td>
  108.             <td><input name="sortsorder" type="text" id="sortsorder3" size="4" value="<%=int(rs("sortsorder"))%>"></td>
  109.             <td><input name="first" type="checkbox" id="first22" value="1">
  110.                 <%if rs("first")=1 then
  111.                 response.Write "<font color=red>一级</font>"
  112.                 else
  113.                 response.Write "二级"
  114.                 end if%>
  115.             </td>
  116.             <td><input type="submit" name="Submit" value="修改">
  117. &nbsp;<a href="sub.asp?id=<%=int(rs("sortsid"))%>&action=del&categoryid=<%=request.QueryString("id")%>&category=<%=request.QueryString("category")%>" onClick="return confirm('您确定进行删除操作吗?')"><font color=red>删除</font></a> </td>
  118.           </tr>
  119.         </form>
  120.         <%rs.movenext
  121.         loop
  122.         follows=rs.RecordCount
  123.         rs.close
  124.         set rs=nothing
  125.         end if
  126.         end if
  127. %>
  128.       </table>      <br>      <table border="0" cellpadding="0" cellspacing="0">
  129.         <tr>
  130.           <td><img src="../images/w.gif" width="18" height="18"></td>
  131.           <td style="color:#415373">添加商品分类</td>
  132.         </tr>
  133.       </table>
  134.       当前分类:<%=request.QueryString("category")%> <br>      <table width="100%" align="center"border="0" cellpadding="2" cellspacing="1">
  135.         <tr align="center" height="20">
  136.           <td width="40%">分类名称</td>
  137.           <td width="20%">分类排序</td>
  138.           <td width="20%">一级分类</td>
  139.           <td width="20%">确定操作</td>
  140.         </tr>
  141.         <form name="form2" method="post" action="sub.asp?action=add&category=<%=request.QueryString("category")%>">
  142.           <tr align="center">
  143.             <td><input name="sorts2" type="text" id="sorts22" size="16"></td>
  144.             <td><input name="sortsorder2" type="text" id="sortsorder22" size="4" value="<%=follows+1%>">
  145.                 <input name="categoryid" type="hidden" value="<%=request.QueryString("id")%>"></td>
  146.             <td><input name="first2" type="checkbox" id="first2" value="1">
  147.                 <font color="#FF0000">二级</font></td>
  148.             <td><input type="submit" name="Submit2" value="添加"></td>
  149.           </tr>
  150.         </form>
  151.       </table>      <br>      <table border="0" cellpadding="0" cellspacing="0">
  152.         <tr>
  153.           <td><img src="../images/w.gif" width="18" height="18"></td>
  154.           <td style="color:#415373">操作注意事项及说明</td>
  155.         </tr>
  156.       </table>      <table width="80%" border="0" align="center" cellpadding="5" cellspacing="0">
  157.         <tr>
  158.           <td height="16"><font color="#FF0000">·请注意分类名称不要含有非法字符。<br>
  159.       ·增加一级分类时,如果没有选择此小类所属大类为一级分类,则被列为&quot;其它&quot;分类。<br>
  160.       ·进行删除操作的同时,会删除此分类下的所有商品。</font></td>
  161.         </tr>
  162.       </table>      <br>      <br>      <br>
  163.       </td>
  164.   </tr>
  165. </table>
  166. <!--#include file="foot.htm"-->
  167. </body>
  168. </html>