📄 backreport.jsp
字号:
<%
/*##################################################################**
**# 项目名称:LyNews『凌云新闻』 #**
**# #**
**# 程序开发: teddy 『星语凌』 #**
**# #**
**# 版权所有: 凌云创作室 (原流星电脑工作室) #**
**# #**
**# 主页地址: http://www.lybbs.com #**
**# http://www.lybbs.net #**
**# 电邮地件: horseye@sina.com #**
**# #**
**##################################################################*/
%>
<%@include file="config.jsp"%>
<%@include file="getsession.jsp"%>
<%@page contentType="text/html;charset=GBK"%>
<%
int refreshTime=600;//刷新时间,单位:秒(s)
response.setHeader("Refresh",String.valueOf(refreshTime));
int reportWidth=1;//1-1~100人访问报表 10-10~1000人 100-100~10000人
ParameterUtils.setCharacterEncoding(request);
int boardID=ParameterUtils.getInt(request,"boardID");
String today = GetDate.getStringDateShort();
String today_long = GetDate.getStringDateLong();
ClassCounterFactory classCounterFactory = new ClassCounterFactory();
if(classCounterFactory.queryTodayCount(today)==0) {
classCounterFactory.update(today);
}
ClassCounter classCounter=new ClassCounter();
if(boardID==0) {
classCounter=classCounterFactory.getSumMsg(today);
}
else {
classCounterFactory.setClassID(boardID);
classCounter=classCounterFactory.getMsg();
}
int totalTimes=classCounter.getTotalTimes();
int todayTimes=classCounter.getTodayTimes();
int yesterdayTimes=classCounter.getYesterdayTimes();
int hour0=classCounter.getHour0(),
hour1=classCounter.getHour1(),
hour2=classCounter.getHour2(),
hour3=classCounter.getHour3(),
hour4=classCounter.getHour4(),
hour5=classCounter.getHour5(),
hour6=classCounter.getHour6(),
hour7=classCounter.getHour7(),
hour8=classCounter.getHour8(),
hour9=classCounter.getHour9(),
hour10=classCounter.getHour10(),
hour11=classCounter.getHour11(),
hour12=classCounter.getHour12(),
hour13=classCounter.getHour13(),
hour14=classCounter.getHour14(),
hour15=classCounter.getHour15(),
hour16=classCounter.getHour16(),
hour17=classCounter.getHour17(),
hour18=classCounter.getHour18(),
hour19=classCounter.getHour19(),
hour20=classCounter.getHour20(),
hour21=classCounter.getHour21(),
hour22=classCounter.getHour22(),
hour23=classCounter.getHour23();
String imgLength0=(hour0==0?0:(hour0/reportWidth<1?1:(hour0>reportWidth*100?100:hour0/reportWidth)))+"%",
imgLength1=(hour1==0?0:(hour1/reportWidth<1?1:(hour1>reportWidth*100?100:hour1/reportWidth)))+"%",
imgLength2=(hour2==0?0:(hour2/reportWidth<1?1:(hour2>reportWidth*100?100:hour2/reportWidth)))+"%",
imgLength3=(hour3==0?0:(hour3/reportWidth<1?1:(hour3>reportWidth*100?100:hour3/reportWidth)))+"%",
imgLength4=(hour4==0?0:(hour4/reportWidth<1?1:(hour4>reportWidth*100?100:hour4/reportWidth)))+"%",
imgLength5=(hour5==0?0:(hour5/reportWidth<1?1:(hour5>reportWidth*100?100:hour5/reportWidth)))+"%",
imgLength6=(hour6==0?0:(hour6/reportWidth<1?1:(hour6>reportWidth*100?100:hour6/reportWidth)))+"%",
imgLength7=(hour7==0?0:(hour7/reportWidth<1?1:(hour7>reportWidth*100?100:hour7/reportWidth)))+"%",
imgLength8=(hour8==0?0:(hour8/reportWidth<1?1:(hour8>reportWidth*100?100:hour8/reportWidth)))+"%",
imgLength9=(hour9==0?0:(hour9/reportWidth<1?1:(hour9>reportWidth*100?100:hour9/reportWidth)))+"%",
imgLength10=(hour10==0?0:(hour10/reportWidth<1?1:(hour10>reportWidth*100?100:hour10/reportWidth)))+"%",
imgLength11=(hour11==0?0:(hour11/reportWidth<1?1:(hour11>reportWidth*100?100:hour11/reportWidth)))+"%",
imgLength12=(hour12==0?0:(hour12/reportWidth<1?1:(hour12>reportWidth*100?100:hour12/reportWidth)))+"%",
imgLength13=(hour13==0?0:(hour13/reportWidth<1?1:(hour13>reportWidth*100?100:hour13/reportWidth)))+"%",
imgLength14=(hour14==0?0:(hour14/reportWidth<1?1:(hour14>reportWidth*100?100:hour14/reportWidth)))+"%",
imgLength15=(hour15==0?0:(hour15/reportWidth<1?1:(hour15>reportWidth*100?100:hour15/reportWidth)))+"%",
imgLength16=(hour16==0?0:(hour16/reportWidth<1?1:(hour16>reportWidth*100?100:hour16/reportWidth)))+"%",
imgLength17=(hour17==0?0:(hour17/reportWidth<1?1:(hour17>reportWidth*100?100:hour17/reportWidth)))+"%",
imgLength18=(hour18==0?0:(hour18/reportWidth<1?1:(hour18>reportWidth*100?100:hour18/reportWidth)))+"%",
imgLength19=(hour19==0?0:(hour19/reportWidth<1?1:(hour19>reportWidth*100?100:hour19/reportWidth)))+"%",
imgLength20=(hour20==0?0:(hour20/reportWidth<1?1:(hour20>reportWidth*100?100:hour20/reportWidth)))+"%",
imgLength21=(hour21==0?0:(hour21/reportWidth<1?1:(hour21>reportWidth*100?100:hour21/reportWidth)))+"%",
imgLength22=(hour22==0?0:(hour22/reportWidth<1?1:(hour22>reportWidth*100?100:hour22/reportWidth)))+"%",
imgLength23=(hour23==0?0:(hour23/reportWidth<1?1:(hour23>reportWidth*100?100:hour23/reportWidth)))+"%";
%>
<HTML>
<HEAD>
<TITLE>后台报表即时生成</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="../inc/admin.css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
function reportResult() {
var reportValue=document.form.report.value;
if(reportValue=="")
window.alert("错误:不能生成一级栏目的报表!");
else {
location.href="backReport.jsp?boardID="+reportValue;
}
}
</script>
</HEAD>
<body>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align=center class="tableBorder">
<tr>
<th height=24><B>后台报表数据即时生成(每<%=refreshTime%>秒自动刷新一次)</th>
</tr>
<tr>
<form name=form>
<td>
<select name=report>
<option value="0">综合数据统计</option>
<%
Factory factory = Factory.getInstance();
BoardFactory boardFactory = factory.getBoardFactory();
Iterator boardParentIterator=boardFactory.listParent();
while(boardParentIterator.hasNext()) {
Board boardParent = (Board)boardParentIterator.next();
Iterator boardIterator=boardFactory.list(boardParent.getID());
out.println("<option value=''>>>"+boardParent.getBoardName()+"<<</option>");
while(boardIterator.hasNext()) {
Board board = (Board)boardIterator.next();
if(boardID==board.getID())
out.println("<option value='"+board.getID()+"' selected>"+board.getBoardName()+"</option>");
else
out.println("<option value='"+board.getID()+"'>"+board.getBoardName()+"</option>");
}
}
%>
</select>
<input type=button value="生成" onClick="reportResult()">
</td>
</form>
</tr>
</table>
<table width="95%" border="0" cellspacing="1" cellpadding="3" align=center class="tableBorder">
<tr>
<td colspan=2 class="forumrow">生成时间:<font color=#ff0000><%=today_long%></font> 截止目前总访问人数:<font color=#ff0000><%=totalTimes%></font> 今天访问人数:<font color=#ff0000><%=todayTimes%></font> 昨天访问人数:<font color=#ff0000><%=yesterdayTimes%></font></td>
</tr>
<tr>
<td width=8% class="forumrow" align=center>时段</td>
<td class="forumrow" align=center>访问人数</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>0~1</td>
<td class="forumrow"><img src=../images/bar1.gif width=<%=imgLength0%> height=10>(<font color=#ff0000><%=hour0%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>1~2</td>
<td class="forumrow"><img src=../images/bar2.gif width=<%=imgLength1%> height=10>(<font color=#ff0000><%=hour1%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>2~3</td>
<td class="forumrow"><img src=../images/bar3.gif width=<%=imgLength2%> height=10>(<font color=#ff0000><%=hour2%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>3~4</td>
<td class="forumrow"><img src=../images/bar4.gif width=<%=imgLength3%> height=10>(<font color=#ff0000><%=hour3%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>4~5</td>
<td class="forumrow"><img src=../images/bar5.gif width=<%=imgLength4%> height=10>(<font color=#ff0000><%=hour4%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>5~6</td>
<td class="forumrow"><img src=../images/bar6.gif width=<%=imgLength5%> height=10>(<font color=#ff0000><%=hour5%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>6~7</td>
<td class="forumrow"><img src=../images/bar7.gif width=<%=imgLength6%> height=10>(<font color=#ff0000><%=hour6%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>7~8</td>
<td class="forumrow"><img src=../images/bar8.gif width=<%=imgLength7%> height=10>(<font color=#ff0000><%=hour7%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>8~9</td>
<td class="forumrow"><img src=../images/bar9.gif width=<%=imgLength8%> height=10>(<font color=#ff0000><%=hour8%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>9~10</td>
<td class="forumrow"><img src=../images/bar10.gif width=<%=imgLength9%> height=10>(<font color=#ff0000><%=hour9%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>10~11</td>
<td class="forumrow"><img src=../images/bar1.gif width=<%=imgLength10%> height=10>(<font color=#ff0000><%=hour10%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>11~12</td>
<td class="forumrow"><img src=../images/bar2.gif width=<%=imgLength11%> height=10>(<font color=#ff0000><%=hour11%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>12~13</td>
<td class="forumrow"><img src=../images/bar3.gif width=<%=imgLength12%> height=10>(<font color=#ff0000><%=hour12%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>13~14</td>
<td class="forumrow"><img src=../images/bar4.gif width=<%=imgLength13%> height=10>(<font color=#ff0000><%=hour13%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>14~15</td>
<td class="forumrow"><img src=../images/bar5.gif width=<%=imgLength14%> height=10>(<font color=#ff0000><%=hour14%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>15~16</td>
<td class="forumrow"><img src=../images/bar6.gif width=<%=imgLength15%> height=10>(<font color=#ff0000><%=hour15%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>16~17</td>
<td class="forumrow"><img src=../images/bar7.gif width=<%=imgLength16%> height=10>(<font color=#ff0000><%=hour16%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>17~18</td>
<td class="forumrow"><img src=../images/bar8.gif width=<%=imgLength17%> height=10>(<font color=#ff0000><%=hour17%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>18~19</td>
<td class="forumrow"><img src=../images/bar9.gif width=<%=imgLength18%> height=10>(<font color=#ff0000><%=hour18%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>19~20</td>
<td class="forumrow"><img src=../images/bar10.gif width=<%=imgLength19%> height=10>(<font color=#ff0000><%=hour19%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>20~21</td>
<td class="forumrow"><img src=../images/bar1.gif width=<%=imgLength20%> height=10>(<font color=#ff0000><%=hour20%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>21~22</td>
<td class="forumrow"><img src=../images/bar2.gif width=<%=imgLength21%> height=10>(<font color=#ff0000><%=hour21%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>22~23</td>
<td class="forumrow"><img src=../images/bar3.gif width=<%=imgLength22%> height=10>(<font color=#ff0000><%=hour22%>人</font>)</td>
</tr>
<tr>
<td width=5% class="forumrow" align=center>23~24</td>
<td class="forumrow"><img src=../images/bar4.gif width=<%=imgLength23%> height=10>(<font color=#ff0000><%=hour23%>人</font>)</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -