<!--#include file="conn.asp"-->
<!--#include file="admin/config.asp"-->
<!--#include file="admin/inc/char.asp"-->
<!--#include file="top.asp"-->
<%dim id
id=CInt(Request.QueryString("id"))
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>软件列表 - 3鸟设社下载系统</title>
<STYLE>
BODY {
	    scrollbar-face-color : <%=SkinSetting(10)%>;
	    scrollbar-shadow-color : <%=SkinSetting(11)%>;
	    scrollbar-highlight-color : <%=SkinSetting(12)%>;
	    scrollbar-3dlight-color : <%=SkinSetting(13)%>;
	    scrollbar-darkshadow-color : <%=SkinSetting(14)%>;
	    scrollbar-track-color : <%=SkinSetting(15)%>;
	    scrollbar-arrow-color : <%=SkinSetting(16)%>;
}
.mouseover {
	background-color: <%=SkinSetting(8)%>;
	border: 1px solid <%=SkinSetting(9)%>;
}
.mouseout {
	background-color: <%=SkinSetting(3)%>;
}
.mouseout2 {
	background-color: <%=SkinSetting(4)%>;
}
</STYLE>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="<%=SkinSetting(0)%>" background="<%=SkinSetting(1)%>" leftmargin="0" topmargin="0">
<!--#include file="header.asp"-->
<table width="760" border="0" cellspacing="0" cellpadding="0" align="<%=SiteSetting(9)%>">
  <tr>
    <td bgcolor="<%=SkinSetting(3)%>">
<table width="760" border="0" cellpadding="0" cellspacing="0" class="xuxian">
        <tr> 
          <td width="560" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td valign="bottom" class="xuxian3">&nbsp;<img src="images/point1.gif" width="17" height="16" align="absmiddle"> 
                  当前位置：<a href="default.asp">首页</a> 
      <%dim sql,rs,ClassName,ParentStr,ParentNum,i,ParentID
		sql="select ClassName,ParentStr,ParentID from Class where ID="&id
		set rs=conn.execute(sql)
		ClassName=rs(0)
		ParentStr=Split(rs(1),",")
		ParentID=rs(2)
		ParentNum=UBound(ParentStr)
		if ParentStr(0)="0" then
			response.write " \ "&ClassName&""
		else
			response.write " \ "	
			for i=0 to ParentNum
				sql="select ID,ClassName from Class where ID="&CInt(ParentStr(i))
				set rs=conn.execute(sql)
				response.write "<a href=list.asp?id="&rs(0)&">"&rs(1)&"</a> \ "
			next
			response.write ""&ClassName&""
		end if%>
                </td>
                <td align="right" valign="bottom" class="xuxian3"> 
<select name="class" size="1" style="background-color:#eeeeee;color:#000000;font-size:12px" onChange="javascript:window.location.href=this.options[this.selectedIndex].value">
<%sql="select ID,ClassName,ChildID from Class where ParentID="&ParentID&" order by Sequence"
set rs=conn.execute(sql)
dim ChildID,ChildNum
if not(rs.eof and rs.bof) then
	response.write "<option value=''>-=同级分类=-</option>"
	do while not rs.eof
		ChildID=rs(2)
		if isnull(ChildID) or ChildID="" then
			ChildNum=0
		else
			ChildNum=UBound(Split(ChildID,","))+1
		end if
		response.write"<option value=list.asp?id="&rs(0)&">"&rs(1)&"("&ChildNum&")</option>"
		rs.movenext
	loop
end if
%>
 </select>
 <select name="select2" size="1" style="background-color:#eeeeee;color:#000000;font-size:12px" onChange="javascript:window.location.href=this.options[this.selectedIndex].value">
<%sql="select ID,ClassName,ChildID from Class where ParentID="&id&" order by Sequence"
set rs=conn.execute(sql)
if not(rs.eof and rs.bof) then
	response.write "<option value=''>-=下级分类=-</option>"
	do while not rs.eof
		ChildID=rs(2)
		if isnull(ChildID) or ChildID="" then
			ChildNum=0
		else
			ChildNum=UBound(Split(ChildID,","))+1
		end if
		response.write"<option value=list.asp?id="&rs(0)&">"&rs(1)&"("&ChildNum&")</option>"
		rs.movenext
	loop
