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

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.score.*"%>
  7. <%@ page import="com.redmoon.forum.*"%>
  8. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  9. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  10. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  11. <html><head>
  12. <meta http-equiv="pragma" content="no-cache">
  13. <link rel="stylesheet" href="../../common.css">
  14. <LINK href="default.css" type=text/css rel=stylesheet>
  15. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  16. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  17. <title><lt:Label res="res.label.forum.admin.score" key="score"/></title>
  18. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  19. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  20. <%
  21. if (!privilege.isUserPrivValid(request, "forum.plugin"))
  22. {
  23. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  24. return;
  25. }
  26. String scoreCode = ParamUtil.get(request, "scoreCode");
  27. ScoreMgr sm = new ScoreMgr();
  28. ScoreUnit su = sm.getScoreUnit(scoreCode);
  29. String op = ParamUtil.get(request, "op");
  30. if (op.equals("add")) {
  31. String boardCode = ParamUtil.get(request, "boardCode");
  32. if (!boardCode.equals("")) {
  33. BoardScoreDb be = new BoardScoreDb();
  34. be.setBoardCode(boardCode);
  35. be.setScoreCode(scoreCode);
  36. if (be.create()) {
  37. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  38. }
  39. else
  40. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  41. }
  42. }
  43. if (op.equals("del")) {
  44. String boardCode = ParamUtil.get(request, "boardCode");
  45. BoardScoreDb be = new BoardScoreDb();
  46. be = be.getBoardScoreDb(boardCode, scoreCode);
  47. if (be.del()) {
  48. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  49. }
  50. else
  51. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  52. }
  53. %>
  54. <table width='100%' cellpadding='0' cellspacing='0' >
  55.   <tr>
  56.     <td class="head"><lt:Label res="res.label.forum.admin.entrance" key="plugin_manage"/></td>
  57.   </tr>
  58. </table>
  59. <br>
  60. <table width="98%" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  61.   <tr> 
  62.     <td height=20 align="left" class="thead"><%=su.getName(request)%></td>
  63.   </tr>
  64.   <tr>
  65.     <td valign="top"><br>
  66.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFBFF" class="tableframe_gray">
  67.       <tr align="center">
  68.         <td width="13%" height="22"><lt:Label res="res.label.forum.admin.score" key="code"/></td>
  69.       <td width="23%" height="22"><lt:Label res="res.label.forum.admin.score" key="name"/></td>
  70.         <td width="30%"><lt:Label res="res.label.forum.admin.score" key="plugin"/></td>
  71.         <td width="34%" height="22"><lt:Label key="op"/></td>
  72.       </tr>
  73. <%
  74. BoardScoreDb br = new BoardScoreDb();
  75. Vector v = br.list(scoreCode);
  76. Iterator ir = v.iterator();
  77. Leaf leaf = new Leaf();
  78. while (ir.hasNext()) {
  79. BoardScoreDb sb = (BoardScoreDb)ir.next();
  80. leaf = leaf.getLeaf(sb.getBoardCode());
  81. %>
  82.       <tr align="center">
  83.         <td height="22"><%=leaf.getCode()%></td>
  84.       <td height="22"><%=leaf.getName()%></td>
  85.         <td><%=su.getName()%></td>
  86.         <td height="22"><a href="?op=del&boardCode=<%=StrUtil.UrlEncode(leaf.getCode())%>&scoreCode=<%=StrUtil.UrlEncode(sb.getScoreCode())%>"><lt:Label key="op_del"/></a></td>
  87.       </tr>
  88. <%}%>
  89.     </table>
  90.       <br>
  91.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0">
  92.   <form name=form1 action="?op=add" method=post>
  93.      <tr>
  94.           <td width="47%" align="right">
  95.   <input type="hidden" name="scoreCode" value="<%=scoreCode%>">
  96.   <select name="boardCode" onChange="if(this.options[this.selectedIndex].value=='no'){alert('<lt:Label res="res.label.forum.admin.entrance" key="error_sel_field"/>'); this.selectedIndex=0;}">
  97.             <option value="" selected><lt:Label res="res.label.forum.admin.entrance" key="sel_board"/></option>
  98.             <%
  99. LeafChildrenCacheMgr dlcm = new LeafChildrenCacheMgr("root");
  100. java.util.Vector vt = dlcm.getChildren();
  101. ir = vt.iterator();
  102. while (ir.hasNext()) {
  103. leaf = (Leaf) ir.next();
  104. String parentCode = leaf.getCode();
  105. %>
  106.             <option style="BACKGROUND-COLOR: #f8f8f8" value="no">╋ <%=leaf.getName()%></option>
  107. <%
  108. LeafChildrenCacheMgr dl = new LeafChildrenCacheMgr(parentCode);
  109. v = dl.getChildren();
  110. Iterator ir1 = v.iterator();
  111. while (ir1.hasNext()) {
  112. Leaf lf = (Leaf) ir1.next();
  113. %>
  114.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=lf.getCode()%>"> ├『<%=lf.getName()%>』</option>
  115. <%if (lf.getChildCount()>0) {
  116. Vector vch = lf.getChildren();
  117. Iterator irch = vch.iterator();
  118. while (irch.hasNext()) {
  119. Leaf chlf = (Leaf)irch.next();
  120. %>
  121.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=chlf.getCode()%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ├『<%=chlf.getName()%>』</option>
  122. <%
  123. }
  124. }%>
  125.     <%}
  126. }%>
  127.           </select>
  128.           &nbsp;&nbsp;&nbsp;&nbsp;
  129.        </td>
  130.           <td width="4%" align="left">
  131.     </td>
  132.    <td width="49%" align="left"><input type=submit value="<lt:Label key="op_add"/>"></td>
  133.           </tr></form>
  134.       </table>
  135.       <br></td>
  136.   </tr>
  137. </table>
  138. </td> </tr>             
  139.       </table>                                        
  140.        </td>                                        
  141.      </tr>                                        
  142.  </table>                                        
  143.                                
  144. </body>                                        
  145. </html>                            
  146.