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

📄 showcount.jsp

📁 云网oa办公自动化系统java源码。能够使用!有说明!
💻 JSP
📖 第 1 页 / 共 2 页
字号:
						  dpct = (int)Math.round((double)MyCount.getInt("todays")/todaystotal*100);
						  tpct = (int)Math.round((double)MyCount.getInt("count")/counttotal*100);
						  widthd = dpct*3;
						  widtht = tpct*3;
						  %>
  <tr class=rcontent>
    <td><nobr><%=MyCount.getString(path)%></nobr></td>
    <td><nobr><img src="<%=ImageLink%>/theme/default/vstatb.gif" width="<%=widthd%>" height=10><%=Percent(MyCount.getInt("todays"),todaystotal)%> 
      (<%=MyCount.getInt("todays")%>)<nobr><br>
      <nobr><img src="<%=ImageLink%>/theme/default/hstatt.gif" width="<%=widtht%>" height=10><%=Percent(MyCount.getInt("count"),counttotal)%> 
      (<%=MyCount.getInt("count")%>)</nobr></td>
  </tr>
  <%
				   }%>
</table>
<%
			 }
			 MyCount.close();
		 }
		 catch (java.sql.SQLException e)
		 {}
		 catch (java.io.IOException e)
		 {}
%>
<br>
<table width="576" border="0" class="p9" align="center" cellpadding="0" cellspacing="0">
  <tr class=info>
    <td align="right"><font class=strong><%=YearID%> 年 <%=Mon%> 月 日统计</font> </td>
  </tr>
</table>
<table cellspacing='0' cellpadding='0' width='576' border='0' class="p9" align="center">
  <tr align=center valign=bottom> 
    <%//===========================================================================
		String mondays = ",31,28,31,30,31,30,31,31,30,31,30,31";
		String[] lastday = mondays.split(",");
        if (((Integer.parseInt(YearID) % 4 == 0) && (Integer.parseInt(YearID) % 100 != 0)) || (Integer.parseInt(YearID) % 400 == 0))	lastday[2] = "29";
		
        String StrSQL="Select * From MonthCount Where ID = " + MonID;
        ResultSet MyCount = conn.executeQuery(StrSQL);

        if (!MyCount.next())
             out.println( "<TD align=center>没有统计数据</TD>");
        else
		{
             String weekstr = "Sun,Mon,Tue,Wed,Thu,Fri,Sat";
			 String[] Wday = weekstr.split(",");
			 int Dmax = 0;
			 Calendar ca =  Calendar.getInstance();
             for (int n = 1; n<=Integer.parseInt(lastday[Integer.parseInt(Mon)]); n++)
			 {
                    if (Dmax<MyCount.getInt(n+1)) 	Dmax = MyCount.getInt(n+1);
					ca.set(Integer.parseInt(YearID),Integer.parseInt(Mon)-1,n);
					int intSday = ca.get(Calendar.DAY_OF_WEEK)-1;
					String Sday = "";
                    if (intSday == 0 || intSday == 6)
                          Sday = "<font color=red>" + Wday[intSday] + "</font>";
                    else
                          Sday = ""+Wday[intSday];
                   %>
    <td width="563" class="rcontent"><nobr><font class=small><%=Sday%></font></td>
    <%
             }
             %>
  </tr>
  <tr align=center valign=bottom> 
    <%
			 String Images = "";
             for (int n = 1;n<=Integer.parseInt(lastday[Integer.parseInt(Mon)]);n++)
			 {
                    int iDay = MyCount.getInt(n+1);
                    %>
    <td width="563" class="rcontent"><font class=small><nobr> 
      <%
                    if( iDay>0 )
						out.println(iDay);
                    %>
      </nobr></font><br>
      <%
                    if (iDay == Dmax)
                          Images = "vstath.gif" ;
                    else if (n == Integer.parseInt(NewDay))
                          Images = "vstatd.gif";
                    else if (n == Integer.parseInt(DayID))
                          Images = "vstatp.gif";
                    else
                          Images = "vstatt.gif";
                    int height = (int)iDay*300/Dmax;
                    %>
      <IMG Src="<%=ImageLink%>/theme/default/<%=Images%>" height="<%=height%>" width='10'></TD>
    <%
              }
              %>
  </TR>
  <TR align=center> 
    <%
              String strn = "";
              for (int n = 1; n<=Integer.parseInt(lastday[Integer.parseInt(Mon)]); n++)
			  {
					 strn = ""+n;
					 if (n<=9) strn = "" + n;
                     %>
    <TD width="563" class="rcontent"><a href="<%=ScriptName%>?mon=<%=MonID%>&day=<%=strn%>"><%=strn%></a></TD>
    <%
              }
        }
        MyCount.close();
       %>
  </TR>
