VIPUserGroup_add.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:500px;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="com.redmoon.forum.Privilege"/>
  71. <%
  72. if (!privilege.isMasterLogin(request))
  73. {
  74. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  75. return;
  76. }
  77. %>
  78. <table width='100%' cellpadding='0' cellspacing='0' >
  79.   <tr>
  80.     <td class="head"><lt:Label res="res.label.forum.admin.entrance" key="vip_usergroup_manage"/>
  81.     </td>
  82.   </tr>
  83. </table>
  84. <br>
  85. <table width="98%" height="227" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  86.   <tr> 
  87.     <td height=20 align="left" class="thead"> <lt:Label res="res.label.forum.admin.entrance" key="vip_usergroup_add"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="entranceVIPUserGroup.jsp"><lt:Label res="res.label.forum.admin.entrance" key="entrance_manage"/></a></td>
  88.   </tr>
  89.   <tr> 
  90.     <td valign="top">
  91. <%
  92. String op = ParamUtil.get(request, "op");
  93. VIPUserGroupDb vtu = new VIPUserGroupDb();
  94. if (op.equals("add")) {
  95. String groupCode = ParamUtil.get(request, "groupCode").trim();
  96. String errMsg = "";
  97. if (groupCode.equals("")) {
  98. // errMsg += "用户名不能为空!\r\n";
  99. }
  100. String boards="",bDate,eDate;
  101. Date beginDate=null,endDate=null;
  102. boolean isValid = false;
  103. boards = ParamUtil.get(request, "boards");
  104. try {
  105. bDate = ParamUtil.get(request, "beginDate");
  106. eDate = ParamUtil.get(request, "endDate");
  107. beginDate = DateUtil.parse(bDate, "yyyy-MM-dd");
  108. endDate = DateUtil.parse(eDate, "yyyy-MM-dd");
  109. isValid = ParamUtil.getBoolean(request, "isValid", false);
  110. }
  111. catch (Exception e) {
  112. errMsg += e.getMessage() + "\r\n";
  113. }
  114. if (beginDate==null || endDate==null)
  115. errMsg += SkinUtil.LoadString(request, "res.label.forum.admin.entrance", "date_empty");
  116. if (!errMsg.equals("")) {
  117. out.print(StrUtil.Alert(errMsg));
  118. }
  119. else {
  120. vtu.setGroupCode(groupCode);
  121. vtu.setBeginDate(beginDate);
  122. vtu.setEndDate(endDate);
  123. vtu.setValid(isValid);
  124. vtu.setBoards(boards);
  125. if (vtu.create())
  126. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  127. else
  128. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  129. }
  130. }
  131. %>
  132. <br>
  133.       <br>
  134.       <table width="52%"  border="0" align="center" cellpadding="5" class="tableframe_gray">
  135.         <form name="form1" method="post" action="?op=add">
  136.         
  137.         <tr>
  138.           <td align="left"><lt:Label res="res.label.forum.admin.entrance" key="user_group"/></td>
  139.           <td align="left"><label>
  140.           <select name="groupCode">
  141.             <%
  142. UserGroupDb ugroup = new UserGroupDb();
  143. Vector result = ugroup.list();
  144. Iterator ir = result.iterator();
  145. String opts = "";
  146. while (ir.hasNext()) {
  147. ugroup = (UserGroupDb) ir.next();
  148. opts += "<option value=" + ugroup.getCode() + ">" + ugroup.getDesc() + "</option>";
  149. }
  150. %>
  151.             <%=opts%>
  152.           </select>
  153.           </label></td>
  154.         </tr>
  155.         
  156.         <tr>
  157.           <td width="29%" align="left"><lt:Label res="res.label.forum.admin.entrance" key="begin_date"/></td>
  158.           <td width="71%" align="left"><input name="beginDate" size=10 readonly value="">
  159.             &nbsp;<img src="../../util/calendar/calendar.gif" align=absMiddle style="cursor:hand" onClick="SelectDate('beginDate','yyyy-mm-dd')"></td>
  160.         </tr>
  161.         <tr>
  162.           <td align="left"><lt:Label res="res.label.forum.admin.entrance" key="end_date"/></td>
  163.           <td align="left"><input name="endDate" size=10 readonly>
  164.             &nbsp;<img src="../../util/calendar/calendar.gif" align=absMiddle style="cursor:hand" onClick="SelectDate('endDate','yyyy-mm-dd')"></td>
  165.         </tr>
  166.         
  167.         <tr>
  168.           <td align="left"><lt:Label res="res.label.forum.admin.entrance" key="type"/></td>
  169.           <td align="left"><label>
  170.   <input name="boards" value="" type="hidden">
  171.           <textarea name="boardNames" cols="45" rows="3" readOnly wrap="yes" id="boardNames"></textarea>
  172.             <input class="SmallButton" onClick="openWinKinds()" type="button" value="<lt:Label res="res.label.forum.admin.entrance" key="sel_board"/>" name="button">
  173.             </label></td>
  174.         </tr>
  175.         <tr>
  176.           <td align="left"><lt:Label res="res.label.forum.admin.entrance" key="is_valid"/></td>
  177.           <td align="left"><input type=checkbox name="isValid" value="true"></td>
  178.         </tr>
  179.         <tr>
  180.           <td colspan="2" align="center"><input type="submit" name="Submit" value="<lt:Label key="ok"/>">
  181. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  182. <input type="reset" name="Submit2" value="<lt:Label key="reset"/>"></td>
  183.         </tr>
  184.       </form>
  185.       </table>
  186.       <br></td>
  187.   </tr>
  188. </table>
  189. </td> </tr>             
  190.       </table>                                        
  191.        </td>                                        
  192.      </tr>                                        
  193.  </table>                                        
  194.                                
  195. </body>                                        
  196. </html>                            
  197.