else
	response.write "<option value=''>-=下级分类=-</option><option value=list.asp?id="&id&">没有下级分类</option>"
end if
%>
</select> </td>
              </tr>
            </table> 
<%
sql="select ChildID from Class where ID="&id
set rs=conn.execute(sql)
ChildID=rs(0)
if not(isnull(ChildID) or ChildID="") then
	sql="select ID,FileName,Info,Grade,Chinese,Crack,Best,Member,AddDate,TotalHits,Brief from Software where (ClassID="&id&" or ClassID in ("&ChildID&")) and Hidden=false and PostType<>1 order by ID DESC" 
else
	sql="select ID,FileName,Info,Grade,Chinese,Crack,Best,Member,AddDate,TotalHits,Brief from Software where ClassID="&id&" and Hidden=false and PostType<>1 order by ID DESC" 
end if
	
dim n,totalrec,currentpage,rowcount,Info
set rs=server.createobject("adodb.recordset") 
rs.cursorlocation = 3 
rs.pagesize = SiteSetting(12)
rs.open sql,conn,1,1

if rs.eof and rs.bof then
response.write "<br><br><center>此分类还没有任何软件！</center>"
else
if err.number<>0 then '错误处理
response.write "数据库操作失败：" & err.description
err.clear
else
if not (rs.eof and rs.bof) then '检测记录集是否为空
totalrec = RS.RecordCount 'totalrec：总记录条数
if rs.recordcount mod rs.pagesize = 0 then '计算总页数,recordcount:数据的总记录数
n = rs.recordcount\rs.pagesize 'n:总页数
else 
n = rs.recordcount\rs.pagesize+1 
end if 
currentpage = request("page") 'currentpage:当前页
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then 
currentpage = 1
end if 
if err.number <> 0 then 
err.clear
currentpage = 1
end if
else
currentpage = 1
End if 
if currentpage*rs.pagesize > totalrec and not((currentpage-1)*rs.pagesize < totalrec)then 
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage：设置指针指向某页开头
rowcount = rs.pagesize%>
            <br>
            <table width="95%" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="<%=SkinSetting(7)%>">
              <tr> 
                <td class="TdBorderRB"><font color="<%=SkinSetting(6)%>">软 
                  件 名 称</font></td>
                <td width="11%" align="center" class="TdBorderRB"><font color="<%=SkinSetting(6)%>">文件大小</font></td>
                <td width="11%" align="center" class="TdBorderRB"><font color="<%=SkinSetting(6)%>">下载次数</font></td>
                <td width="6%" align="center" class="TdBorderRB"><font color="<%=SkinSetting(6)%>">评分</font></td>
                <td width="14%" align="center" class="TdBorderB"><font color="<%=SkinSetting(6)%>">加入时间</font></td>
              </tr>
            </table>
            <br>
