CategoryAddChild.jsp
上传用户:lsj999sz
上传日期:2022-06-15
资源大小:4717k
文件大小:5k
源码类别:

ICQ/即时通讯

开发平台:

Java

  1. <%@ page language="java" import="com.bjsxt.shopping.category.*" pageEncoding="GBK"%>
  2. <%@ page import="java.util.*"%>
  3. <%
  4. request.setCharacterEncoding("GBK");
  5. int pid = Integer.parseInt(request.getParameter("pid"));
  6. int grade = Integer.parseInt(request.getParameter("grade"));
  7. if(grade >= Category.MAX_GRADE) {
  8. out.println("不能在该节点下面添加,层数超出了限制");
  9. return;
  10. }
  11. String action = request.getParameter("action");
  12. if(action != null && action.trim().equals("add")) {
  13. String name = request.getParameter("name");
  14. String descr = request.getParameter("descr");
  15. Category c = new Category();
  16. c.setPid(pid);
  17. c.setName(name);
  18. c.setDescr(descr);
  19. c.setGrade(grade + 1);
  20. CategoryService service = CategoryService.getInstance();
  21. service.add(c);
  22. out.println("类别添加成功!恭喜!");
  23. return;
  24. }
  25. %>
  26. <html><head><title>金尚商城添加子类别</title>
  27. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  28. <meta name="keywords" content="Discuz!,Board,Comsenz,forums,bulletin board,">
  29. <meta name="description" content="醒客论坛专区  - Discuz! Board">
  30. <meta name="generator" content="Discuz! 4.0.0RC4 with Templates 4.0.0">
  31. <meta name="MSSmartTagsPreventParsing" content="TRUE">
  32. <meta http-equiv="MSThemeCompatible" content="Yes">
  33. <style type="text/css"><!--
  34. a { text-decoration: none; color: #000000 }
  35. a:hover { text-decoration: underline }
  36. body { scrollbar-base-color: #F3F6FA; scrollbar-arrow-color: #4D76B3; font-size: 12px; background-color: #ffffff }
  37. table { font: 12px Verdana,Tahoma; color: #000000 }
  38. input,select,textarea { font: 11px Verdana,Tahoma; color: #000000; font-weight: normal; background-color: #F3F6FA }
  39. select { font: 11px Verdana,Tahoma; color: #000000; font-weight: normal; background-color: #F3F6FA }
  40. .nav { font: 12px Verdana,Tahoma; color: #000000; font-weight: bold }
  41. .nav a { color: #000000 }
  42. .header { font: 11px Verdana,Tahoma; color: #FFFFFF; font-weight: bold; background-image: url("images/green/bg01.gif") }
  43. .header a { color: #FFFFFF }
  44. .category { font: 11px Verdana,Tahoma; color: #000000; background-color: #EFEFEF }
  45. .tableborder { background: #4D76B3; border: 0px solid #4D76B3 } 
  46. .singleborder { font-size: 0px; line-height: 0px; padding: 0px; background-color: #F3F6FA }
  47. .smalltxt { font: 11px Verdana,Tahoma }
  48. .outertxt { font: 12px Verdana,Tahoma; color: #000000 }
  49. .outertxt a { color: #000000 }
  50. .bold { font-weight: bold }
  51. .altbg1 { background: #F3F6FA }
  52. .altbg2 { background: #FFFFFF }
  53. --></style><script language="JavaScript" src="images/common.js"></script><style type="text/css" id="defaultPopStyle">.cPopText { font-family: Tahoma, Verdana; background-color: #FFFFCC; border: 1px #000000 solid; font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; visibility: hidden; filter: Alpha(Opacity=80)}</style></head><body leftmargin="0" rightmargin="0" topmargin="0" onkeydown="if(event.keyCode==27) return false;"><div id="popLayer" style="position: absolute; z-index: 1000;" class="cPopText"></div>
  54. <table id="table1" align="center" border="0" cellpadding="0" cellspacing="0" width="97%">
  55.   <tbody>
  56.   <tr valign="top">
  57.     <td style="border-top: 0px none; border-right: 1px none; font-size: 9pt; font-family: Tahoma,Verdana; color: rgb(0, 0, 0);" width="100%"><br></td>
  58.     </tr></tbody></table>
  59. <table style="table-layout: fixed;" align="center" border="0" cellpadding="0" cellspacing="0" width="97%"> 
  60. <tbody><tr><td class="nav" align="left" nowrap="nowrap" width="90%">&nbsp;金尚商城 &raquo; <br></td>
  61. <td align="right" width="10%">&nbsp;<a href="#bottom"><img src="images/arrow_dw.gif" align="absmiddle" border="0"></a></td>        
  62. </tr></tbody></table><br>
  63. <form method="post" name="register" action="CategoryAddChild.jsp" onSubmit="this.regsubmit.disabled=true;">
  64. <input type="hidden" name="action" value="add"/>
  65. <input type="hidden" name="pid" value="<%=pid %>"/>
  66. <input type="hidden" name="grade" value="<%=grade %>"/>
  67. <table class="tableborder" align="center" cellpadding="4" cellspacing="1" width="97%">
  68. <tbody><tr>
  69. <td colspan="2" class="header">添加类别 - 必填内容</td>
  70. </tr>
  71. <tr>
  72. <td class="altbg1" width="21%">类别名称:</td>
  73. <td class="altbg2"><input name="name" size="25" maxlength="25" type="text"> 
  74. </tr>
  75. <tr>
  76. <td class="altbg1" valign="top">类别描述:</td>
  77. <td class="altbg2"><textarea name="descr" cols="60" rows="5" id="descr"></textarea></td>
  78. </tr>
  79. </tbody></table>
  80. <br>
  81. <center><input name="regsubmit" value="提 &nbsp; 交" type="submit"></center>
  82. </form>
  83. </body></html>