📄 month_tj1.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>
<% //连接数据库取出1号到30号的访问记录;
int act[]=new int[31];
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;
rs=stmt.executeQuery(sql);
rs.next();
act[k]=rs.getInt(1);
};
stmt.close();
con.close();
%>
<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"> ∷∷∷ 所有月份日访问量 ∷∷∷<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[0]=act[0];
int maxcount=0;
int allcount=0;
for(int i=0;i<29;i++){
temp[2]=act[i]+temp[2];
temp[1]=act[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)act[i]/maxcount*100%>" width="9" alt="访问:<%=act[i]%>次,<% float disa=(float)act[i]/allcount*100; %><%=(int)disa%>%"></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>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -