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

Jsp/Servlet

开发平台:

Java

  1. <%@ page contentType="text/html; charset=utf-8" %>
  2. <%@ page import="java.util.*"%>
  3. <%@ page import="cn.js.fan.web.*"%>
  4. <%@ page import="cn.js.fan.util.*"%>
  5. <%@ page import="com.redmoon.forum.plugin.*"%>
  6. <%@ page import="com.redmoon.forum.plugin.entrance.*"%>
  7. <%@ page import="com.redmoon.forum.*"%>
  8. <%@ page import="com.redmoon.forum.person.*"%>
  9. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  10. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  11. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  12. <html><head>
  13. <meta http-equiv="pragma" content="no-cache">
  14. <link rel="stylesheet" href="../../common.css">
  15. <LINK href="default.css" type=text/css rel=stylesheet>
  16. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  17. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  18. <title><lt:Label res="res.label.forum.admin.entrance" key="vip_usergroup_manage"/></title>
  19. <script>
  20. function findObj(theObj, theDoc)
  21. {
  22.   var p, i, foundObj;
  23.   
  24.   if(!theDoc) theDoc = document;
  25.   if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  26.   {
  27.     theDoc = parent.frames[theObj.substring(p+1)].document;
  28.     theObj = theObj.substring(0,p);
  29.   }
  30.   if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  31.   for (i=0; !foundObj && i < theDoc.forms.length; i++) 
  32.     foundObj = theDoc.forms[i][theObj];
  33.   for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
  34.     foundObj = findObj(theObj,theDoc.layers[i].document);
  35.   if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  36.   
  37.   return foundObj;
  38. }
  39. var GetDate=""; 
  40. function SelectDate(ObjName,FormatDate){
  41. var PostAtt = new Array;
  42. PostAtt[0]= FormatDate;
  43. PostAtt[1]= findObj(ObjName);
  44. GetDate = showModalDialog("../../util/calendar/calendar.htm", PostAtt ,"dialogWidth:286px;dialogHeight:221px;status:no;help:no;");
  45. }
  46. function SetDate()
  47. findObj(ObjName).value = GetDate; 
  48. function openWinKinds() {
  49. var ret = showModalDialog('board_sel_multi.jsp',window.self,'dialogWidth:480px;dialogHeight:320px;status:no;help:no;')
  50. if (ret==null)
  51. return;
  52. form1.boardNames.value = "";
  53. form1.boards.value = "";
  54. for (var i=0; i<ret.length; i++) {
  55. if (form1.boardNames.value=="") {
  56. form1.boards.value += ret[i][0];
  57. form1.boardNames.value += ret[i][1];
  58. }
  59. else {
  60. form1.boards.value += "," + ret[i][0];
  61. form1.boardNames.value += "," + ret[i][1];
  62. }
  63. }
  64. }
  65. function getLeaves() {
  66. return form1.boards.value;
  67. }
  68. </script>
  69. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  70. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  71. <table width='100%' cellpadding='0' cellspacing='0' >
  72.   <tr>
  73.     <td class="head"><lt:Label res="res.label.forum.admin.entrance" key="vip_usergroup_manage"/></td>
  74.   </tr>
  75. </table>
  76. <br>
  77. <table width="98%" height="227" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  78.   <tr> 
  79.     <td height=20 align="left" class="thead"> <lt:Label res="res.label.forum.admin.entrance" key="vip_user_group_modify"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="entranceVIPUserGroup.jsp"><lt:Label res="res.label.forum.admin.entrance" key="entrance_manage"/></a></td>
  80.   </tr>
  81.   <tr> 
  82.     <td valign="top">
  83. <%
  84. if (!privilege.isUserPrivValid(request, "forum.plugin"))
  85. {
  86. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  87. return;
  88. }
  89. String groupCode = ParamUtil.get(request, "groupCode");
  90. if (groupCode.equals("")) {
  91. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "res.label.forum.admin.entrance", "need_group_code")));
  92. return;
  93. }
  94. VIPUserGroupDb vpc = new VIPUserGroupDb();
  95. vpc = vpc.getVIPUserGroupDb(groupCode);
  96. if (vpc==null || !vpc.isLoaded()) {
  97. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "res.label.forum.admin.entrance", "group_not_exist")));
  98. return;
  99. }
  100. UserGroupDb ugd = new UserGroupDb();
  101. ugd = ugd.getUserGroupDb(vpc.getGroupCode());
  102. String op = ParamUtil.get(request, "op");
  103. if (op.equals("edit")) {
  104. String errMsg = "";
  105. if (groupCode.equals("")) {
  106. // errMsg += "用户名不能为空!\r\n";
  107. }
  108. String boards="",bDate,eDate,fingerPrint="";
  109. Date beginDate=null,endDate=null;
  110. boolean isUseFingerPrint = false;
  111. boolean isValid = false;
  112. try {
  113. boards = ParamUtil.get(request, "boards");
  114. bDate = ParamUtil.get(request, "beginDate");
  115. eDate = ParamUtil.get(request, "endDate");
  116. beginDate = DateUtil.parse(bDate, "yyyy-MM-dd");
  117. endDate = DateUtil.parse(eDate, "yyyy-MM-dd");
  118. isValid = ParamUtil.getBoolean(request, "isValid", false);
  119. }
  120. catch (Exception e) {
  121. errMsg += e.getMessage() + "\r\n";
  122. }
  123. if (beginDate==null || endDate==null)
  124. errMsg += SkinUtil.LoadString(request, "res.label.forum.admin.entrance", "need_begin_end_date");
  125. if (!errMsg.equals("")) {
  126. out.print(StrUtil.Alert(errMsg));
  127. }
  128. else {
  129. vpc.setBeginDate(beginDate);
  130. vpc.setEndDate(endDate);
  131. vpc.setBoards(boards);
  132. vpc.setValid(isValid);
  133. if (vpc.save())
  134. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  135. else
  136. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  137. }
  138. }
  139. %>
  140. <br>
  141. <table width="52%"  border="0" align="center" cellpadding="5" class="tableframe_gray">
  142.         <form id="form1" name="form1" method="post" action="?op=edit">
  143.         <tr>
  144.           <td align="left"><lt:Label res="res.label.forum.admin.entrance" key="user_group"/></td>
  145.           <td align="left"><%=ugd.getDesc()%><input name="groupCode" type="hidden" id="groupCode" value="<%=groupCode%>"></td>
  146.         </tr>
  147.         
  148.         
  149.         <tr>
  150.           <td width="27%" align="left"><lt:Label res="res.label.forum.admin.entrance" key="begin_date"/></td>
  151.           <td width="73%" align="left"><input name="beginDate" size=10 readonly value="<%=DateUtil.format(vpc.getBeginDate(), "yyyy-MM-dd")%>">
  152.             &nbsp;<img src="../../util/calendar/calendar.gif" align=absMiddle style="cursor:hand" onClick="SelectDate('beginDate','yyyy-mm-dd')"></td>
  153.         </tr>
  154.         <tr>
  155.           <td align="left"><lt:Label res="res.label.forum.admin.entrance" key="end_date"/></td>
  156.           <td align="left"><input name="endDate" size=10 readonly value="<%=DateUtil.format(vpc.getEndDate(), "yyyy-MM-dd")%>">
  157.             &nbsp;<img src="../../util/calendar/calendar.gif" align=absMiddle style="cursor:hand" onClick="SelectDate('endDate','yyyy-mm-dd')"></td>
  158.         </tr>
  159.         
  160.         <tr>
  161.           <td align="left"><lt:Label res="res.label.forum.admin.entrance" key="type"/></td>
  162.           <td align="left"><label>
  163.           <input type="hidden" name="boards" value="<%=vpc.getBoards()%>">
  164.   <%
  165.   String boards = vpc.getBoards();
  166.   String boardNames = "";
  167.   if (boards!=null && !boards.equals("")) {
  168.    String[] boardary = boards.split(",");
  169. int len = boardary.length;
  170. Directory dir = new Directory();
  171. Leaf lf = null;
  172. for (int i=0; i<len; i++) {
  173. lf = dir.getLeaf(boardary[i]);
  174. // System.out.println("VIPCard_edit.jsp " + kindAry[i]);
  175. if (lf!=null) {
  176. if (boardNames.equals(""))
  177. boardNames = lf.getName();
  178. else
  179. boardNames += "," + lf.getName();
  180. }
  181. }
  182.   }
  183.   %>
  184.           <textarea name="boardNames" cols="45" rows="3" readOnly wrap="yes" id="boardNames"><%=boardNames%></textarea>
  185.           <input class="SmallButton" onClick="openWinKinds()" type="button" value="<lt:Label res="res.label.forum.admin.entrance" key="sel_board"/>" name="button">
  186. </label></td>
  187.         </tr>
  188.         
  189.         <tr>
  190.           <td align="left"><lt:Label res="res.label.forum.admin.entrance" key="is_valid"/></td>
  191.           <td align="left">
  192.   <input type=checkbox name="isValid" value="true" <%=vpc.isValid()?"checked":""%>></td>
  193.         </tr>
  194.         <tr>
  195.           <td colspan="2" align="center"><input type="submit" name="Submit" value="<lt:Label key="ok"/>">
  196. &nbsp;&nbsp;&nbsp;&nbsp;            &nbsp;
  197. <input type="reset" name="Submit2" value="<lt:Label key="reset"/>"></td>
  198.         </tr>
  199.       </form>
  200.       </table>
  201. <br></td>
  202.   </tr>
  203. </table>
  204. </td> </tr>             
  205.       </table>                                        
  206.        </td>                                        
  207.      </tr>                                        
  208.  </table>                                        
  209.                                
  210. </body>                                        
  211. </html>                            
  212.