entranceVIPTeach.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.db.*"%>
  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. <jsp:useBean id="StrUtil" scope="page" class="cn.js.fan.util.StrUtil"/>
  9. <html><head>
  10. <meta http-equiv="pragma" content="no-cache">
  11. <link rel="stylesheet" href="../../common.css">
  12. <LINK href="default.css" type=text/css rel=stylesheet>
  13. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>插件管理</title>
  16. <script language="JavaScript">
  17. <!--
  18. //-->
  19. </script>
  20. <body bgcolor="#FFFFFF" topmargin='0' leftmargin='0'>
  21. <jsp:useBean id="privilege" scope="page" class="cn.js.fan.module.pvg.Privilege"/>
  22. <%
  23. if (!privilege.isUserPrivValid(request, "forum.plugin"))
  24. {
  25. out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  26. return;
  27. }
  28. String op = ParamUtil.get(request, "op");
  29. if (op.equals("add")) {
  30. String boardCode = ParamUtil.get(request, "boardCode");
  31. if (!boardCode.equals("")) {
  32. String entranceCode = VIPTeachEntrance.CODE;
  33. BoardEntranceDb be = new BoardEntranceDb();
  34. be.setBoardCode(boardCode);
  35. be.setEntranceCode(entranceCode);
  36. if (be.create()) {
  37. out.print(StrUtil.Alert("添加成功!"));
  38. }
  39. else
  40. out.print(StrUtil.Alert("添加失败,请检查版块是否已被加入!"));
  41. }
  42. }
  43. if (op.equals("del")) {
  44. String boardCode = ParamUtil.get(request, "boardCode");
  45. String entranceCode = VIPTeachEntrance.CODE;
  46. BoardEntranceDb be = new BoardEntranceDb();
  47. be = be.getBoardEntranceDb(boardCode, entranceCode);
  48. if (be.del()) {
  49. out.print(StrUtil.Alert("删除成功!"));
  50. }
  51. else
  52. out.print(StrUtil.Alert("删除失败!"));
  53. }
  54. if (op.equals("deluser")) {
  55. String id = ParamUtil.get(request, "id");
  56. VIPCardDb be = new VIPCardDb();
  57. be = be.getVIPCardDb(id);
  58. if (be.del()) {
  59. out.print(StrUtil.Alert("删除成功!"));
  60. }
  61. else
  62. out.print(StrUtil.Alert("删除失败!"));
  63. }
  64. %>
  65. <table width='100%' cellpadding='0' cellspacing='0' >
  66.   <tr>
  67.     <td class="head">管理插件-版主进入方式插件</td>
  68.   </tr>
  69. </table>
  70. <br>
  71. <table width="98%" height="227" border='0' align="center" cellpadding='0' cellspacing='0' class="frame_gray">
  72.   <tr> 
  73.     <td height=20 align="left" class="thead">管理 - 进入方式插件 </td>
  74.   </tr>
  75.   <tr> 
  76.     <td valign="top"><br>
  77.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFBFF" class="tableframe_gray">
  78.       <tr align="center">
  79.         <td width="13%" height="22">版面编码</td>
  80.       <td width="23%" height="22">版面名称</td>
  81.         <td width="30%">进入方式插件</td>
  82.         <td width="34%" height="22">操作</td>
  83.       </tr>
  84. <%
  85. BoardEntranceDb br = new BoardEntranceDb();
  86. Vector v = br.list(VIPTeachEntrance.CODE);
  87. Iterator ir = v.iterator();
  88. Leaf leaf = new Leaf();
  89. while (ir.hasNext()) {
  90. BoardEntranceDb sb = (BoardEntranceDb)ir.next();
  91. leaf = leaf.getLeaf(sb.getBoardCode());
  92. %>
  93.       <tr align="center">
  94.         <td height="22"><%=leaf.getCode()%></td>
  95.       <td height="22"><%=leaf.getName()%></td>
  96.         <td>付费用户准入</td>
  97.         <td height="22"><a href="?op=del&boardCode=<%=StrUtil.UrlEncode(leaf.getCode())%>&entranceCode=<%=StrUtil.UrlEncode(sb.getEntranceCode())%>">删除</a></td>
  98.       </tr>
  99. <%}%>   
  100.     </table>
  101.       <br>
  102.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="0">
  103.   <form name=form1 action="?op=add" method=post>
  104.           <tr>
  105.           <td width="53%" align="right">
  106.   <select name="boardCode" onChange="if(this.options[this.selectedIndex].value=='no'){alert('您选择的是区域,请选择版块!'); this.selectedIndex=0;}">
  107.             <option value="" selected>请选择版块</option>
  108.             <%
  109. LeafChildrenCacheMgr dlcm = new LeafChildrenCacheMgr("root");
  110. java.util.Vector vt = dlcm.getChildren();
  111. ir = vt.iterator();
  112. while (ir.hasNext()) {
  113. leaf = (Leaf) ir.next();
  114. String parentCode = leaf.getCode();
  115. %>
  116.             <option style="BACKGROUND-COLOR: #f8f8f8" value="no">╋ <%=leaf.getName()%></option>
  117. <%
  118. LeafChildrenCacheMgr dl = new LeafChildrenCacheMgr(parentCode);
  119. v = dl.getChildren();
  120. Iterator ir1 = v.iterator();
  121. while (ir1.hasNext()) {
  122. Leaf lf = (Leaf) ir1.next();
  123. %>
  124.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=lf.getCode()%>"> ├『<%=lf.getName()%>』</option>
  125. <%if (lf.getChildCount()>0) {
  126. Vector vch = lf.getChildren();
  127. Iterator irch = vch.iterator();
  128. while (irch.hasNext()) {
  129. Leaf chlf = (Leaf)irch.next();
  130. %>
  131.             <option style="BACKGROUND-COLOR: #eeeeee" value="<%=chlf.getCode()%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ├『<%=chlf.getName()%>』</option>
  132. <%
  133. }
  134. }%>
  135.     <%}
  136. }%>
  137.           </select>
  138. &nbsp;&nbsp;&nbsp;&nbsp;        </td>
  139.           <td width="47%" align="left">     <input type=submit value="添加版块">
  140. &nbsp;&nbsp;<input type="button" onClick="window.location.href='VIPCard_add.jsp'" value=" 添加点卡 "></td>
  141.       </tr></form>
  142.       </table>
  143.       <%
  144. int pagesize = 10;
  145. Paginator paginator = new Paginator(request);
  146. VIPCardDb vtu = new VIPCardDb();
  147. String sql = "select id from " + vtu.getTableName() + " order by beginDate desc";
  148. int total = vtu.getObjectCount(sql);
  149. paginator.init(total, pagesize);
  150. int curpage = paginator.getCurPage();
  151. //设置当前页数和总页数
  152. int totalpages = paginator.getTotalPages();
  153. if (totalpages==0)
  154. {
  155. curpage = 1;
  156. totalpages = 1;
  157. }
  158. %>
  159.       <table width="86%" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
  160.         <tr>
  161.           <td align="right"><div>找到符合条件的记录 <b><%=paginator.getTotal() %></b> 条 每页显示 <b><%=paginator.getPageSize() %></b> 条 页次 <b><%=paginator.getCurrentPage() %>/<%=paginator.getTotalPages() %></b></div></td>
  162.         </tr>
  163.       </table>
  164.       <table width="86%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#666666" class="tableframe_gray">
  165.         <tr align="center" bgcolor="#F1EDF3">
  166.           <td width="10%">卡号</td>
  167.           <td width="8%" height="22">用户名</td>
  168.           <td width="12%" height="22">开始日期</td>
  169.           <td width="18%" height="22">结束日期</td>
  170.           <td width="17%">费用</td>
  171.           <td width="21%">状态</td>
  172.           <td width="14%">操作</td>
  173.         </tr>
  174.         <%
  175. Vector vth = vtu.list(sql, (curpage-1)*pagesize, curpage*pagesize-1);
  176. Iterator irt = vth.iterator();
  177. int i = 0;
  178. while (irt.hasNext()) {
  179. vtu = (VIPCardDb)irt.next();
  180. i++;
  181. %>
  182.         <form id="form<%=i%>" name="form<%=i%>" action="?op=modify" method="post">
  183.           <tr align="center">
  184.             <td bgcolor="#FFFFFF"><%=vtu.getId()%></td>
  185.             <td height="22" bgcolor="#FFFFFF"><%=vtu.getUserName()%> </td>
  186.             <td height="22" bgcolor="#FFFFFF"><%=vtu.getBeginDate()%></td>
  187.             <td height="22" bgcolor="#FFFFFF"><%=vtu.getEndDate()%> </td>
  188.             <td bgcolor="#FFFFFF"><%=cn.js.fan.util.NumberUtil.roundRMB(vtu.getFee())%></td>
  189.             <td bgcolor="#FFFFFF"><%=vtu.isValid()?"启用":"未启用"%></td>
  190.             <td height="22" bgcolor="#FFFFFF"><a href="VIPCard_edit.jsp?id=<%=vtu.getId()%>">编辑</a>&nbsp;&nbsp;<a href="#" onClick="if (confirm('您确定要删除吗?')) window.location.href='?op=deluser&id=<%=vtu.getId()%>'">删除</a></td>
  191.           </tr>
  192.         </form>
  193.         <%}%>
  194.       </table>
  195.       <table width="86%" border="0" cellspacing="1" cellpadding="3" align="center" class="9black">
  196.         <tr>
  197.           <td height="23"><div align="right">
  198.               <%
  199. String querystr = "op=" + op;
  200.     out.print(paginator.getCurPageBlock("?"+querystr));
  201. %>
  202.           </div></td>
  203.         </tr>
  204.       </table></td>
  205.       </tr>
  206.       </table>
  207.       </td>
  208.       </tr>
  209.       </table></td>
  210.   </tr>
  211. </table>
  212. </td> </tr>             
  213.       </table>                                        
  214.        </td>                                        
  215.      </tr>                                        
  216.  </table>                                        
  217.                                
  218. </body>                                        
  219. </html>                            
  220.