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

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="cn.js.fan.web.*"%>
  5. <%@ page import="java.util.Iterator"%>
  6. <%@ page import="com.redmoon.forum.ui.*"%>
  7. <%@ page import="com.redmoon.forum.security.*"%>
  8. <%@ page import="org.jdom.*"%>
  9. <%@ include file="../inc/inc.jsp" %>
  10. <%@ include file="../inc/nocache.jsp" %>
  11. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  12. <jsp:useBean id="fchar" scope="page" class="cn.js.fan.util.StrUtil"/>
  13. <html><head>
  14. <meta http-equiv="pragma" content="no-cache">
  15. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  16. <meta http-equiv="expires" content="wed, 26 Feb 1997 08:21:57 GMT">
  17. <title><lt:Label res="res.label.forum.admin.config_m" key="forum_config"/></title>
  18. <%@ include file="../inc/nocache.jsp" %>
  19. <LINK href="images/default.css" type=text/css rel=stylesheet>
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  21. <style type="text/css">
  22. <!--
  23. body {
  24. margin-left: 0px;
  25. margin-top: 0px;
  26. }
  27. -->
  28. </style><body bgcolor="#FFFFFF">
  29. <script>
  30. function SelectDateTime(obj) {
  31. var dt = showModalDialog("../../util/calendar/time.jsp", "" ,"dialogWidth:266px;dialogHeight:125px;status:no;help:no;");
  32. if (dt!=null)
  33. obj.value = dt;
  34. }
  35. </script>
  36. <jsp:useBean id="timeconfig" scope="page" class="com.redmoon.forum.security.TimeConfig"/>
  37. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  38. <%
  39. if (!privilege.isMasterLogin(request)) {
  40. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  41. return;
  42. }
  43. %>
  44. <TABLE cellSpacing=0 cellPadding=0 width="100%">
  45.   <TBODY>
  46.     <TR>
  47.       <TD class=head><lt:Label res="res.label.forum.admin.ad_list" key="config_time"/></TD>
  48.     </TR>
  49.   </TBODY>
  50. </TABLE>
  51. <br>
  52. <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableframe" style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" >
  53.   <tr> 
  54.     <td width="100%" height="23" class="thead">&nbsp;<lt:Label res="res.label.forum.admin.config_m" key="forum_config"/></td>
  55.   </tr>
  56.   <tr> 
  57.     <td>
  58. <%
  59. Element root = timeconfig.getRootElement();
  60. String name="",value1 = "", value2="", value="";
  61. name = request.getParameter("name");
  62. if (name!=null && !name.equals("")) {
  63.         value1 = ParamUtil.get(request, "value1").trim();
  64. value2 = ParamUtil.get(request, "value2").trim();
  65. value = value1 + "-" + value2;
  66. timeconfig.put(name,value);
  67. out.println(fchar.Alert_Redirect(SkinUtil.LoadString(request, "info_op_success"), "config_time.jsp"));
  68. }
  69. int k = 0;
  70. Iterator ir = root.getChild("forum").getChildren().iterator();
  71. String desc = "",help = "";
  72. int valindex;
  73. while (ir.hasNext()) {
  74. Element e = (Element)ir.next();
  75. desc = e.getAttributeValue("desc");
  76. help = e.getAttributeValue("help");
  77. name = e.getName();
  78. value = e.getValue();
  79. valindex = value.indexOf("-");
  80.         if(valindex != -1) {
  81.    value1 = value.substring(0, valindex);
  82.    value2 = value.substring(valindex + 1);
  83. }   
  84. %>
  85.       <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
  86.         <FORM METHOD=POST id="form<%=k%>" name="form<%=k%>" ACTION='config_time.jsp'>
  87.           <tr> 
  88.             <td bgcolor=#F6F6F6 width='40%'> <INPUT TYPE=hidden name=name value="<%=name%>"> 
  89.               <strong><%=timeconfig.getDescription(request, name)%>:</strong><br><%=timeconfig.getDescription(request, name + "_help")%>
  90.             <td bgcolor=#F6F6F6 width='38%'>
  91.              <input style="WIDTH: 80px" value="<%=value1%>" name="value1" size="30">
  92.              &nbsp;<img style="CURSOR: hand" onClick="SelectDateTime(form<%=k%>.value1)" src="../images/clock.gif" align="absMiddle" width="18" height="18"> &nbsp;-&nbsp;
  93.              <input style="WIDTH: 80px" value="<%=value2%>" name="value2" size="30">
  94.              <img style="CURSOR: hand" onClick="SelectDateTime(form<%=k%>.value2)" src="../images/clock.gif" align="absMiddle" width="18" height="18">
  95.             <td width="22%" align=center bgcolor=#F6F6F6> <INPUT TYPE=submit value='<lt:Label key="op_modify"/>'></td>
  96.           </tr>
  97.         </FORM>
  98.       </table>
  99. <%
  100.   k++;
  101. }
  102. %>
  103. </td>
  104.   </tr>
  105.   <tr class=row style="BACKGROUND-COLOR: #fafafa">
  106.     <td valign="top" bgcolor="#FFFFFF" class="thead">&nbsp;</td>
  107.   </tr>
  108. </table> 
  109. </body>                                       
  110. </html>