📄 month_tj.jsp
字号:
<%
/*
╭═══════════════╮
║ ║
╭══════┤ 海量统计统计系统 ├══════╮
║ ║ ║ ║
║ ╰═══════════════╯ ║
║ ║
║ 系统1.0版(JSP) ║
║ ║
║ ║
║ 程序作者:小磊 ║
║ ║
║ QQ:6404040 ║
║ E-Mail:kkg365@21cn.com ║
║ 网站:http://kkg365.cn.st ║
║ ║
║ ╭───────────────────────╮ ║
╰══┤ 小磊在线 ├══╯
╰───────────────────────╯
*/
%>
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*;" errorPage="" %>
<jsp:useBean id="tj_day" scope="page" class="sds.count"/>
<html>
<head>
<title>海量计数-月统计</title>
<link rel="stylesheet" href="css.css">
</head>
<body>
<%@include file="head.jsp"%>
<br>
<% //连接数据库取出1号到30号的访问记录;
int ct[]=new int[31];
int month;
if(request.getParameter("m")==null){
month=Integer.parseInt(tj_day.getmonth());}
else{
month=Integer.parseInt(request.getParameter("m"));
};
ResultSet rs;
Connection con=tj_day.getconn();
Statement stmt=con.createStatement();
for(int k=0;k<=30;k++){
String sql="select count(*) from vcount where day="+k+"and month="+month;
rs=stmt.executeQuery(sql);
rs.next();
ct[k]=rs.getInt(1);
};
stmt.close();
con.close();
%>
<table width=500 cellspacing=0 align=center>
<tr><td>
<p style="line-height: 100%; margin-left: 15; margin-top: 5; margin-bottom: 0">
Tips: 用鼠标点指图形柱可以看到对应的访问量,点击月份可以看到相应的月份统计。</p>
</td></tr>
</table>
<br>
<table width="500" cellspacing="0" align="center" cellpadding="0" border="0">
<tr>
<td colspan="3"><img src="images/photoup.gif" width="500" height="10"></td>
</tr>
<tr height="30">
<td width="1" bgcolor="#164DF9"></td>
<td width="498" bgcolor="D1DBFA"> ∷∷∷ <%= month %>月份31天的日访问量 ∷∷∷<br> <table border="0" cellpadding="0" cellspacing="0" width="453" align=center>
<tr height="9">
<td></td>
</tr>
<tr height="101">
<td align=right valign=top> <p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13">
<%//计算出最大的访问量,在统计图中显示4等份;和总共的访问量;
int temp[]=new int[3];
temp[2]=0;
temp[0]=ct[0];
int maxcount=0;
int allcount=0;
for(int i=0;i<29;i++){
temp[2]=ct[i]+temp[2];
temp[1]=ct[i+1];
if(temp[0]<temp[1]){
temp[0]=temp[1];
maxcount=temp[0];}
allcount=temp[2];
} %><%= maxcount %>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13"><%= maxcount*3/4 %>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 13"><%= maxcount/2 %>
<p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 0"><%= maxcount*1/4 %>
<font face="Arial"><br>
</font></td>
<td width=10><img src="images/tu_back_left.gif"></td>
<% //显示统计图的长度(百分比);
for(int i=0;i<=30;i++){
%>
<td width=13 valign=bottom background="images/tu_back.gif" align=center>
<img src="images/tu.gif" height="<%= (float)ct[i]/maxcount*100%>" width="9" alt="访问:<%=ct[i]%>次,<% float dis=(float)ct[i]/allcount*100; %><%=(int)dis%>%"></td>
<% } %>
<td width=10><img src="images/tu_back_right.gif"></td>
<td width=10></td>
</tr>
<tr>
<td align=right> <p style="line-height: 100%; margin-right: 2; margin-top: 0; margin-bottom: 0">
<font face="Arial">0</font></td>
<td width=10></td>
<%//显示12月份;
for(int j=0;j<=31;j++){%>
<td width=13 align=center><%= j %>
</td>
<% } %>
<td width=10></td>
<td width=10></td>
</tr>
<tr height="5">
<td></td>
</tr>
</table></td>
<td width="1" bgcolor="#164DF9"></td>
</tr>
<tr>
<td colspan="4"><img src="images/photodown.gif" width="500" height="10"></td>
</tr>
</table>
<table width="65%" height="19" border="0" align="center">
<tr>
<td>月份:<% for(int d=1;d<=12;d++){ %><a href="month_tj.jsp?m=<%= d %>"><%= d %>月</a> <% } %></td>
</tr>
</table>
<jsp:include page="month_tj1.jsp" flush="false"/>
<jsp:include page="bottom.jsp" flush="false"/>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -