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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html;charset=utf-8" %>
  2. <%@ page import="java.util.Enumeration"%>
  3. <%@ page import="cn.js.fan.util.*"%>
  4. <%@ page import="java.util.Iterator"%>
  5. <%@ page import="org.jdom.*"%>
  6. <%@ include file="../inc/inc.jsp" %>
  7. <%@ include file="../inc/nocache.jsp" %>
  8. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  9. <html><head>
  10. <meta http-equiv="pragma" content="no-cache">
  11. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  12. <meta http-equiv="expires" content="wed, 26 Feb 1997 08:21:57 GMT">
  13. <title>配置管理</title>
  14. <%@ include file="../inc/nocache.jsp" %>
  15. <link rel="stylesheet" href="../common.css">
  16. <script language="JavaScript">
  17. <!--
  18. function validate()
  19. {
  20. if  (document.addform.name.value=="")
  21. {
  22. alert("新加类别不能为空");
  23. document.addform.name.focus();
  24. return false ;
  25. }
  26. }
  27. function checkdel(frm)
  28. {
  29.  if(!confirm("你是否确认删除该类别?"))
  30.  return;
  31.  frm.op.value="del";
  32.  frm.submit();
  33. }
  34. //-->
  35. </script>
  36. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  37. <body bgcolor="#FFFFFF" topmargin='5' leftmargin='0'>
  38. <jsp:useBean id="cfgparser" scope="page" class="cn.js.fan.util.CFGParser"/>
  39. <jsp:useBean id="myconfig" scope="page" class="com.redmoon.oa.Config"/>
  40. <jsp:useBean id="privilege" scope="page" class="com.redmoon.oa.pvg.Privilege"/>
  41. <%
  42. String priv="admin";
  43. if (!privilege.isUserPrivValid(request,priv))
  44. {
  45.     out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  46. return;
  47. }
  48. %>
  49. <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableframe">
  50.   <tr> 
  51.     <td width="100%" height="23" class="right-title">&nbsp;配 
  52.       置 管 理</td>
  53.   </tr>
  54.   <tr> 
  55.     <td valign="top" bgcolor="#FFFFFF">
  56. <%
  57. Element root = myconfig.getRootElement();
  58. String name="",value = "";
  59. name = request.getParameter("name");
  60. if (name!=null && !name.equals(""))
  61. {
  62. value = ParamUtil.get(request, "value");
  63. myconfig.put(name,value);
  64. out.println(fchar.Alert_Redirect("更改成功!", "config_m.jsp"));
  65. }
  66. int k = 0;
  67. Iterator ir = root.getChild("oa").getChildren().iterator();
  68. String desc = "";
  69. %>
  70.       <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
  71. <%
  72. while (ir.hasNext()) {
  73.   Element e = (Element)ir.next();
  74.   desc = e.getAttributeValue("desc");
  75.   name = e.getName();
  76.   value = e.getValue();
  77. %>
  78.         <FORM METHOD=POST id="form<%=k%>" name="form<%=k%>" ACTION='config_m.jsp'>
  79.           <tr> 
  80.             <td bgcolor=#F6F6F6 width='52%'> <INPUT TYPE=hidden name=name value="<%=name%>"> 
  81.               &nbsp;<%=myconfig.getDescription(name)%> 
  82.             <td bgcolor=#F6F6F6 width='34%'> 
  83. <%if (value.equals("true") || value.equals("false")) {%>
  84. <select name="value" width=10>
  85. <option value="true">是</option>
  86. <option value="false">否</option>
  87. </select>
  88. <script>
  89. form<%=k%>.value.value = "<%=value%>";
  90. </script>
  91. <%}else{%>
  92. <input type=text value="<%=value%>" name="value" style='border:1pt solid #636563;font-size:9pt' size=30>
  93.             <%}%>
  94. <td width="14%" align=center bgcolor=#F6F6F6> <INPUT TYPE=submit name='edit' value='修改'>            </td>
  95.           </tr>
  96.         </FORM>
  97. <%
  98.   k++;
  99. }
  100. %>
  101.       </table>
  102. </td>
  103.   </tr>
  104. </table> 
  105. </body>                                        
  106. </html>                            
  107.