</table>
<table class="p9" width="576" align="center" border="0" cellpadding="0" cellspacing="0">
  <tr><td colspan=2 align=center>点击日期可查看当日时间访问统计.如果没有选择日期.将显示一个月内的所有时间统计</td></tr>
        <tr class=info>
    <td colspan=2 align=right><font class=strong><%=YearID%> 年 
      <%=Mon%> 月 
      <%if (MyDay) out.println(DayID + "日");%>
      时间统计</font></td>
  </tr>
		 <%
        StrSQL="Select * From DayCount Where";
        if (MyDay)
              StrSQL = StrSQL + " ID = " + MonID + DayID;
        else
              StrSQL = StrSQL + " Left(ID,6) = " + MonID;
        MyCount = conn.executeQuery(StrSQL);
        // System.out.println(StrSQL);
        if (conn.getRows()==0)
            out.println("<tr class=rcontent><td colspan=2 align=center>没有统计数据</TD></TR>");
        else
		{
            int d[] = new int[25];
			int dtotal = 0;
			int Tmax = 0;
			int TWidth = 0;
			String Images = "";
            while (MyCount.next())
			{
                for (int i = 1; i<=24; i++)
                    d[i] = MyCount.getInt(i+1) + d[i];
            }
            for (int x = 1; x<=24; x++)
			{
                 dtotal = d[x] + dtotal;
                 if (Tmax < d[x]) 	Tmax=d[x];
            }
			Calendar ca = Calendar.getInstance();

            for (int n = 1; n<=24; n++)
			{
     			  //ca.set(Integer.parseInt(YearID),Integer.parseInt(MonID),Integer.parseInt(DayID));
                  if (n-1 == ca.get(Calendar.HOUR_OF_DAY))
                        Images = "vstatb.gif" ;
                  else if (d[n] == Tmax)
                        Images = "vstatg.gif" ;
                  else
                        Images = "hstatt.gif";
                  TWidth = (int)350 * d[n]/Tmax;
				  %>
                  <tr class=rcontent>
    <td align=center> <%=Right("0" + (n-1),2)%>:00 ~ <%=Right("0" + n,2)%></TD>
    <TD>
                  <IMG src="<%=ImageLink%>/theme/default/<%=Images%>" height='10' width="<%=TWidth%>">
                  <%if (d[n]>0) out.println(d[n]);
                  out.println("(" + Percent(d[n],dtotal) + ")");%>
				  </TD></TR>
				  <%
            }
        }
        MyCount.close();
%>
        <tr class=info>
    <td colspan=2 align=right><font class="strong" color="#FFFFFF"><%=YearID%> 
      年 月统计</font></td>
  </tr>
<%
        StrSQL="Select * from YearCount Where ID = " + YearID;
        MyCount = conn.executeQuery(StrSQL);
		int Mmax = 0;
		int iMon = 0;
        if ( !MyCount.next())
             out.println("<tr class=rcontent><TD colspan=2 align=center>没有统计数据</TD></TR>");
        else
		{
             int mtotal = 0;
			 String Images = "";
			 for (int i=1; i<=12; i++)
			 {
                 mtotal += MyCount.getInt(i+1);
                 if (Mmax < MyCount.getInt(i+1)) 	Mmax=MyCount.getInt(i+1);
             }
             for (int n = 1; n<=12; n++)
			 {
				 iMon = MyCount.getInt(n+1);
                 if (iMon>0)
				 {
                      if (n == Integer.parseInt(NewMonth))
                             Images = "vstatb.gif";
                      else if (n == Integer.parseInt(Mon))
                             Images = "vstatk.gif";
                      else if (iMon == Mmax)
                             Images = "vstatg.gif";
                      else
                             Images = "hstatt.gif";
                      int MWidth = (int)350*iMon/Mmax;
					  %>
                      <tr class=rcontent><td align=center>
                      <%if (iMon!=0)
                           out.println("<a href='" + ScriptName + "?mon=" + YearID + Right("0" + n,2) + "'>");
                      out.println(YearID + "-" + Right("0" + n,2) +" ~ " +  lastday[n] + "</a>");%>
					  </TD><TD>
                      <IMG src="<%=ImageLink%>/theme/default/<%=Images%>" height='10' width="<%=MWidth%>">
                      <%if (iMon > 0) 	out.println(iMon);%>
                      (<%=Percent(iMon,mtotal)%>)</TD></TR>
					  <%
                 }
			}
        }
		if (MyCount!=null) {
			MyCount.close();
			MyCount = null;
		}
        conn.close();
%>
</table>
<table width="576" border="0" class="p9" cellpadding="0" align="center">
  <tr>
    <td align="center" height="42"> 
      <%!
public String Percent(int St,int Sz)
{
       double Str = (double)St / Sz * 100;
       return cn.js.fan.util.StrUtil.FormatPrice(Str)+"%";
}
%>
      截止日期: <%=LogDate%>, 统计天数: <%=DayTotal%>/<%=TotalDays%> 天, 预计本日访问量: <%=intending%> 
      人 </td>
  </tr>
</table>
     
<table cellspacing='0' cellpadding='3' width='576' border='0' align="center">
  <tr><td align=center><font class=footer>风之城<br><img src='theme/default/hr_black.gif' height=2 width='60%'><br>
      Copyright &copy2000-2001 <A href='mailto:bestfeng@163.com'>蓝风统计系统</A>,All 
      Rights Reserved</font></td>
  </tr>
     <tr><td>
     </td></tr></table>
</body>
</html>

⌨️ 快捷键说明

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