⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.jsp

📁 用jsp+javebean+access编写的 页面和阿江(ASP)写的记数器很象
💻 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="allc" scope="page" class="sds.count"/>
<html>
<head>
<title>海量统计</title>
</head>
<link rel="stylesheet" href="css.css">
<body>
<%@ include file="config.jsp"%>
<%@include file="head.jsp"%>
<%
//取得现在的时间、日期、年月
int day=Integer.parseInt(allc.getday()),
    year=Integer.parseInt(allc.getyear()),
	month=Integer.parseInt(allc.getmonth()),
    yday=day-1;
//定义查询语句
String sql="select count(*) from vcount";
String sql1="select count(*) from vcount where day="+day+"and year="+year;
String sql2="select count(*) from vcount where day="+yday+"and year="+year;
String sql3="select count(*) from vcount where year="+year;
String sql4="select count(*) from vcount where month="+month+"and year="+year;
String sql5="select day,time from vcount";
	  
//建立statement	   
Connection con=allc.getconn();
Statement stmt=con.createStatement(),
          stmt1=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
//总访问量
ResultSet rs=stmt.executeQuery(sql);
rs.next();
int allcount=rs.getInt(1);

//今天的访问量
rs=stmt.executeQuery(sql1);
rs.next();
int todaycount=rs.getInt(1);
//昨天的访问量
rs=stmt.executeQuery(sql2);
rs.next();
int yesdaycount=rs.getInt(1);
//本年的访问量
rs=stmt.executeQuery(sql3);
rs.next();
int yearcount=rs.getInt(1);
//本月的访问量
rs=stmt.executeQuery(sql4);
rs.next();
int monthcount=rs.getInt(1);
//开始统计的时间
rs=stmt1.executeQuery(sql5);
rs.next();
int bday=rs.getInt(1);
int cday=bday-day;
//日访问量
//int rcount=allcount/cday;
//开始时间
String btime=rs.getString(2);
//预计访问量
double agc=todaycount*(1+0.5)+1;
%>
<br>
<table width="500" cellspacing="0" align="center" cellpadding="0" border="0">
  <tr> 
    <td colspan="5"><img src="images/photoup.gif" width="500" height="10"></td>
  </tr>
  <tr height="30"> 
    <td bgcolor="#164DF9"></td>
    <td bgcolor="D1DBFA">&nbsp;</td>
    <td bgcolor="D1DBFA">∷∷∷ 总 体 数 据 ∷∷∷ </td>
    <td bgcolor="D1DBFA">&nbsp;</td>
    <td bgcolor="#164DF9"></td>
  </tr>
  <tr height="30"> 
    <td width="1" bgcolor="#164DF9"></td>
    <td width="17" bgcolor="D1DBFA">&nbsp;</td>
    <td width="212" bgcolor="D1DBFA"><p>总访问量: <font color="#646B9B"><%=allcount%></font> 
        次<br>
        <br>
        开始统计于: <%= btime%><br>
        <br>
        今日访问量: <%= todaycount %><br>
        <br>
        昨日访问量: <%= yesdaycount %><br>
        <br>
        今年访问量: <%= yearcount %><br>
        <br>
        本月访问量: <%= monthcount %><br>
        <br>
        统计天数: <%= cday %><br>
        <br>
        平均日访量: <br>
        <br>
        预计今日:<%= (int)agc  %><br>
        <br>
      </p>
      </td>
    <td width="270" bgcolor="D1DBFA"> <p>网站:<%=  webname %><br>
        <br>
        连接: <a href="<%= weburl %>" target="_blank"><font color="#164DF9"><%= weburl %></font></a><br>
        <br>
        站长: <%= webmaster %><br>
        <br>
        信箱: <a href="mailto:<%= webemail %>"><font color="#164DF9"><%= webemail %></font></a><br>
        <br>
        简介: <%= webjj %><br>
      </p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      </td>
    <td width="1" bgcolor="#164DF9"></td>
  </tr>
  <tr> 
    <td colspan="6"><img src="images/photodown.gif" width="500" height="10"></td>
  </tr>
</table>
<% if(session.getValue("username")!=null){%>
<p></p>
<table width="501" height="84" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="10" colspan="4"><img src="images/photoup.gif" width="500" height="10"></td>
  </tr>
  <tr height="30"> 
    <td width="1" height="64" bgcolor="#164DF9"></td>
    <td width="17" bgcolor="D1DBFA">&nbsp;</td>
    <td width="482" bgcolor="D1DBFA">管理员已经登陆   <a href="chklogin.jsp?login=off">退出</a></td>
    <td width="1" bgcolor="#164DF9"></td>
  </tr>
  <tr> 
    <td colspan="4"><img src="images/photodown.gif" width="500" height="10"></td>
  </tr>
</table>
<% }else{ %>
<form name="form1" method="post" action="chklogin.jsp?login=on&a=">
  <table width="501" height="84" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td height="10" colspan="4"><img src="images/photoup.gif" width="500" height="10"></td>
    </tr>
    <tr height="30"> 
      <td width="1" height="64" bgcolor="#164DF9"></td>
      <td width="17" bgcolor="D1DBFA">&nbsp;</td>
      <td width="482" bgcolor="D1DBFA">管理员登陆  用户名 
        <input name="name" type="text" class="input" size="10">
         密码 
        <input name="psw" type="password" class="input" size="10">
          
        <input type="submit" width="35" name="Submit" value="" style="BACKGROUND-IMAGE: url(images/btn.gif);BORDER: medium none;HEIGHT: 17px;WIDTH: 33px"></td>
      <td width="1" bgcolor="#164DF9"></td>
    </tr>
    <tr> 
      <td colspan="4"><img src="images/photodown.gif" width="500" height="10"></td>
    </tr>
  </table>
</form>
<p>
<%};
rs.close();
stmt.close();
stmt1.close();
con.close();
%>
</p>
<jsp:include page="bottom.jsp" flush="true" />
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -