master_m.jsp
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:6k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ include file="../inc/inc.jsp" %>
  3. <%@ page import="cn.js.fan.db.Conn"%>
  4. <%@ page import="cn.js.fan.util.*"%>
  5. <%@ page import="com.redmoon.forum.person.*"%>
  6. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  7. <html><head>
  8. <meta http-equiv="pragma" content="no-cache">
  9. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  10. <meta http-equiv="expires" content="wed, 26 Feb 1997 08:21:57 GMT">
  11. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  12. <title>分配管理员</title>
  13. <link rel="stylesheet" href="../../common.css">
  14. <script language="JavaScript">
  15. <!--
  16. function validate()
  17. {
  18. if  (document.addform.name.value=="")
  19. {
  20. alert("新加管理员名称空");
  21. document.addform.name.focus();
  22. return false ;
  23. }
  24. }
  25. function checkdel(frm)
  26. {
  27.  if(!confirm("你是否确认删除该管理员?"))
  28.  return;
  29.  frm.op.value="del";
  30.  frm.submit();
  31. }
  32. //-->
  33. </script>
  34. <link href="../common.css" rel="stylesheet" type="text/css">
  35. <LINK href="default.css" type=text/css rel=stylesheet>
  36. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  37. <table width='100%' cellpadding='0' cellspacing='0' >
  38.   <tr>
  39.     <td class="head">管理员</td>
  40.   </tr>
  41. </table>
  42. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  43. <%
  44. if (!privilege.isMasterLogin(request))
  45. {
  46. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  47. return;
  48. }
  49. %>
  50. <br>
  51. <TABLE class="frame_gray"  
  52. cellSpacing=0 cellPadding=0 width="95%" align=center>
  53.   <TBODY>
  54.     <TR>
  55.       <TD valign="top" bgcolor="#FFFBFF" class="thead">分配管理员 </TD>
  56.     </TR>
  57.     <TR>
  58.       <TD height=200 valign="top" bgcolor="#FFFBFF"><table width="98%" border='0' align="center" cellpadding='0' cellspacing='0'>
  59.         <tr>
  60.           <td height=20 align="left">&nbsp;</td>
  61.         </tr>
  62.         <tr>
  63.           <td valign="top"><table width="100%" border='0' cellspacing='0' cellpadding='0'>
  64.               <tr >
  65.                 <td width="100%" class="stable">
  66. <%
  67. String op = ParamUtil.get(request, "op");
  68. String name,desc;
  69. int sort;
  70. MasterDb md = new MasterDb();
  71. if (!op.equals(""))
  72. {
  73. name = ParamUtil.get(request, "name");
  74. desc = ParamUtil.get(request, "desc");
  75. sort = ParamUtil.getInt(request, "sort");
  76. if (op.equals("add"))
  77. {
  78. md.setName(name);
  79. md.setDesc(desc);
  80. md.setSort(sort);
  81. if (!md.create())
  82. out.println(StrUtil.Alert("创建管理员未成功,请检查用户是否存在,或是否有重复!"));
  83. }
  84. if (op.equals("edit"))
  85. {
  86. md = md.getMasterDb(name);
  87. md.setDesc(desc);
  88. md.setSort(sort);
  89. if (!md.save())
  90. out.println(StrUtil.Alert("修改管理员信息未成功!"));
  91. }
  92. if (op.equals("del"))
  93. {
  94. md = md.getMasterDb(name);
  95. if (!md.del())
  96. out.println(StrUtil.Alert("删除管理员未成功!"));
  97. }
  98. }
  99. Vector v = md.list();
  100. Iterator ir = v.iterator();
  101. int i = 0;
  102. %>
  103.                     <table width="98%" align="center">
  104. <% while (ir.hasNext()){
  105. md = (MasterDb) ir.next();
  106. name = md.getName();
  107. sort = md.getSort();
  108. desc = md.getDesc();
  109. i++;
  110. %>
  111.                       <FORM METHOD=POST id="form<%=i%>" name="form<%=i%>" ACTION='master_m.jsp'>
  112.                         <tr>
  113.                           <td width='60%'>                            呢称
  114.                               <INPUT TYPE=text value="<%=name%>" name="name" style='border:1pt solid #636563;font-size:9pt' size=10>
  115.                     描述
  116.                     <INPUT TYPE=text value="<%=desc%>" name="desc" style='border:1pt solid #636563;font-size:9pt' size=20>
  117.                     <input type=hidden name=op value="edit"></td>
  118.                           <td width='22%'>序号:
  119.                               <input name="sort" type=text class="singleboarder" value="<%=sort%>" size=3></td>
  120.                           <td width="8%" align=left><INPUT TYPE=submit name='edit' value='修改' style='border:1pt solid #636563;font-size:9pt; LINE-HEIGHT: normal;HEIGHT: 18px;'>
  121.                           </td>
  122.                           <td width="10%" align=center><INPUT TYPE=button value='删除' name='del' style='border:1pt solid #636563;font-size:9pt; LINE-HEIGHT: normal;HEIGHT: 18px;' onclick='checkdel(form<%=i%>)'>
  123.                           </td>
  124.                         </tr>
  125.                       </FORM>
  126.                       <%
  127. }%>
  128.                     </table>
  129.                     <tr>
  130.                       <FORM METHOD=POST ACTION="master_m.jsp" name="addform">
  131.                         <input type=hidden name=op value="add">
  132.                         <td height="23" colspan=3 align="center" class="stable"><table width="98%">
  133.                           <tr>
  134.                             <td width="60%">呢称
  135.                               <input type=text value="" name="name" style='border:1pt solid #636563;font-size:9pt' size=10>
  136. 描述
  137. <input type=text value="" name="desc" style='border:1pt solid #636563;font-size:9pt' size=20></td>
  138.                             <td width="22%">&nbsp;序号:
  139.                               <input name="sort" type="text" class="singleboarder" size=3>                              </td>
  140.                             <td width="8%"><input type="submit" name="add" value="增加" style="border:1pt solid #636563;font-size:9pt; LINE-HEIGHT: normal;HEIGHT: 18px;" onClick="return  validate()"></td>
  141.                             <td width="10%">&nbsp;</td>
  142.                           </tr>
  143.                         </table>
  144.                         </td>
  145.                       </FORM>
  146.                     </tr>
  147.           </TABLE></td>
  148.         </tr>
  149.       </table></TD>
  150.     </TR>
  151.   </TBODY>
  152. </TABLE>
  153. <br>
  154. </td>
  155. </tr>
  156. </table>
  157. </td>
  158. </tr>
  159. </table>
  160. </body>                                        
  161. </html>                            
  162.