一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

asp按日期统计访问量

时间:2022-07-02 23:12:50 编辑:袖梨 来源:一聚教程网

<%
 oConn.Open();
 
 var bIsLogined = chkLogin(true);
 
 var iDaySum = 0;
 var iPageDaySum = 0;
 var iDayMax = 0;
 var iPageDayMax = 0;
 var aDay = new Array();
 var aPageNowHour = new Array();
 var sSqlString = "select Year(CountDate),Month(CountDate),Sum(HourCount),Sum(PageViewCount) from v_Count "
  + "where siteid="+iSiteId+" and (CountDate between #"+(dToday.getYear())+"-1-1# and #"+(dToday.getYear())+"-12-31#) "
  + "group by Year(CountDate), Month(CountDate)"
 var oRs = oConn.Execute( sSqlString );
 for(var i=0;i   var sTmpDate = dToday.getYear() + " 年 " + (i+1) + " 月";
  if(!oRs.EOF){
   if(oRs.fields.item(1).value==(i+1)){
    aDay[aDay.length] = Array(sTmpDate,parseInt(oRs.Fields.Item(2).Value),parseInt(oRs.Fields.Item(3).Value));
    oRs.moveNext();
   }else{
    aDay[aDay.length] = Array(sTmpDate,0,0);
   }
  }else{
   aDay[aDay.length] = Array(sTmpDate,0,0);
  }
  if(iDayMax   if(iPageDayMax   iDaySum += aDay[aDay.length-1][1]; iPageDaySum += aDay[aDay.length-1][2];
 }
 var sNowFromTo = ' '+(dToday.getYear())+'-1-1 ~ '+(dToday.getYear())+'-12-31';
 
 oConn.Close();
%>

热门栏目