<%do while not rs.eof and rowcount > 0
Info=Split(rs(2),"|")%>
            <table width="95%" border="0" align="center" cellpadding="2" cellspacing="0">
              <tr> 
                <td class="TdBorderRB" bgcolor="<%=SkinSetting(4)%>"><img src="images/greendot.gif" width="8" height="8"> 
                  <a href="view.asp?id=<%=rs(0)%>" target="_blank"><%=rs(1)%></a> <%if not(isnull(rs(4)) or rs(4)="") then response.write"&nbsp;<img src='images/cn.gif'>"
					if not(isnull(rs(5)) or rs(5)="") then response.write"&nbsp;<img src='images/cr.gif'>"
					if rs(7)=true then response.write"&nbsp;<img src='images/mb.gif'>"
					if rs(6)=true then response.write"&nbsp;<img src='images/cm.gif'>"
				  %>
                </td>
                <td class="TdBorderRB" width="11%" align="center" bgcolor="<%=SkinSetting(4)%>"><%=Info(0)%></td>
                <td class="TdBorderRB" width="11%" align="center" bgcolor="<%=SkinSetting(4)%>"><%=rs(9)%></td>
                <td class="TdBorderRB" width="6%" align="center" bgcolor="<%=SkinSetting(4)%>"><img src="images/<%=rs(3)%>.gif"></td>
                <td class="TdBorderB" width="14%" align="center" bgcolor="<%=SkinSetting(4)%>"><%=formatDT(rs(8),2)%></td>
              </tr>
              <tr> 
                <td colspan="5"><font color="#3D5A83"><%=strvalue(rs(10),165)%></font></td>
              </tr>
            </table>
			<br>
            <%rowcount=rowcount-1
			  rs.movenext
			  loop
			  end if
			  end if
			  end if
			  rs.close
              %>
            <%call listPages()%>
            <br>
            <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="490" height="86">
              <param name="movie" value="images/home2.swf">
              <param name="quality" value="high">
              <embed src="images/home2.swf" width="490" height="86" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></object> 
          </td>
          <td width="200" valign="top"> 
            <TABLE WIDTH=195 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR> 
                <TD COLSPAN=5> <IMG SRC="images/down8_1.gif" WIDTH=195 HEIGHT=48 ALT=""></TD>
              </TR>
              <TR> 
                <TD ROWSPAN=7> <IMG SRC="images/down8_2.gif" WIDTH=12 HEIGHT=742 ALT=""></TD>
                <TD height="181" COLSPAN=3 bgcolor="#FFFFFF"> 
                  <%i=1
if not(isnull(ChildID) or ChildID="") then
	sql="select top 10 ID,FileName from Software where (ClassID="&id&" or ClassID in ("&ChildID&")) and Hidden=false and PostType<>1 and LastHit=date() and Dayhits>0 order by DayHits DESC"
else
	sql="select top 10 ID,FileName from Software where ClassID="&id&" and Hidden=false and PostType<>1 and LastHit=date() and Dayhits>0 order by DayHits DESC"
end if
set rs=conn.execute(sql)
if rs.eof and rs.bof then
response.write "<center>今日没有下载！</center>"
else 
do while not rs.eof
	response.write "·<a href='view.asp?id="&rs(0)&"' target='_blank'>"&rs(1)&"</a><br>"
	rs.movenext
	i=i+1
	if i>10 then exit do
loop
end if
%>
                </TD>
                <TD ROWSPAN=7> <IMG SRC="images/down8_4.gif" WIDTH=11 HEIGHT=742 ALT=""></TD>
              </TR>
              <TR> 
                <TD COLSPAN=3> <IMG SRC="images/down8_5.gif" WIDTH=172 HEIGHT=58 ALT=""></TD>
              </TR>
              <TR> 
                <TD height="187" COLSPAN=2 bgcolor="#FFFFFF"> 
                  <%i=1
dim OldWeek,NewWeek
OldWeek = WeekDay(Date())-1                                                                                     
If OldWeek = 0 Then OldWeek = 7                                                                                     
OldWeek = Date()-OldWeek                                                                                     
NewWeek = Date()+(9-WeekDay(Date()))  
if not(isnull(ChildID) or ChildID="") then                                                                                   
	sql="select top 10 ID,FileName from Software where (ClassID="&id&" or ClassID in ("&ChildID&")) and Hidden=false and PostType<>1 and "                                                                                     
	sql=sql&" (LastHit < #" & NewWeek & "#) and (LastHit > #" & OldWeek & "#) and WeekHits>0 "                                                                                     
	sql=sql&" order by WeekHits DESC"   
else
	sql="select top 10 ID,FileName from Software where ClassID="&id&" and Hidden=false and PostType<>1 and "                                                                                     
	sql=sql&" (LastHit < #" & NewWeek & "#) and (LastHit > #" & OldWeek & "#) and WeekHits>0 "                                                                                     
	sql=sql&" order by WeekHits DESC"
