<!--#include file="conn.asp"-->
<!--#include file="chkadmin.asp"-->
<!--#include file="config.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<STYLE>
BODY {
	    scrollbar-face-color : #96A2AD;
	    scrollbar-shadow-color : #96A2AD;
	    scrollbar-highlight-color : #96A2AD;
	    scrollbar-3dlight-color : #96A2AD;
	    scrollbar-darkshadow-color : #96A2AD;
	    scrollbar-track-color : #CCCCCC;
	    scrollbar-arrow-color : #FFFFFF;
}
</STYLE>
<SCRIPT language=JScript>
function del(id)
{
    if ( confirm("此软件和相关评论将被删除，确定吗？"))
        {
            window.location.href = "soft_del.asp?id=" + id + "&type=recycle"
        }
}
</SCRIPT>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>

<body>
<table width="95%" border="0" align="center" cellpadding="2" cellspacing="0">
  <tr bgcolor="#708090" class="TdBorderB"> 
    <td class="TdBorderRB"><font color="#FFFFFF">软件名称</font></td>
    <td width="70" align="center" bgcolor="#708090" class="TdBorderRB"><font color="#FFFFFF">添加者</font></td>
    <td width="20" align="center" bgcolor="#708090" class="TdBorderRB"><font color="#FFFFFF">汉</font></td>
    <td width="20" align="center" bgcolor="#708090" class="TdBorderRB"><font color="#FFFFFF">破</font></td>
    <td width="20" align="center" bgcolor="#708090" class="TdBorderRB"><font color="#FFFFFF">荐</font></td>
    <td width="30" align="center" bgcolor="#708090" class="TdBorderRB"><font color="#FFFFFF">会员</font></td>
    <td width="30" align="center" bgcolor="#708090" class="TdBorderRB"><font color="#FFFFFF">评论</font></td>
    <td width="30" align="center" bgcolor="#708090" class="TdBorderRB"><font color="#FFFFFF">修改</font></td>
    <td width="30" align="center" bgcolor="#708090" class="TdBorderRB"><font color="#FFFFFF">还原</font></td>
    <td width="30" align="center" bgcolor="#708090"><font color="#FFFFFF">删除</font></td>
  </tr>
<%dim sql,rs,n,totalrec,currentpage,rowcount
sql="select ID,FileName,Chinese,Crack,Best,Member,Poster from Software where Hidden=true and (PostType=0 or PostType=2) order by ID DESC" 
set rs=server.createobject("adodb.recordset") 
rs.cursorlocation = 3 
rs.pagesize = SiteSetting(13)
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.Write "<tr bgcolor=#EEEEEE><td colspan=10><center>没有软件！</center></td></tr>"
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 SiteSetting(13) = 0 then '计算总页数,recordcount:数据的总记录数
n = rs.recordcount\SiteSetting(13) 'n:总页数
else 
n = rs.recordcount\SiteSetting(13)+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*SiteSetting(13) > totalrec and not((currentpage-1)*SiteSetting(13) < totalrec)then 
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage：设置指针指向某页开头
rowcount = rs.pagesize
do while not rs.eof and rowcount > 0%>
  <tr bgcolor="#EEEEEE"> 
    <td class="TdBorderRB"><a href=../view.asp?id=<%=rs(0)%> target=_blank><%=rs(1)%></a></td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderRB"><%=rs(6)%></td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderRB">
	<%if not(isnull(rs(2)) or rs(2)="") then response.write "<font color=red>√</font>" else response.write "×" end if %>
	</td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderRB">
	<%if not(isnull(rs(3)) or rs(3)="") then response.write "<font color=red>√</font>" else response.write "×" end if %>
	</td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderRB">
	<%if rs(4)=true then response.write "<font color=red>√</font>" else response.write "×" end if %>
	</td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderRB">
	<%if rs(5)=true then response.write "<font color=red>√</font>" else response.write "×" end if %>
	</td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderRB"><a href="review.asp?id=<%=rs(0)%>" target="_blank">评论</a></td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderRB">
      <%if chkadmin=true and ((power(2)="1" and rs(6)=session("adm_usr")) or power(4)="1") then
	response.write "<a href=soft_edit.asp?id="&rs(0)&"&type=recycle>修改</a>"
	else
	response.write "<font color=#999999>修改</font>"
	end if%>
    </td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderRB">
      <%if chkadmin=true and ((power(1)="1" and rs(6)=session("adm_usr")) or power(4)="1") then
	response.write "<a href=soft_hidden.asp?id="&rs(0)&"&action=false>还原</a>"
	else
	response.write "<font color=#999999>还原</font>"
	end if%>
    </td>
    <td align="center" bgcolor="#EEEEEE" class="TdBorderB">
      <%if chkadmin=true and ((power(1)="1" and rs(6)=session("adm_usr")) or power(4)="1") then
	response.write "<a href=javascript:del("&rs(0)&")>删除</a>"
	else
	response.write "<font color=#999999>删除</font>"
	end if%>
    </td>
  </tr>
<%rowcount=rowcount-1
rs.movenext
loop
end if
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing%>
</table>
<%call listpages()%>
</body>
</html>
<%sub listPages() 
if n <= 1 then exit sub
response.write("<table width=95% border=0 align=center cellpadding=2 cellspacing=1 bgcolor=#EEEEEE>")
response.write("<tr><td align=center bgcolor=#EEEEEE>共有"&totalrec&"条记录")
if currentpage = 1 then
response.write("<font color=darkgray>&nbsp;[首页]&nbsp;[上一页]</font>")
else
response.write("&nbsp;[<a href="&request.ServerVariables("script_name")&"?id="&id&"&Page=1>首页</a>]")
response.write("&nbsp;[<a href="&request.ServerVariables("script_name")&"?id="&id&"&Page="&currentpage-1&">上一页</a>]") 
end if
if currentpage = n then
response.write("&nbsp;<font color=darkgray>[下一页]&nbsp;[尾页]</font>") 
else
response.write("&nbsp;[<a href="&request.ServerVariables("script_name")&"?id="&id&"&Page="&currentpage+1&">下一页</a>]")
response.write("&nbsp;[<a href="&request.ServerVariables("script_name")&"?id="&id&"&Page="&n&">尾页</a>]")
end if
response.write("&nbsp;当前为第"&currentpage&"页&nbsp;共"&n&"页&nbsp;"&SiteSetting(13)&"条记录/页&nbsp;转到")
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()%>