<!-- #include file="../conn.asp" -->
<!-- #include file="../cls_main.asp" -->
<!-- #include file="../cls_Mesky_showPage.asp" -->
<% MyDbPath = "../"
dim obj
set obj = New admin_down_reslist
	obj.AspInit()
set obj = nothing

Class admin_down_reslist
	
	Private BatchID, sID, sResName, sToolTip, Mesky
	Private Sub Class_Initialize()
		Set Mesky = New Cls_Main
		Founderr = False
	End Sub
	Private Sub Class_Terminate()
		Set Mesky = Nothing
	End Sub
	Public Sub AspInit()
	
		Response.Write "<HTML><HEAD><TITLE>下载管理</TITLE>" & vbCrLf
		Response.Write "<META http-equiv=Content-Type content=""text/html; charset=gb2312"">" & vbCrLf
		Response.Write "<LINK href=""admin.css"" type=text/css rel=stylesheet>" & vbCrLf
		Response.Write "</HEAD>" & vbCrLf
		Response.Write "<BODY leftmargin=""3"" topmargin=""0"">" & vbCrLf
		Response.Write "<script src=""../js/Mesky_Tooltip.js""></script>" & vbCrLf
		
		BatchID = Request.Form("ID")
		If Request.QueryString("ID") <> "" Then
			sID = CLng(Request.QueryString("ID"))
		Else
			sID = ""
		End If
		
			Call Mesky.LoadSetting
			If Mesky.adminName = "" Then
				Mesky.strMsg = "<li>非法操作：登录超时或你没有以管理员身份登录系统，<a href=""../admin_login.asp"" target=_top>点此进入管理员登录界面</a>。"
				Call Mesky.SystemMsg
			ElseIf myPermission() = False Then
				Mesky.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call Mesky.SystemMsg
			Else
				Call Main
			End If
		Response.Write "</BODY></HTML>" & vbCrLf
		Err.Clear
	
	End Sub
	Private Function myPermission()
		myPermission = False
		If Mesky.checkPermission(Mesky.adminName, "11") Then myPermission = True: Exit Function
		If Mesky.checkPermission(Mesky.adminName, "12") Then myPermission = True: Exit Function
		'If Mesky.checkPermission(Mesky.adminName,"10") Then myPermission = False
	End Function
	Private Sub Main()
		Call sMenu
		Call sForm
		Select Case Trim(Request("action"))
		Case "isBatchDel" '批量删除
			If Mesky.checkPermission(Mesky.adminName, "12") Then
				Call isBatchDel
			Else
				Mesky.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call Mesky.SystemMsg
			End If
		Case "isBatchAuditing" '批量审核
			Call isBatchAuditing
		Case "unBatchAuditing" '批量取消审核
			Call unBatchAuditing
		Case "isBatchTop" '批量置顶
			Call isBatchTop
		Case "unBatchTop" '批量取消置顶
			Call unBatchTop
		Case "isBatchHot" '批量推荐
			Call isBatchHot
		Case "unBatchHot" '批量取消推荐
			Call unBatchHot
		Case "isBatchBest" '批量精品
			Call isBatchBest
		Case "unBatchBest" '批量取消精品
			Call unBatchBest
		Case "isBatchMov" '批量移动
			Call isBatchMov
		Case "isDel" '删除
			If Mesky.checkPermission(Mesky.adminName, "12") Then
				Call isDel
			Else
				Mesky.strMsg = "<li>非法操作：你没有权限进行此项操作，请联系管理员！"
				Call Mesky.SystemMsg
			End If
		Case "isAuditing" '审核
			Call isAuditing
		Case "unAuditing" '取消审核
			Call unAuditing
		Case "AllAuditing" '全部审核
			Call AllAuditing
		Case "isTop" '置顶
			Call isTop
		Case "unTop" '取消置顶
			Call unTop
		Case "isHot" '批量推荐
			Call isHot
		Case "unHot" '批量取消推荐
			Call unHot
		Case "isBest" '批量精品
			Call isBest
		Case "unBest" '批量取消精品
			Call unBest
		Case Else
			Call Reslist
		End Select
	End Sub
	Private Sub Reslist()
	Dim Rs, showPageRs, sql, Keyword, i, q, sCatalog, sKeyword, sColumn, currentPage
	sColumn = "ID,CatalogID,CatalogName,ResName,ResVer,FontColor,FontType,SmallImg,ResLanguage,ResSize,ResType  ,ResLicence,ResRank,System,DateAndTime,UpdateTime,HitsTotal,HitsMonth,HitsWeek,HitsToday,isHot,isTop,isBest,isError,isAuditing,UserName"
	If Trim(Request.QueryString("Page")) = "" Then
		currentPage = 1
	Else
		currentPage = Trim(Request.QueryString("Page"))
	End If
	Set showPageRs = New cls_Mesky_showPage '创建对象
	If IsSqlDataBase = 1 Then
		showPageRs.DbType = "MSSQL_SP"
	Else
		showPageRs.DbType = "AC"
	End If
		'数据库类型,AC为access,MSSQL为sqlserver2000,MSSQL_SP为存储过程版,MYSQL为mysql,PGSQL为PostgreSql
	showPageRs.RecType = 0
		'取记录总数方法(0执行count,1自写sql语句取,2固定值)
	showPageRs.RecSql = 0
		'如果RecType＝1则=取记录sql语句，如果是2=数值，等于0=""
	showPageRs.RecTerm = 1
		'取从记录条件是否有变化(0无变化,1有变化,2不设置cookies也就是及时统计，适用于搜索时候)
	showPageRs.CookieName = "mesky_down_reslist"  '如果RecTerm＝2,cookiesname="",否则写cookiesname
	showPageRs.Order = 1              '排序(0顺序1降序),注意要和下面sql里面主键ID的排序对应
	showPageRs.PageSize = 35          '每页记录条数
	showPageRs.currentPage = currentPage
	
	If Trim(Request("action")) = "s" Then
		Keyword = Mesky.checkStr(Request("keyword"))
		Select Case Request("sType")
		Case "ResName"
			sKeyword = " (" & Mesky.translate(Keyword, "ResName") & ")"
			q = "&action=s&sType=ResName&catalog=" & Request("catalog") & "&keyword=" & Keyword
		Case "ResVer"
			sKeyword = " (" & Mesky.translate(Keyword, "ResVer") & ")"
			q = "&action=s&sType=ResVer&catalog=" & Request("catalog") & "&keyword=" & Keyword
		Case "Excerpt"
			sKeyword = " (" & Mesky.translate(Keyword, "Excerpt") & ")"
			q = "&action=s&sType=Excerpt&catalog=" & Request("catalog") & "&keyword=" & Keyword
		Case "Content"
			sKeyword = " (" & Mesky.translate(Keyword, "Content") & ")"
			q = "&action=s&sType=Content&catalog=" & Request("catalog") & "&keyword=" & Keyword
		Case "UserName"
			sKeyword = " UserName = '" & Keyword & "'"
			q = "&action=s&sType=UserName&catalog=" & Request("catalog") & "&keyword=" & Keyword
		End Select
		
		If Keyword <> "" Then
			If Request("catalog") <> "" Then
				If Split(Request("catalog"), ",")(2) = 0 Then
					sCatalog = sKeyword & " and RootID = " & Split(Request("catalog"), ",")(0)
				Else
					sCatalog = sKeyword & " and catalogID=" & Split(Request("catalog"), ",")(1) & " and Depth>=" & Split(Request("catalog"), ",")(2) & " and RootID = " & Split(Request("catalog"), ",")(0)
				End If
			Else
				sCatalog = sKeyword & ""
			End If
		Else
			If Request("catalog") <> "" Then
				If Split(Request("catalog"), ",")(2) = 0 Then
					sCatalog = " RootID = " & Split(Request("catalog"), ",")(0)
				Else
					sCatalog = " catalogID=" & Split(Request("catalog"), ",")(1) & " and Depth>=" & Split(Request("catalog"), ",")(2) & " and RootID = " & Split(Request("catalog"), ",")(0)
				End If
			Else
				sCatalog = ""
			End If
			sKeyword = ""
		End If
		'Response.Write(sCatalog)
		showPageRs.sql = sColumn & "$Mesky_Down_Resource$" & sCatalog & "$UpdateTime desc$UpdateTime" '字段,表,条件(不需要where),排序(不需要需要ORDER BY),主键ID
	Else
		showPageRs.sql = sColumn & "$Mesky_Down_Resource$$UpdateTime desc$UpdateTime" '字段,表,条件(不需要where),排序(不需要需要ORDER BY),主键ID
	End If
	Dim iRecCount, sqlRs
	iRecCount = showPageRs.RecCount() '记录总数
	
	Response.Write "<script language=""JavaScript"">" & vbCrLf
	Response.Write "function doSort() {" & vbCrLf
	Response.Write "    var oE = window.event.srcElement;" & vbCrLf
	Response.Write "    for (var i=0;i<oE.rows[oE.headindex].cells.length;i++) {" & vbCrLf
	Response.Write "        oE.rows[oE.headindex].cells[i].children[1].innerText = """";" & vbCrLf
	Response.Write "    }" & vbCrLf
	Response.Write "    oE.rows[oE.headindex].cells[window.event.sortIndex].children[1].innerText = window.event.sortOrder ? ""↑"" : ""↓"";" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "function sort() {" & vbCrLf
	Response.Write "    document.getElementById(""databox"").sort(2,false,""float"");" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "</script>" & vbCrLf
	
	Response.Write (showPageRs.showPage("?Page={$pages}" & q))
	
	Response.Write "<table width=""100%"" border=""0"" cellpadding=""0"" cellspacing=""0"">" & vbCrLf
	Response.Write "<form name=""myform"" method=""post"" action="""">" & vbCrLf
	Response.Write "  <tr>" & vbCrLf
	Response.Write "    <td><table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"" headindex=""0"" begin=""1"" end=""0"" onsort=""doSort()"" id=""databox"" style=""behavior:url(../js/sortrow1.11.htc)""> " & vbCrLf
	Response.Write "        <COLGROUP>" & vbCrLf
	Response.Write "              <COL width=26>" & vbCrLf
	Response.Write "              <COL width=*>" & vbCrLf
	Response.Write "              <COL width=65>" & vbCrLf
	Response.Write "              <COL width=40>" & vbCrLf
	Response.Write "              <COL width=85>" & vbCrLf
	Response.Write "              <COL width=40>" & vbCrLf
	Response.Write "              <COL width=120>" & vbCrLf
	Response.Write "        <tr height=""25"">" & vbCrLf
	Response.Write "          <td align=""center"" data-type=""none"" background=""../images/menubg.gif""><span><a href=""javascript:SelectAll()"">选择</a></span><span></span></td>" & vbCrLf
	Response.Write "          <td background=""../images/menubg.gif"">　<span>资源分类和资源名称</span><span></span></td>" & vbCrLf
	Response.Write "          <td align=""center"" background=""../images/menubg.gif""><span>日期</span><span></span></td>" & vbCrLf
	Response.Write "          <td align=""center"" background=""../images/menubg.gif""><span>用户</span><span></span></td>" & vbCrLf
	Response.Write "          <td align=""center"" background=""../images/menubg.gif"" data-type=""none""><span>资源属性</span><span></span></td>" & vbCrLf
	Response.Write "          <td align=""center"" background=""../images/menubg.gif""><span>审核</span><span></span></td>" & vbCrLf
	Response.Write "          <td align=""center"" background=""../images/menubg.gif"" data-type=""none""><span>常规操作</span><span></span></td>          " & vbCrLf
	Response.Write "        </tr>" & vbCrLf
	Response.Write "<SCRIPT language = ""JavaScript"">" & vbCrLf
	Response.Write "//parent.frame.cols=""0,*"";" & vbCrLf
	Response.Write "function SelectAll() {" & vbCrLf
	Response.Write "    for (var i=0;i<document.myform.ID.length;i++) {" & vbCrLf
	Response.Write "        var e=document.myform.ID[i];" & vbCrLf
	Response.Write "        e.checked=!e.checked;" & vbCrLf
	Response.Write "    }" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "<!--" & vbCrLf
	Response.Write "function CheckAll(form)  {" & vbCrLf
	Response.Write "  for (var i=0;i<form.elements.length;i++)    {" & vbCrLf
	Response.Write "    var e = form.elements[i];" & vbCrLf
	Response.Write "    if (e.name != 'chkall')       e.checked = form.chkall.checked; " & vbCrLf
	Response.Write "   }" & vbCrLf
	Response.Write "  }" & vbCrLf
	Response.Write "//-->" & vbCrLf
	Response.Write "</script>" & vbCrLf
	
	If iRecCount < 1 Then
		Response.Write "<tr bgcolor=""#FCFCFC""> <td colspan=""7"">Sorry！没有找到任何记录。</td></tr>"
	Else
		'Set sqlRs = showPageRs.ResultSet()  '返回ResultSet
		Rs = showPageRs.ResultSet()  '返回ResultSet
		For i = 0 To UBound(Rs, 2)
			'设置文字颜色和字型
			If Rs(5, i) = "" Or IsNull(Rs(5, i)) Then
				sResName = Mesky.cutStr(Rs(3, i) & " " & Rs(4, i), 50)
			Else
				sResName = "<font color=""" & Rs(5, i) & """>" & Mesky.cutStr(Rs(3, i) & " " & Rs(4, i), 50) & "</font>"
			End If
			If Rs(6, i) = 1 Then
				sResName = "<strong>" & sResName & "</strong>"
			ElseIf Rs(6, i) = 2 Then
				sResName = "<em>" & sResName & "</em>"
			ElseIf Rs(6, i) = 3 Then
				sResName = "<strong><em>" & sResName & "</em></strong>"
			End If
			
			sToolTip = "<table width=330 border=0 cellspacing=1 cellpadding=0>" & _
			"<tr><td>语种：" & Rs(8, i) & "</td><td>大小：" & Rs(9, i) & " KB</td></tr>" & _
			"<tr><td>类型：" & Rs(10, i) & "</td><td>级别：" & Rs(12, i) & "星</td></tr>" & _
			"<tr><td>授权：" & Rs(11, i) & "</td><td>上传：" & Rs(14, i) & "</td></tr>" & _
			"<tr><td colspan=2>系统：" & Rs(13, i) & "</td></tr>" & _
			"<tr><td colspan=2>下载：总" & Rs(16, i) & " 月" & Rs(17, i) & " 周" & Rs(18, i) & " 日" & Rs(19, i) & "</td></tr></table>"
				
				Response.Write " <tr "
				If i Mod 2 Then
					Response.Write (" class=""tdbg2""")
				Else
					Response.Write (" class=""tdbg3""")
				End If
				Response.Write " onmouseover=""this.style.backgroundColor='#CEE7FF';this.style.color='red'"" onmouseout=""this.style.backgroundColor='';this.style.color=''""> "
				Response.Write " <td align=""center"">"
				If checkResAdmin(Rs(25, i)) = True Then
					Response.Write "<input name=""ID"" type=""checkbox"" value=""" & Rs(0, i) & """>"
				 Else
					Response.Write "--"
				End If
				Response.Write "</td>"
				Response.Write " <td>"
				Response.Write "[<a href=""?catalogID=" & Rs(1, i) & """>" & Rs(2, i) & "</a>]"
				Response.Write " <a href=""../" & Replace(Mesky.Setting(77), "{$id}", Rs(0, i)) & """ target=""_blank"" onmouseover=""showToolTip('" & sToolTip & "',event.srcElement)"" onmouseout=""hiddenToolTip()"">" & sResName & "</a>"
				Response.Write " </td>"
				Response.Write " <td align=""center"">"
				Response.Write Mesky.FormatMyDate(Rs(15, i), "{Y}/{m}/{d}")
				Response.Write "</td>"
				Response.Write " <td align=""center"">"
				Response.Write Rs(25, i)
				Response.Write "</td>"
				Response.Write " <td align=""center"">"
				If Rs(21, i) = 1 Then
				Response.Write "<font color=blue>顶 </font>"
				Else
				Response.Write "&nbsp;&nbsp;&nbsp;"
				End If
			   If Rs(20, i) = 1 Then
			   Response.Write "<font color=green>荐 </font>"
			   Else
			   Response.Write "&nbsp;&nbsp;&nbsp;"
			   End If
			   If Rs(22, i) = 1 Then
				Response.Write "<font color=red>热 </font>"
			   Else
			   Response.Write "&nbsp;&nbsp;&nbsp;"
			   End If
			   If Rs(7, i) <> "" Then
			   Response.Write "<font color=blue>图 </font>"
			   Else
			   Response.Write "&nbsp;&nbsp;&nbsp;"
			   End If
			   If Rs(23, i) = 1 Then
			   Response.Write "<font color=red>错</font>"
			   Else
			   Response.Write "&nbsp;&nbsp;"
			   End If
			   Response.Write "</td>"
				Response.Write " <td align=""center"">"
				If Rs(24, i) = 1 Then
					Response.Write ("<a href=""?action=unAuditing&ID=" & Rs(0, i) & """><font color=red>√</font></a>")
				 Else
					Response.Write ("<a href=""?action=isAuditing&ID=" & Rs(0, i) & """>待审</a>")
				End If
				Response.Write "</td>"
				Response.Write " <td align=""center"">"
				If checkResAdmin(Rs(25, i)) = True Then
					Response.Write "<a href=""admin_down_resource.asp?action=edit&ID=" & Rs(0, i) & """ title=""修改下载资源信息"">修改</a> "
					Response.Write "<a href=""?action=isDel&ID=" & Rs(0, i) & """ onclick=""{if(confirm('执行此删除操作后该资源不能恢复，确定删除吗？')){return true;}return false;}"">删除</a> "
					If Rs(21, i) = 1 Then
						Response.Write "<a href=""?action=unTop&ID=" & Rs(0, i) & """>解固</a> "
					 Else
						Response.Write "<a href=""?action=isTop&ID=" & Rs(0, i) & """>固顶</a> "
					End If
					If Rs(20, i) = 1 Then
						Response.Write "<a href=""?action=unHot&ID=" & Rs(0, i) & """><font color=red>消</font>荐</a>"
					 Else
						Response.Write "<a href=""?action=isHot&ID=" & Rs(0, i) & """>推荐</a>"
					End If
				 Else
					Response.Write "——"
				End If
				Response.Write "</td>"
				Response.Write " </tr>"
			Next
			Rs = Null
			'Set sqlRs = Nothing
		End If
		
		Response.Write "</table>" & vbCrLf
		Response.Write "    <table width=""100%"" border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"">" & vbCrLf
		Response.Write "        <tr class=""tdbg3""> " & vbCrLf
		Response.Write "            <td><input type=checkbox name=chkall value=on onclick=""CheckAll(this.form)"" id=""chkall""><label for=""chkall"">全选</label><br>管理</td>" & vbCrLf
		Response.Write "            <td colspan=""6""><input type=""radio"" name=""action"" value=""isBatchDel"">批量<font color=red>删除</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""isBatchTop"">批量<font color=blue>置顶</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""unBatchTop"">取消<font color=blue>置顶</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""isBatchHot"">批量<font color=green>推荐</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""unBatchHot"">取消<font color=green>推荐</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""isBatchBest"">批量<font color=red>热门</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""unBatchBest"">取消<font color=red>热门</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""isBatchAuditing"">批量<font color=#aa5555>审核</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""unBatchAuditing"">取消<font color=#aa5555>审核</font>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""AllAuditing""><font color=#aa5555>全审核</font><br>" & vbCrLf
		Response.Write "            <input type=""radio"" name=""action"" value=""isBatchMov"">批量移动:"
		Response.Write "<select name=""catalog"">" & vbCrLf
		
		If Request("catalog") <> "" Then
			Response.Write Mesky.GetCatalogSelect(Split(Request("catalog"), ",")(1), "Mesky_Down_Catalog")
		Else
			Response.Write Mesky.GetCatalogSelect(0, "Mesky_Down_Catalog")
		End If
		Response.Write "</select>"
		Response.Write "     <input type=""submit"" name=""Submit3"" value=""执行操作"" onclick=""{if(confirm('您确定执行的操作吗?')){this.document.myform.submit();return true;}return false;}""> </td>" & vbCrLf
		Response.Write "        </tr>" & vbCrLf
		Response.Write "        <tr class=""tdbg2"">" & vbCrLf
		Response.Write "        <td colspan=""7"">资源属性中的各项含义：<font color=blue>顶</font>——固顶下载，<font color=green>荐</font>——推荐下载，<font color=red>热</font>——热门下载，<font color=blue>图</font>——有下载图片，<font color=red>错</font>——下载地址中有错误链接</td>" & vbCrLf
		Response.Write "        </tr>" & vbCrLf
		Response.Write "        " & vbCrLf
		Response.Write "</table></td>" & vbCrLf
		Response.Write "  </tr>" & vbCrLf
		Response.Write "</form>" & vbCrLf
		Response.Write "</table> " & vbCrLf
		
		Response.Write (showPageRs.showPage("?Page={$pages}" & q))
	
		Set showPageRs = Nothing
		
	End Sub
	Private Sub sForm()
		Response.Write "<table width=""100%"" border=""0"" cellpadding=""3"" cellspacing=""0"">"
		Response.Write "<form action=""admin_down_reslist.asp"" method=""post"" name=""sForm""> "
		Response.Write " <tr>"
		Response.Write " <td height=""3""></td>"
		Response.Write " </tr>"
		Response.Write " <tr class=""tdbg2"">"
		Response.Write " <td><input name=""action"" type=""hidden"" id=""action"" value=""s"">"
		Response.Write " 软件搜索："
		Response.Write " <select name=""sType"">"
		Response.Write " <option value=""ResName"" "
		If Request("sType") = "ResName" Then Response.Write ("selected")
		Response.Write ">资源名称</option>"
		Response.Write " <option value=""ResVer"" "
		If Request("sType") = "ResVer" Then Response.Write ("selected")
		Response.Write ">资源版本</option>"
		Response.Write " <option value=""Content"" "
		If Request("sType") = "Content" Then Response.Write ("selected")
		Response.Write ">资源简介</option>"
		Response.Write " <option value=""UserName"" "
		If Request("sType") = "UserName" Then Response.Write ("selected")
		Response.Write ">添加用户</option>"
		Response.Write " </select>:<select name=""catalog"" id=""catalog"">"
		If Request("catalog") <> "" Then
			Response.Write Mesky.GetCatalogSelect(CLng(Split(Request("catalog"), ",")(1)), "Mesky_Down_Catalog")
		 Else
			Response.Write Mesky.GetCatalogSelect(0, "Mesky_Down_Catalog")
		End If
		Response.Write " </select>:<input name=""keyword"" type=""text"" value="""
		Response.Write Mesky.checkStr(Request("keyword"))
		Response.Write """ size=""25"" maxlength=""100"">"
		Response.Write "<input type=""submit"" name=""Submit"" value=""搜索""></td>"
		Response.Write " </tr></form>"
		Response.Write "</table>"
	End Sub
	Private Sub sMenu()
		Dim tRs
		Response.Write "<table width=""100%"" border=""0"" cellpadding=""3"" cellspacing=""0"" bordercolor=""#FFFFFF"">"
		Response.Write " <tr>"
		Response.Write " <td height=""25"" background=""../images/menubg.gif""> 分类： "
		Response.Write " "
		Set tRs = Mesky.Execute("select RootID,CatalogID,Depth,CatalogName from Mesky_Down_Catalog where depth=0 order by rootid,orders")
		Do While Not tRs.EOF
			Response.Write ("·<a href=""?action=s&sType=ResName&catalog=" & tRs(0) & "," & tRs(1) & "," & tRs(2) & "," & tRs(3) & """>" & tRs(3) & "</a>")
			tRs.MoveNext
		Loop
		Set tRs = Nothing
		Response.Write " </td>"
		Response.Write " </tr>"
		Response.Write "</table>"
	End Sub
	
	Private Sub isBatchDel()
		If BatchID <> "" Then
			Mesky.Execute ("delete from Mesky_Down_Resource where ID in (" & BatchID & ")")
			Mesky.Execute ("delete from Mesky_Down_Address where ResourceID in (" & BatchID & ")")
			Mesky.Execute ("delete from Mesky_Down_Comment where ResourceID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量删除”操作成功！</li>"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub isBatchTop()
		If BatchID <> "" Then
			Mesky.Execute ("update Mesky_Down_Resource set isTop=1 where ID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量固顶”操作成功！"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub unBatchTop()
		If BatchID <> "" Then
			Mesky.Execute ("update Mesky_Down_Resource set isTop=0 where ID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量取消固顶”操作成功！"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub isBatchHot()
		If BatchID <> "" Then
			Mesky.Execute ("update Mesky_Down_Resource set isHot=1 where ID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量推荐”操作成功！"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub unBatchHot()
		If BatchID <> "" Then
			Mesky.Execute ("update Mesky_Down_Resource set isHot=0 where ID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量取消推荐”操作成功！"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub isBatchBest()
		If BatchID <> "" Then
			Mesky.Execute ("update Mesky_Down_Resource set isBest=1 where ID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量热门”操作成功！</li>"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub unBatchBest()
		If BatchID <> "" Then
			Mesky.Execute ("update Mesky_Down_Resource set isBest=0 where ID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量取消热门”操作成功！</li>"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub isBatchAuditing()
		If BatchID <> "" Then
			Mesky.Execute ("update Mesky_Down_Resource set isAuditing=1 where ID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量审核”操作成功！</li>"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub unBatchAuditing()
		If BatchID <> "" Then
			Mesky.Execute ("update Mesky_Down_Resource set isAuditing=0 where ID in (" & BatchID & ")")
			Mesky.strMsg = "<li>“批量取消审核”操作成功！</li>"
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub AllAuditing()
		Mesky.Execute ("update Mesky_Down_Resource set isAuditing=1")
		Mesky.strMsg = "<li>“全部审核”操作成功！</li>"
		Call Mesky.SystemMsg
	End Sub
	Sub isBatchMov()
		If BatchID <> "" Then
			If Trim(Request.Form("catalog")) <> "" Then
				Dim splCatalog
				splCatalog = Split(Trim(Request.Form("catalog")), ",")
				'0=RootID;1=CatalogID;2=Depth;3=CatalogName
				If splCatalog(2) > 0 Then
					Conn.Execute ("update Mesky_Down_Resource set RootID=" & splCatalog(0) & ",CatalogID=" & splCatalog(1) & ",Depth=" & splCatalog(2) & ",CatalogName='" & splCatalog(3) & "' where ID in (" & BatchID & ")")
					Mesky.strMsg = "<li>“批量移动”操作成功！</li>"
				Else
					Mesky.strMsg = "<li>不能转移到一级分类下，本次操作被取消！</li>"
				End If
			Else
				Mesky.strMsg = "<li>没有选择资源分类，本次操作被取消。</li>"
			End If
		Else
			Mesky.strMsg = "<li>没有选择任何软件，本次操作被取消！</li>"
		End If
		Call Mesky.SystemMsg
	End Sub
	Sub isDel() '单个删除
		If sID <> "" Then
			Mesky.Execute ("delete from Mesky_Down_Resource where ID=" & sID & "")
			Mesky.Execute ("delete from Mesky_Down_Address where ResourceID=" & sID & "")
			Mesky.Execute ("delete from Mesky_Down_Comment where ResourceID=" & sID & "")
			'Mesky.strMsg = "<li>“批量删除”操作成功！</li>"
		End If
		Response.Redirect Mesky.RefererPage
	End Sub
	Sub isAuditing() '单个审核
		If sID <> "" Then Mesky.Execute ("update Mesky_Down_Resource set isAuditing=1 where ID=" & sID & "")
		Response.Redirect Mesky.RefererPage
	End Sub
	Sub unAuditing() '取消审核
		If sID <> "" Then Mesky.Execute ("update Mesky_Down_Resource set isAuditing=0 where ID=" & sID & "")
		Response.Redirect Mesky.RefererPage
	End Sub
	Sub isTop() '置顶
		If sID <> "" Then Mesky.Execute ("update Mesky_Down_Resource set isTop=1 where ID=" & sID & "")
		Response.Redirect Mesky.RefererPage
	End Sub
	Sub unTop() '取消置顶
		If sID <> "" Then Mesky.Execute ("update Mesky_Down_Resource set isTop=0 where ID=" & sID & "")
		Response.Redirect Mesky.RefererPage
	End Sub
	Sub isHot() '批量推荐
		If sID <> "" Then Mesky.Execute ("update Mesky_Down_Resource set isHot=1 where ID=" & sID & "")
		Response.Redirect Mesky.RefererPage
	End Sub
	Sub unHot() '批量取消推荐
		If sID <> "" Then Mesky.Execute ("update Mesky_Down_Resource set isHot=0 where ID=" & sID & "")
		Response.Redirect Mesky.RefererPage
	End Sub
	Sub isBest() '批量精品
		If sID <> "" Then Mesky.Execute ("update Mesky_Down_Resource set isBest=1 where ID=" & sID & "")
		Response.Redirect Mesky.RefererPage
	End Sub
	Sub unBest() '批量取消精品
		If sID <> "" Then Mesky.Execute ("update Mesky_Down_Resource set isBest=0 where ID=" & sID & "")
		Response.Redirect Mesky.RefererPage
	End Sub
	Function checkResAdmin(sName)
		checkResAdmin = True
	End Function
	
	Public Sub OnEndPage()
		Response.Write Mesky.CopyRight
	End Sub ' OnEndPage

End Class %>