forum_statistic.jsp
Upload User: jhtang88
Upload Date: 2014-01-27
Package Size: 28528k
Code Size: 11k
Category:

Jsp/Servlet

Development Platform:

Java

  1. <%@ page contentType="text/html; charset=utf-8"%>
  2. <%@ page import="cn.js.fan.util.*"%>
  3. <%@ page import="cn.js.fan.db.*"%>
  4. <%@ page import="cn.js.fan.web.*"%>
  5. <%@ page import="cn.js.fan.module.pvg.*" %>
  6. <%@ page import="java.lang.*"%>
  7. <%@ page import="java.util.*"%>
  8. <%@ page import="com.redmoon.forum.ForumDb"%>
  9. <%@ page import="com.redmoon.forum.util.*"%>
  10. <%@ page import="com.redmoon.forum.person.*"%>
  11. <%@ taglib uri="/WEB-INF/tlds/LabelTag.tld" prefix="lt" %>
  12. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  13. <html xmlns="http://www.w3.org/1999/xhtml">
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  16. <title>论坛统计</title>
  17. <LINK href="default.css" type=text/css rel=stylesheet>
  18. <style type="text/css">
  19. <!--
  20. body {
  21. margin-left: 0px;
  22. margin-top: 0px;
  23. }
  24. .STYLE1 {color: #FF0000}
  25. .ttl { CURSOR: hand; COLOR: #ffffff; PADDING-TOP: 4px
  26. }
  27. -->
  28. </style>
  29. </head>
  30. <body bgcolor="#FFFFFF">
  31. <jsp:useBean id="privilege" scope="page" class="com.redmoon.forum.Privilege"/>
  32. <%
  33. if (!privilege.isMasterLogin(request)) {
  34.     out.print(cn.js.fan.web.SkinUtil.makeErrMsg(request, cn.js.fan.web.SkinUtil.LoadString(request, "pvg_invalid")));
  35. return;
  36. }
  37. ForumStatisticDb fsd = new ForumStatisticDb();
  38. int memberTotal = 0,addCount = 0,eliteCount = 0,userAddCount = 0,userEliteCount = 0,allCount = 0;
  39. memberTotal = fsd.getMemberTotal();
  40. addCount = fsd.getAddCount();
  41. eliteCount = fsd.getEliteCount(); 
  42. allCount = fsd.getAllCount();
  43. String op = ParamUtil.get(request,"op");
  44. if(op.equals("updateAllUser")){
  45. boolean re = false;
  46. try {
  47. re = fsd.save();
  48. }
  49. catch (ErrMsgException e) {
  50. out.print(e.getMessage());
  51. }
  52. if (re) {
  53. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_operate_success")));
  54. }
  55. else
  56. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  57. }
  58. if(op.equals("updateUser")){
  59. boolean re = false;
  60. String name = ParamUtil.get(request,"name");
  61. re = fsd.save(name);
  62. if (re) {
  63. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_operate_success")));
  64. }
  65. else
  66. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_fail")));
  67. }
  68. ForumDb fd = new ForumDb();
  69. fd = fd.getForumDb();
  70. if (op.equals("setInfo")) {
  71. Date createDate = DateUtil.parse(ParamUtil.get(request, "createDate"), "yyyy-MM-dd HH:mm:ss");
  72. int maxOnlineCount = ParamUtil.getInt(request, "maxOnlineCount");
  73. Date maxOnlineDate = DateUtil.parse(ParamUtil.get(request, "maxOnlineDate"), "yyyy-MM-dd HH:mm:ss");
  74. int topicCount = ParamUtil.getInt(request, "topicCount");
  75. int postCount = ParamUtil.getInt(request, "postCount");
  76. int yestodayCount = ParamUtil.getInt(request, "yestodayCount");
  77. int todayCount = ParamUtil.getInt(request, "todayCount");
  78. int maxCount = ParamUtil.getInt(request, "maxCount");
  79. Date maxDate = DateUtil.parse(ParamUtil.get(request, "maxDate"), "yyyy-MM-dd HH:mm:ss");
  80. fd.setCreateDate(createDate);
  81. fd.setMaxOnlineCount(maxOnlineCount);
  82. fd.setMaxOnlineDate(maxOnlineDate);
  83. fd.setTopicCount(topicCount);
  84. fd.setPostCount(postCount);
  85. fd.setYestodayCount(yestodayCount);
  86. fd.setTodayCount(todayCount);
  87. fd.setMaxCount(maxCount);
  88. fd.setMaxDate(maxDate);
  89. if (fd.save())
  90. out.print(StrUtil.Alert(SkinUtil.LoadString(request, "info_op_success")));
  91. else
  92. out.print(StrUtil.Alert_Back(SkinUtil.LoadString(request, "info_op_fail")));
  93. }
  94. fd = ForumDb.getInstance();
  95. %>
  96. <TABLE cellSpacing=0 cellPadding=0 width="100%">
  97.   <TBODY>
  98.     <TR>
  99.       <TD class=head>
  100.         <lt:Label res="res.label.forum.admin.forum_statistic" key="forum_statistic"/>
  101.       </TD>
  102.     </TR>
  103.   </TBODY>
  104. </TABLE>
  105. <br>
  106. <FORM METHOD=POST id="form1" name="form1" ACTION='?op=updateAllUser'>
  107. <table width="80%" 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" >
  108.   <tr> 
  109.     <td width="100%" height="23" class="thead">
  110.       <lt:Label res="res.label.forum.admin.forum_statistic" key="user_post_statistic"/>
  111.     </td>
  112.   </tr>
  113.   <tr> 
  114.     <td>
  115.       <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
  116.           <tr> 
  117.             <td bgcolor=#F6F6F6 width='20%'>
  118.               <lt:Label res="res.label.forum.admin.forum_statistic" key="user_count"/>
  119.             <%=memberTotal%></td>
  120.             <td bgcolor=#F6F6F6 width='20%'><lt:Label res="res.label.forum.admin.forum_statistic" key="topic_count"/>
  121.             <%=addCount%></td>
  122.             <td bgcolor=#F6F6F6 width='20%'><lt:Label res="res.label.forum.admin.forum_statistic" key="post_count"/>
  123.             <%=allCount%></td>
  124.             <td width="20%" bgcolor=#F6F6F6><lt:Label res="res.label.forum.admin.forum_statistic" key="elite_count"/>
  125.             <%=eliteCount%></td>
  126.             <td width="20%" align=center bgcolor=#F6F6F6><input type=submit value='<lt:Label res="res.label.forum.admin.forum_statistic" key="count_again"/>'/></td>
  127.           </tr>
  128.       </table>    </td>
  129.   </tr>
  130.   <tr class=row style="BACKGROUND-COLOR: #fafafa">
  131.     <td valign="top" bgcolor="#FFFFFF" class="thead">&nbsp;</td>
  132.   </tr>
  133. </table>
  134. </FORM>
  135. <br>
  136. <br>
  137. <FORM METHOD=POST id="form2" name="form2" ACTION='?op=search'>
  138. <table width="80%" 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" >
  139.   <tr> 
  140.     <td width="100%" height="23" class="thead"><lt:Label res="res.label.forum.admin.forum_statistic" key="user_statistic"/></td>
  141.   </tr>
  142.   <tr> 
  143.     <td>
  144.       <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
  145.           <tr> 
  146.             <td bgcolor=#F6F6F6 width='10%' align="center"><lt:Label res="res.label.forum.admin.forum_statistic" key="user_name"/></td>
  147.             <td bgcolor=#F6F6F6 width='24%'><input type=text value="" name="nick"></td>
  148. <td width="66%" align=left bgcolor=#F6F6F6><input type="submit" value='<lt:Label res="res.label.forum.admin.forum_statistic" key="count_again"/>'/></td>
  149.           </tr>
  150.       </table>    </td>
  151.   </tr>
  152.   <tr class=row style="BACKGROUND-COLOR: #fafafa">
  153.     <td valign="top" bgcolor="#FFFFFF" class="thead">&nbsp;</td>
  154.   </tr>
  155. </table>
  156. </FORM>
  157. <br>
  158. <br>
  159. <FORM METHOD=POST id="form3" name="form3" ACTION='?op=updateUser'>
  160. <table style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid" cellSpacing="0" cellPadding="3" width="80%" align="center">
  161.   <tbody>
  162.     <tr>
  163.       <td class="thead" style="PADDING-LEFT: 10px" noWrap width="20%"><lt:Label res="res.label.forum.admin.forum_statistic" key="user_name"/></td>
  164.       <td width="22%" noWrap class="thead" style="PADDING-LEFT: 10px"><img src="images/tl.gif" align="absMiddle" width="10" height="15">
  165.         <lt:Label res="res.label.forum.admin.forum_statistic" key="user_topic"/></td>
  166.       <td width="29%" noWrap class="thead" style="PADDING-LEFT: 10px"><img src="images/tl.gif" align="absMiddle" width="10" height="15">
  167.         <lt:Label res="res.label.forum.admin.forum_statistic" key="user_elite"/></td>
  168.       <td width="29%" noWrap class="thead" style="PADDING-LEFT: 10px">&nbsp;</td>
  169.     </tr>
  170. <%
  171. String name = "";
  172. String nick = ParamUtil.get(request,"nick");
  173. if(op.equals("search")){
  174. if(!nick.equals("")){
  175. UserDb ud = new UserDb();
  176. ud = ud.getUserDbByNick(nick);
  177. if(ud != null){
  178. name = ud.getName();
  179. userAddCount = fsd.getAddCount(name);
  180. userEliteCount = fsd.getEliteCount(name);
  181. %>
  182.     <tr>
  183.       <td bgcolor=#F6F6F6 width="20%"><%=nick%></td>
  184.       <td width="22%" bgcolor=#F6F6F6><%=userAddCount%></td>
  185.       <td width="29%" bgcolor=#F6F6F6><%=userEliteCount%></td>
  186.       <td width="29%" bgcolor=#F6F6F6><input type="submit" value='<lt:Label res="res.label.forum.admin.forum_statistic" key="count_again"/>'/>
  187.       <input type="hidden" name="name" value="<%=name%>"/></td>
  188.     </tr>
  189. <%
  190. }else{
  191. %>
  192.     <tr>
  193.       <td colspan="4" bgcolor=#F6F6F6><lt:Label res="res.label.forum.admin.forum_statistic" key="user_none"/>
  194.         !</td>
  195.     </tr>
  196. <%
  197. }
  198. }
  199. }
  200. %>
  201.   </tbody>
  202. </table>
  203. </FORM>
  204. <br />
  205. <table width="80%" border="0" align="center" cellpadding="3" cellspacing="0" bgcolor="#FFFFFF" style="BORDER-RIGHT: #a6a398 1px solid; BORDER-TOP: #a6a398 1px solid; BORDER-LEFT: #a6a398 1px solid; BORDER-BOTTOM: #a6a398 1px solid">
  206.   <form action="?op=setInfo" method="post" name="form6" id="form6">
  207.     <tr>
  208.       <td height="26" colspan="2" align="left" class="thead">&nbsp;</td>
  209.     </tr>
  210.     <tr>
  211.       <td width="26%" height="26" align="left"><lt:Label res="res.label.forum.index" key="create_date"/></td>
  212.       <td width="74%" align="left"><input name="createDate" value="<%=com.redmoon.forum.ForumSkin.formatDateTime(request, fd.getCreateDate())%>" /></td>
  213.     </tr>
  214.     <tr>
  215.       <td height="22" align="left"><lt:Label res="res.label.forum.index" key="online_max_count"/></td>
  216.       <td height="22" align="left"><input name="maxOnlineCount" value="<%=fd.getMaxOnlineCount()%>" /></td>
  217.     </tr>
  218.     <tr>
  219.       <td height="22" align="left"><lt:Label res="res.label.forum.index" key="online_max_date"/></td>
  220.       <td height="22" align="left"><input name="maxOnlineDate" value="<%=com.redmoon.forum.ForumSkin.formatDateTime(request, fd.getMaxOnlineDate())%>" /></td>
  221.     </tr>
  222.     <tr>
  223.       <td height="22" align="left"><lt:Label res="res.label.forum.index" key="topic_count"/></td>
  224.       <td height="22" align="left"><input name="topicCount" value="<%=fd.getTopicCount()%>" /></td>
  225.     </tr>
  226.     <tr>
  227.       <td height="22" align="left"><lt:Label res="res.label.forum.index" key="post_count"/></td>
  228.       <td height="22" align="left"><input name="postCount" value="<%=fd.getPostCount()%>" /></td>
  229.     </tr>
  230.     <tr>
  231.       <td height="22" align="left"><lt:Label res="res.label.forum.index" key="yestoday_post"/></td>
  232.       <td height="22" align="left"><input name="yestodayCount" value="<%=fd.getYestodayCount()%>" /></td>
  233.     </tr>
  234.     <tr>
  235.       <td height="22" align="left"><lt:Label res="res.label.forum.index" key="today_post"/></td>
  236.       <td height="22" align="left"><input name="todayCount" value="<%=fd.getTodayCount()%>" /></td>
  237.     </tr>
  238.     <tr>
  239.       <td height="22" align="left"><lt:Label res="res.label.forum.index" key="most_post"/></td>
  240.       <td height="22" align="left"><input name="maxCount" value="<%=fd.getMaxCount()%>" /></td>
  241.     </tr>
  242.     <tr>
  243.       <td height="22" align="left"><lt:Label res="res.label.forum.index" key="most_post_date"/></td>
  244.       <td height="22" align="left"><input name="maxDate" value="<%=com.redmoon.forum.ForumSkin.formatDateTime(request, fd.getMaxDate())%>" /></td>
  245.     </tr>
  246.     <tr>
  247.       <td height="28" colspan="2" align="center"><input name="submit22" type="submit" value="<lt:Label key="ok"/>" /></td>
  248.     </tr>
  249.   </form>
  250. </table>
  251. </body>
  252. </html>