<table class="singleborder" cellspacing=1 width="100%" align=center height=180>
        <tr>
          <th valign=middle height=25 width="100%">下载统计</th>
        </tr>
        <tr>
          <td align="center" valign=top class=tablebody1>
截止<%=date()%>
</td></tr>
        <tr>
          <td class=tablebody1 valign=top><font color=blue>※</font>总计软件：<font color=red><b><%=haoallnum()%></b></font>个<br>
            <font color=blue>※</font>今日添加：<font color=blue><%=haotodaynum()%></font>个<br>
            <font color=blue>※</font>今日上传：<font color=blue><%=haotodayupnum()%></font>个<br>
            <font color=blue>※</font>固顶推荐：<font color=blue><%=haogudinnum()%></font>个<br>
            <font color=blue>※</font>热门推荐：<font color=blue><%=haohotsnum()%></font>个<br>
            <font color=blue>※</font>收费推荐：<font color=blue><%=haomonyenum()%></font>个<br>
            <font color=blue>※</font>今日下载：<font color=blue><%=haotdownnum()%></font>个</td>
        </tr>
</table>
<%
dim rstongji
'所有软件统计
function haoallnum()
rstongji=conndown.execute("Select Count(id) from download") 
	haoallnum=rstongji(0)
	set rstongji=nothing 
       if isnull(haoallnum) then haoallnum=0 
end function

%>
<%
'所有今日添加统计
function haotodaynum()
rstongji=conndown.execute("Select Count(id) from download where datediff('d',dateandtime,now())=0")
	haotodaynum=rstongji(0)
	set rstongji=nothing
       if isnull(haotodaynum) then haotodaynum=0 
end function

%>
<%
'所有今日上传统计
function haotodayupnum()
rstongji=conndown.execute("Select Count(id) from download where datediff('d',dateandtime,now())=0 and right(filename,1)='1'")
	haotodayupnum=rstongji(0)
	set rstongji=nothing
       if isnull(haotodayupnum) then haotodayupnum=0 
end function

%>
<%
'所有固顶统计子
function haogudinnum()
rstongji=conndown.execute("Select Count(id) from download where gudin=1 ") 
	haogudinnum=rstongji(0)
	set rstongji=nothing 
       if isnull(haogudinnum) then haogudinnum=0 
end function

%>
<%
'所有热门统计
function haohotsnum()
rstongji=conndown.execute("Select Count(id) from download where hots=1 ") 
	haohotsnum=rstongji(0)
	set rstongji=nothing 
       if isnull(haohotsnum) then haohotsnum=0 
end function

%>
<%
'所有收费软件统计
function haomonyenum()
rstongji=conndown.execute("Select Count(id) from download where downshow=5 ") 
	haomonyenum=rstongji(0)
	set rstongji=nothing 
       if isnull(haomonyenum) then haomonyenum=0 
end function

%>
<%
'统计今日被下载的软件
function haotdownnum()

rstongji=conndown.execute("Select Count(id) from download where datediff('d',lasthits,now())=0 and stop=0 and dayhits>0") 
	haotdownnum=rstongji(0)
	set rstongji=nothing 
       if isnull(haotdownnum) then haotdownnum=0 
end function

%>