end if
set rs=conn.execute(sql)
if rs.eof and rs.bof then
	response.write "<center>本周没有下载！</center>"
else 
do while not rs.eof
	response.write "·<a href='view.asp?id="&rs(0)&"' target='_blank'>"&rs(1)&"</a><br>"
	rs.movenext
	i=i+1
	if i>10 then exit do
loop
end if
%>
                </TD>
                <TD ROWSPAN=5> <IMG SRC="images/down8_7.gif" WIDTH=2 HEIGHT=503 ALT=""></TD>
              </TR>
              <TR> 
                <TD COLSPAN=2> <IMG SRC="images/down8_8.gif" WIDTH=170 HEIGHT=71 ALT=""></TD>
              </TR>
              <TR> 
                <TD ROWSPAN=3> <IMG SRC="images/down8_9.gif" WIDTH=2 HEIGHT=245 ALT=""></TD>
                <TD> <IMG SRC="images/down8_10.gif" WIDTH=168 HEIGHT=28 ALT=""></TD>
              </TR>
              <TR> 
                <TD width="168" height="205" bgcolor="#FFFFFF">
                  <%i=1
if not(isnull(ChildID) or ChildID="") then 
	sql="select top 10 ID,FileName from Software where (ClassID="&id&" or ClassID in ("&ChildID&")) and Hidden=false and PostType<>1 and TotalHits>0 order by TotalHits DESC"
else
	sql="select top 10 ID,FileName from Software where ClassID="&id&" and Hidden=false and PostType<>1 and TotalHits>0 order by TotalHits DESC"
end if
set rs=conn.execute(sql)
if rs.eof and rs.bof then
response.write "<center>没有下载！</center>"
else 
do while not rs.eof
	response.write "·<a href='view.asp?id="&rs(0)&"' target='_blank'>"&rs(1)&"</a><br>"
	rs.movenext
	i=i+1
	if i>10 then exit do
loop
end if
set rs=nothing 
conn.close
set conn=nothing
%>
                </TD>
              </TR>
              <TR> 
                <TD> <IMG SRC="images/down8_12.gif" WIDTH=168 HEIGHT=12 ALT=""></TD>
              </TR>
            </TABLE></td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="footer.asp"-->
</body>
</html>
<%sub listPages() 
if n <= 1 then exit sub
response.write("<table width=95% border=0 align=center cellpadding=2 cellspacing=1 bgcolor="&SkinSetting(2)&">")
response.write("<tr><td align=center bgcolor="&SkinSetting(3)&">共"&totalrec&"条记录┊")
if currentpage = 1 then
response.write("<font color=darkgray>首页</font>┊<font color=darkgray>上一页</font>")
else
response.write("<a href="&request.ServerVariables("script_name")&"?id="&id&"&Page=1>首页</a>")
response.write("┊<a href="&request.ServerVariables("script_name")&"?id="&id&"&Page="&currentpage-1&">上一页</a>") 
end if
if currentpage = n then
response.write("┊<font color=darkgray>下一页</font>┊<font color=darkgray>尾页</font>") 
else
response.write("┊<a href="&request.ServerVariables("script_name")&"?id="&id&"&Page="&currentpage+1&">下一页</a>")
response.write("┊<a href="&request.ServerVariables("script_name")&"?id="&id&"&Page="&n&">尾页</a>")
end if
response.write("┊第"&currentpage&"/"&n&"页┊"&SiteSetting(12)&"条记录/页┊转到")
response.write("<select name=currentpage size=1 style=background-color:#eeeeee;color:#000000;font-size:12px onChange=javascript:window.location.href=this.options[this.selectedIndex].value>")
dim i
for i = 1 to n
response.write("<option value="&request.ServerVariables("script_name")&"?id="&id&"&Page="&i)
if cint(currentpage)=cint(i) then
response.write(" selected")
end if
response.write(">第"&i&"页</option>")
next
response.write("</select></td></tr></table>")
end sub
response.End()
%>