<!--#include file="setup.asp"-->
<!--#include file="../inc/Create_SoftwareCls.Asp"-->
<!--#include file="../inc/NC_HtmlEditCls.Asp" -->
<%
Dim isEdit
Dim Rs1
Dim Rs2
Dim softTitle
Dim SortName
Dim sortid
Dim rootid
Dim selSoftid
Dim SiteRs
Dim pubSoftID
Dim strSortid
Dim totalPut
Dim strSortName
Dim j
Dim TxtContent
Dim keyword
Dim findword
Dim ii
Dim datNowTime
Dim ParentID
Dim strParent
Dim Child
Dim depth
Dim maxperpage
Dim CurrentPage
Dim totalnumber
Dim TotalPageNum
Dim i
Dim n
Dim pagestart
Dim pageend
Dim maxpagecount
Dim ArraySoftid
Dim selSortid
Dim pagination
Dim GotoPageType
Dim SoftBody
Dim WhereSQL
Server.ScriptTimeout = 9999
NC_Admin.AdminChk = "11"
NC_Admin.Check
DownsysClass.admin_header
pagination = 0
GotoPageType = 0
Set Rs = Server.CreateObject("adodb.recordset")
Set Rs1 = Server.CreateObject("adodb.recordset")
Set Rs2 = Server.CreateObject("adodb.recordset")
Set SiteRs = Server.CreateObject("adodb.recordset")
Select Case Trim(Request("action"))
	Case "add"
		isEdit = False
		Call setclass(isEdit)
	Case "edit"
		isEdit = True
		Call setclass(isEdit)
	Case "save"
		Call saveAdd
	Case "modify"
		Call savemodify
	Case "delsite"
		Call delsite
	Case Else
		Call SoftMain
End Select
If Founderr = True Then
	NC_Admin.Error_Msg (ErrMsg)
End If
DownsysClass.admin_footer
NothingObject

Private Sub SoftMain()
	Dim srtSortingMenu
	Dim bookmark
	Dim srtSortingList
	If Not IsEmpty(Request("selSoftid")) Then
		ArraySoftid = Request("selSoftid")
		ArraySoftid = Split(ArraySoftid, "||")
		selSoftid = ArraySoftid(0)
		selSortid = Request("selSoftid")
		Select Case Request("action")
			Case "del"
				Call batdel
			Case "dele"
				Call batdele
			Case "move"
				Call batmove
			Case "isCommend"
				Call isCommend
			Case "noCommend"
				Call noCommend
			Case "indate"
				Call upindate
			Case "CreateHtml"
				Call BatCreateHtml
			Case "istop"
				Call isTop
			Case "notop"
				Call noTop
			Case Else
				Response.Write "无效参数！"
				Response.Write
		End Select
	End If
	Response.Write "<script language=""JavaScript"">" & vbCrLf
	Response.Write "<!--//" & vbCrLf
	Response.Write "function SelectAll() {" & vbCrLf
	Response.Write Chr(9) & "for (var i=0;i<document.selform.selSoftid.length;i++) {" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "var e=document.selform.selSoftid[i];" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "e.checked=!e.checked;" & vbCrLf
	Response.Write Chr(9) & "}" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "//-->" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script language=""JavaScript"">" & vbCrLf
	Response.Write "<!--//" & vbCrLf
	Response.Write "function Juge(myform)" & vbCrLf
	Response.Write "{" & vbCrLf
	Response.Write "if (myform.keyword.value == """")" & vbCrLf
	Response.Write Chr(9) & "{" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "alert(""请输入要查询的关键字!"");" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "myform.keyword.focus();" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "return (false);" & vbCrLf
	Response.Write Chr(9) & "}" & vbCrLf
	Response.Write "}" & vbCrLf
	Response.Write "//-->" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<table border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"" class=""tableBorder"">"
	Response.Write " <tr>"
	Response.Write " <th colspan=""5"">软件管理</th></tr>"
	Response.Write " <tr><form method=Post name=""myform"" action=""admin_software.asp"" onSubmit=""return Juge(this)"">"
	Response.Write " <td class=forumrow height=""22"" colspan=""5"">"
	Response.Write "查询： <input align=""absmiddle"" name=""keyword"" type=""text"" id=""keyword"" size=""30""> &nbsp;查询方法:"
	Response.Write " <select size=""1"" name=""key"">"
	Response.Write " <option value=""topic"">软件名称</option>"
	Response.Write " <option value=""body"">软件说明</option>"
	Response.Write " <option value="""">不限条件</option>"
	Response.Write " </select>"
	Response.Write " <input type=""submit"" name=""Submit"" align=""absmiddle"" value=""查 询..."" class=button>"
	Response.Write " </td></tr></form>"
	Response.Write " <tr>"
	Response.Write " <th nowrap>选择</th><th width=""70%"">软件标题　"
	srtSortingMenu = SortingJumpMenu
	srtSortingMenu = Replace(srtSortingMenu, "{SortID=" & Request("clasid") & "}", "selected")
	Response.Write srtSortingMenu
	Response.Write "</th><th nowrap>修改软件</th><th nowrap>推 荐</th><th nowrap>整理时间</th></tr>"
	If Request("clasid") <> "" Then
		SQL = "select sortid,SortName,rootid,depth,ParentID,strParent,Child from [NC_SoftSort] where sortid = " & Request("clasid")
		Rs.Open SQL, Conn, 1, 1
		DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
		If Rs.bof And Rs.EOF Then
			Response.Write "Sorry！没有找到任何软件信息。或者您选择了错误的系统参数!"
			Response.End
		Else
			strSortName = Rs("SortName")
			sortid = Rs("sortid")
			rootid = Rs("rootid")
			depth = Rs("depth")
			ParentID = Rs("ParentID")
			strParent = Rs("strParent")
			Child = Rs("Child")
		End If
		Rs.Close
	Else
		strSortName = "全部软件"
	End If
	keyword = Server.HTMLEncode(Request("keyword"))
	maxperpage = 20 '###每页显示数
	If Not IsNumeric(Request("page")) And Len(Request("page")) <> 0 Then
		Response.Write "错误的系统参数!请输入整数"
		Response.End
	End If
	If Not IsEmpty(Request("page")) And Len(Request("page")) <> 0 Then
		CurrentPage = CInt(Request("page"))
	Else
		CurrentPage = 1
	End If
	If CInt(CurrentPage) = 0 Then CurrentPage = 1
	If Not IsNull(keyword) And keyword <> "" Then
		keyword = Replace(Replace(Replace(keyword, "'", "‘"), "<", "&lt;"), ">", "&gt;")
		If Request("key") = "topic" Then
			findword = "where softname like '%" & keyword & "%' and isLock=0"
		ElseIf Request("key") = "body" Then
			findword = "where content like '%" & keyword & "%' and isLock=0"
		Else
			findword = "where softname like '%" & keyword & "%' or content like '%" & keyword & "%' and isLock=0"
		End If
		WhereSQL = findword
	Else
		If Request("clasid") <> "" Then
			If depth <> 0 Then
				Dim Rss, AllSortID,ParentStr
				Set Rss = DownsysClass.Execute("select * from NC_SoftSort where strParent like '%"& sortid &"%'")
				If Rss.EOF And Rss.bof Then
					AllSortID = sortid
				Else
					Do While Not Rss.EOF
						ParentStr = Split(Rss("strParent"), ",")
						For i = 0 To UBound(ParentStr)
							If CLng(ParentStr(i)) = sortid Then
								AllSortID = AllSortID & Rss("sortid") &","
								Exit For
							End If
						Next
						Rss.movenext
					Loop
					AllSortID = AllSortID & sortid
				End If
				Rss.Close
				Set Rss = Nothing
				WhereSQL = "where isLock=0 and sortid in (" & AllSortID & ")"
			Else
				WhereSQL = "where isLock=0 and rootid=" & rootid & ""
			End If
		Else
			WhereSQL = "where isLock=0"
		End If
	End If
	TotalNumber = Conn.Execute("Select count(softid) from [NC_SoftInfo] "& WhereSQL &"")(0)
	TotalPageNum = CInt(TotalNumber / maxperpage)  '得到总页数
	If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
	If CurrentPage < 1 Then CurrentPage = 1
	If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
	SQL = "select * from NC_SoftInfo "& WhereSQL &" order by isTop desc,softTime desc,softid desc"
	Rs.Open SQL, Conn, 1
	DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
	If Rs.bof And Rs.EOF Then
		Response.Write "<tr><td colspan=5 class=forumrow>还没有找到任何软件！</td></tr>"
	Else
		If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
		i = 0
		j = (CurrentPage - 1) * maxperpage + 1
		Response.Write " <tr>"
		Response.Write " <td height=""22"" colspan=""5"" class=""forumRowHighlight"">"
		Call showpage
		Response.Write "</td>"
		Response.Write Chr(9) & "</tr>"
		Response.Write "<form name=""selform"" method=""post"" action="""">"
		Do While Not Rs.EOF And i < CInt(maxperpage)
			Response.Write " <tr>"
			Response.Write " <td class=forumrow nowrap align=""center""><input type=""checkbox"" name=""selSoftid"" value="""
			Response.Write Rs("softid")
			Response.Write """ title='"
			Response.Write j
			Response.Write "'>"
			Response.Write j
			Response.Write "</td>"
			Response.Write " <td height=""22"" class=""forumrow"">"
			If Rs("istop") = 0 Or Rs("istop") = Empty Then
				Response.Write "<IMG SRC=""images/folder.gif"" WIDTH=""16"" HEIGHT=""16"" BORDER=0 ALT=""开放的软件"">"
			Else
				Response.Write "<IMG SRC=""images/istop.gif"" WIDTH=""15"" HEIGHT=""17"" BORDER=0 ALT=""置顶的软件"">"
			End If
			Response.Write Chr(9) & " [<a href=?clasid="
			Response.Write Rs("sortid")
			Response.Write ">"
			Response.Write Rs("SortName")
			Response.Write "</a>] <a href='"
			If CInt(DownsysClass.Setting(5)) = 0 Then
				Response.Write "../software/catalog"
				Response.Write Rs("sortid")
				Response.Write "/"
				Response.Write Rs("softid")
				Response.Write ".html"
			Else
				Response.Write "../software.asp?id="
				Response.Write Rs("softid")
			End If
			Response.Write "' target=_blank>"
			Response.Write Rs("softname")
			Response.Write " "
			Response.Write Rs("softver")
			Response.Write "</a>"
			If Rs("isMember") <> 0 Then Response.Write "<IMG SRC=""images/vip.gif"" WIDTH=""12"" HEIGHT=""11"" BORDER=0 ALT=""会员软件"">"
			Response.Write Chr(9) & Chr(9) & " </td>"
			Response.Write " <td class=forumrow align=""center""><a href=?action=edit&softid="
			Response.Write Rs("softid")
			Response.Write "&sortid="
			Response.Write Rs("sortid")
			Response.Write ">编 辑</a></td>"
			Response.Write " <td class=forumrow align=""center"">"
			Response.Write Chr(9) & " "
			If Rs("isCommend") = 0 Then
				Response.Write Chr(9) & " <IMG SRC=""images/folder.gif"" WIDTH='16' HEIGHT='16' BORDER=0 ALT='开放软件'>"
				Response.Write Chr(9) & " "
			Else
				Response.Write Chr(9) & " <IMG SRC='images/jing.gif' WIDTH='18' HEIGHT='18' BORDER=0 ALT='推荐软件'>"
				Response.Write Chr(9) & " "
			End If
			Response.Write "</td>"
			Response.Write " <td class=forumrow align=""center"" nowrap>"
			If Rs("softTime") >= Date Then
				Response.Write "<font color=""#FF3300"">"
				Response.Write FormatDateTime(Rs("softTime"), 2)
				Response.Write "</font>"
			Else
				Response.Write FormatDateTime(Rs("softTime"), 2)
			End If
			Response.Write "</td></tr>"
			Rs.movenext
			i = i + 1
			j = j + 1
			If i >= maxperpage Then Exit Do
		Loop
	End If
	Rs.Close
	Response.Write " <tr>"
	Response.Write " <td height=""22"" class=""forumrow"">管理</td>"
	Response.Write " <td height=""22"" colspan=""3"" class=""forumrow""><a href=""javascript:SelectAll()"">全选/反选</a><input type=""checkbox"" name=""checkbox"" value=""checkbox"" onClick=""javascript:SelectAll()"">"
	Response.Write " <input type=""radio"" name=""action"" value=""move"">批量移动 ->"
	srtSortingList = DownsysClass.SortingJumpList
	srtSortingList = Replace(srtSortingList, "{SortID=" & Request("sortid") & "}", "selected")
	Response.Write srtSortingList
	Response.Write " "
	If CInt(DownsysClass.Setting(5)) = 0 Then Response.Write "<input type=""radio"" name=""action"" value=""CreateHtml"">批量生成(HTML)"
	Response.Write "　<BR>"
	Response.Write "<BR style=""OVERFLOW: hidden; LINE-HEIGHT: 5px"">"
	Response.Write Chr(9) & "<input type=""radio"" name=""action"" value=""del"">彻底删除"
	Response.Write Chr(9) & "<input type=""radio"" name=""action"" value=""dele"">放入回收站"
	Response.Write Chr(9) & "<input type=""radio"" name=""action"" value=""isCommend"">设置推荐"
	Response.Write Chr(9) & "<input type=""radio"" name=""action"" value=""noCommend"">取消推荐"
	Response.Write Chr(9) & "<input type=""radio"" name=""action"" value=""istop"">软件置顶"
	Response.Write Chr(9) & "<input type=""radio"" name=""action"" value=""notop"">取消置顶"
	Response.Write Chr(9) & "<input type=""radio"" name=""action"" value=""indate"">更新时间"
	Response.Write "</td>"
	Response.Write " <td height=""22"" class=""forumrow""><input type=""submit"" name=""Submit"" value=""执行操作"" class=button onclick=""{if(confirm('您确定执行的操作吗?')){this.document.selform.submit();return true;}return false;}""></td>"
	Response.Write " </tr></form>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" colspan=""5"" class=""forumRowHighlight"">"
	Call showpage
	Response.Write "</td></tr>"
	Response.Write "</table>"
End Sub

Private Sub setclass(isEdit)
	Dim NC_HtmlEdit
	Dim srtSortingList
	Dim RunSystem
	Dim SoftType
	Dim Re
	Set NC_HtmlEdit = New HtmlEditor_Cls
	If isEdit Then
		SQL = "select * from NC_SoftInfo where softid=" & Request("softid")
		Rs.Open SQL, Conn, 1, 1
		DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
		sortid = CStr(Rs("sortid"))
		rootid = CStr(Rs("rootid"))
		softTitle = "编辑软件"
		If CInt(DownsysClass.Setting(19)) = 1 Then
			SoftBody = Server.HTMLEncode(Rs("Content"))
		Else
			SoftBody = Rs("Content")
		End If
		Set Re = New RegExp
		Re.IgnoreCase =true
		Re.Global=True
		Re.Pattern="\[br\]"
		SoftBody = Re.Replace(SoftBody,"")
		Re.Pattern="\[align=right\](.*)\[\/align\]"
		SoftBody = Re.Replace(SoftBody,"")
		Set Re = Nothing
	Else
		softTitle = "添加软件"
	End If
	Response.Write "<script language=""javascript"">" & vbCrLf
	Response.Write "<!--//" & vbCrLf
	Response.Write Chr(9) & "function ToRunsystem(addTitle) {" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "var revisedTitle;" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "var currentTitle;" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "currentTitle = document.myform.RunSystem.value;" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "revisedTitle = currentTitle+addTitle;" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "document.myform.RunSystem.value=revisedTitle;" & vbCrLf
	Response.Write Chr(9) & Chr(9) & "document.myform.RunSystem.focus();" & vbCrLf
	Response.Write Chr(9) & "return; }" & vbCrLf
	Response.Write "//-->" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script src=images/checksave.js type=text/javascript></script>"
	Response.Write "<div onkeydown=CtrlEnter()>"
	Response.Write "<table border=""0"" align=""center"" cellpadding=""3"" cellspacing=""1"" class=""tableBorder"">"
	Response.Write "<form name=""myform"" method=""post"" action=""admin_software.asp"" onSubmit=""return CheckSoft(this)"">"
	Response.Write " <input type=""Hidden"" name=""action"" value='"
	If isEdit Then
		Response.Write "modify"
	Else
		Response.Write "save"
	End If
	Response.Write "'>"
	Response.Write Chr(9) & Chr(9) & " "
	If CInt(DownsysClass.Setting(19)) = 1 Then
		Response.Write Chr(9) & Chr(9) & " <input type=""hidden"" name=""content1"" id=body value="""
		If isEdit Then
			Response.Write SoftBody
		End If
		Response.Write """>"
		Response.Write Chr(9) & Chr(9) & " "
	End If
	Response.Write " "
	If isEdit Then
		Response.Write " <input type=""Hidden"" name=""softid"" value='"
		Response.Write CStr(Request("softid"))
		Response.Write "'>"
		Response.Write " "
	End If
	Response.Write " <tr>"
	Response.Write " <th colspan=""2"">"
	Response.Write softTitle
	Response.Write " 注意事项</th>"
	Response.Write " </tr>"
	Response.Write "<tr>"
	Response.Write "<td colspan=""2"" class=""forumRowHighlight"">"
	Response.Write "<p><B>注意</B>：<BR>①添加软件时请先选择分类，不能选择一级分类做为软件分类；<BR>"
	Response.Write "②添加或者修改软件简介时需要HTML语法支持，请在基本设置开启HTML编辑器，文本编辑器会过滤所有的HTML标签；如果您以前添加的软件简介使用了HTML编辑器，请修改的时候一定要使用HTML编辑器；<BR>"
	Response.Write "③HTML编辑器和文本编辑器都不支持UBB代码。"
	Response.Write "</td>"
	Response.Write "</tr>"
	Response.Write " <tr>"
	Response.Write " <th colspan=""2"">"
	Response.Write softTitle
	Response.Write "</th>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td width=""15%"" height=""22"" align=""right"" nowrap class=""forumRowHighlight"">软件分类：</td>"
	Response.Write " <td width=""85%"" class=""forumRow"">"
	srtSortingList = DownsysClass.SortingJumpList
	srtSortingList = Replace(srtSortingList, "{SortID=" & Request("sortid") & "}", "selected")
	Response.Write srtSortingList
	Response.Write Chr(9) & " </td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">软件名称：</td>"
	Response.Write " <td class=""forumRow""><input name=""softname"" type=""text"" size=""40"" value='"
	If isEdit Then
		Response.Write Rs("softname")
	End If
	Response.Write "'> 版本: <input name=""softver"" type=""text"" size=""20"" value="""
	If isEdit Then
		Response.Write Rs("softver")
	End If
	Response.Write """></td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">运行环境：</td>"
	Response.Write " <td class=""forumRow""><input name=""RunSystem"" type=""text"" size=""50"" value="""
	If isEdit Then
		Response.Write Rs("RunSystem")
	Else
		Response.Write DownsysClass.Setting(45)
	End If
	Response.Write """><BR>"
	RunSystem = Split(DownsysClass.Setting(34), ",")
	For i = 0 To UBound(RunSystem)
		Response.Write "<a href='javascript:ToRunsystem(""" & Trim(RunSystem(i)) & """)'><u>" & Trim(RunSystem(i)) & "</u></a> | "
		If i = 7 Then Response.Write "<br>"
	Next
	Response.Write "</td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">软件类型：</td>"
	Response.Write " <td class=""forumRow"">"
	SoftType = Split(DownsysClass.Setting(35), ",")
	For i = 0 To UBound(SoftType)
		Response.Write "<input type=""radio"" name=""SoftType"" value=""" & Trim(SoftType(i)) & """ "
		If isEdit Then
			If SoftType(i) = Rs("SoftType") Then Response.Write " checked"
		Else
			If i = 0 Then Response.Write " checked"
		End If
		Response.Write ">" & Trim(SoftType(i)) & " "
		If i = 6 Then Response.Write "<br>"
	Next
	Response.Write "</td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">界面预览：</td>"
	Response.Write " <td class=""forumRow""><input id=image2 name=""PreviewImg"" type=""text"" size=""40"" value="""
	If isEdit Then
		Response.Write Rs("PreviewImg")
	End If
	Response.Write """><font color=""#808080""> 软件界面预览图片，大小不定</font></td>"
	Response.Write " </tr"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">缩略图：</td>"
	Response.Write " <td class=""forumRow""><input id=image1 name=""Softimg"" type=""text"" size=""30"" value="""
	If isEdit Then
		Response.Write Rs("softimg")
	End If
	Response.Write """><font color=""#808080""> 软件的缩略图，建议大小为：120×95 px</font></td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td colspan=2 class=""forumRow""><iframe name=""image"" frameborder=0 width='100%' height='42' scrolling=no src=upfile.asp?type=image&upnum=2></iframe></td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">软件大小：</td>"
	Response.Write " <td class=""forumRow""> <input type=""text"" name=""SoftSize"" size=""14"" onkeyup=if(isNaN(this.value))this.value='' value='"
	If isEdit Then
		Response.Write Trim(Rs("SoftSize"))
	End If
	Response.Write "'> <input name=""SizeUnit"" type=""radio"" value=""KB"" checked>"
	Response.Write " KB"
	Response.Write " <input type=""radio"" name=""SizeUnit"" value=""MB"">"
	Response.Write " MB <font color=""#FF0000"">！</font>"
	Response.Write " 解压密码:<input type=""text"" name=""Decode"" size=""15"" maxlength=""100"" value='"
	If isEdit Then
		Response.Write Trim(Rs("Decode"))
	End If
	Response.Write "'> <font color=""#808080"">没有请留空</font> </td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" nowrap class=""forumRowHighlight"">授权方式：</td>"
	Response.Write " <td class=""forumRow"" nowrap> <select name=""impower"">"
	Response.Write " "
	If isEdit Then
		Response.Write "<option value=""" & Rs("impower") & """>" & Rs("impower") & "</option>"
	End If
	Dim ImpowerStr
	ImpowerStr = Split(DownsysClass.Setting(46), ",")
	For i = 0 To UBound(ImpowerStr)
		Response.Write " <option value=""" & ImpowerStr(i) & """>" & ImpowerStr(i) & "</option>"
	Next
	Response.Write " </select>&nbsp;&nbsp;"
	Response.Write " 软件语言: <select name=""Language"">"
	Response.Write " "
	If isEdit Then
		Response.Write "<option value=""" & Rs("Language") & """>" & Rs("Language") & "</option>"
	End If
	Dim LanguageStr
	LanguageStr = Split(DownsysClass.Setting(47), ",")
	For i = 0 To UBound(LanguageStr)
		Response.Write " <option value=""" & LanguageStr(i) & """>" & LanguageStr(i) & "</option>"
	Next
	Response.Write " </select>&nbsp;&nbsp;"
	Response.Write " 软件等级: <select name=""Grades"" size=""1"">"
	Response.Write " "
	If isEdit Then
		Response.Write " <option value=""1"" name=""Grades"" "
		If Trim(Rs("Grades")) = "1" Then
			Response.Write "selected"
		End If
		Response.Write ">一星级</option>"
		Response.Write " <option value=""2"" name=""Grades"" "
		If Trim(Rs("Grades")) = "2" Then
			Response.Write "selected"
		End If
		Response.Write ">二星级</option>"
		Response.Write " <option value=""3"" name=""Grades"" "
		If Trim(Rs("Grades")) = "3" Then
			Response.Write "selected"
		End If
		Response.Write ">三星级</option>"
		Response.Write " <option value=""4"" name=""Grades"" "
		If Trim(Rs("Grades")) = "4" Then
			Response.Write "selected"
		End If
		Response.Write ">四星级</option>"
		Response.Write " <option value=""5"" name=""Grades"" "
		If Trim(Rs("Grades")) = "5" Then
			Response.Write "selected"
		End If
		Response.Write ">五星级</option>"
		Response.Write " "
	Else
		Response.Write " <option value=""1"">一星级</option>"
		Response.Write " <option value=""2"">二星级</option>"
		Response.Write " <option value=""3"" selected>三星级</option>"
		Response.Write " <option value=""4"">四星级</option>"
		Response.Write " <option value=""5"">五星级</option>"
		Response.Write " "
	End If
	Response.Write " </select>"
	Response.Write "</td>"
	Response.Write " </tr>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">联系作者：</td>"
	Response.Write " <td class=""forumRow""><input name=""Contact"" type=""text"" size=""25"" "
	If isEdit Then
		Response.Write "value="""
		Response.Write Rs("Contact")
		Response.Write """"
	End If
	Response.Write ">"
	Response.Write " 作者主页: <input name=""Homepage"" type=""text"" size=""30"" "
	If isEdit Then
		Response.Write "value="""
		Response.Write Rs("Homepage")
		Response.Write """"
	End If
	Response.Write ">"
	Response.Write "</td>"
	Response.Write " </tr>"
	Response.Write "<TR height=""22"">"
	Response.Write Chr(9) & "<TD colspan=4 align=center class=forumHeaderBackgroundAlternate><B>"
	If CInt(DownsysClass.Setting(19)) = 1 Then
		Response.Write "HTML编辑器 (不支持UBB代码)"
	Else
		Response.Write "您现在使用的编辑器不支持HTML语法，如果需要HTML语法支持，请在基本设置开启HTML编辑器。"
	End If
	Response.Write " </B></fort></td>"
	Response.Write "</TR>"
	Response.Write "<TR height=""22"">"
	Response.Write Chr(9) & "<TD colspan=4 class=forumRow>"
	If CInt(DownsysClass.Setting(19)) = 1 Then
		NC_HtmlEdit.Init_HtmlEdit
	Else
		Response.Write Chr(9) & "<textarea name=content1 style=""width:100%;"" rows=12>"
		If isEdit Then
			Response.Write SoftBody
		End If
		Response.Write "</textarea>"
	End If
	Response.Write "</TD>"
	Response.Write "</TR>"
	Response.Write " <tr height=""22"">"
	Response.Write " <td align=""right"" noWrap class=""forumRowHighlight"">是否推荐置顶：</td>"
	Response.Write " <td class=""forumRow""> <input name=""isCommend"" type=""radio"" value=""0"" "
	If isEdit Then
		If CInt(Rs("isCommend")) = 0 Then
			Response.Write "checked"
		End If
	Else
		Response.Write "checked"
	End If
	Response.Write ">"
	Response.Write " 不推荐　<input type=""radio"" name=""isCommend"" value=""1"" "
	If isEdit Then
		If CInt(Rs("isCommend")) = 1 Then
			Response.Write "checked"
		End If
	End If
	Response.Write ">"
	Response.Write " 软件推荐　<input name=""isTop"" type=""radio"" value=""0"" "
	If isEdit Then
		If CInt(Rs("isTop")) = 0 Then
			Response.Write "checked"
		End If
	Else
		Response.Write "checked"
	End If
	Response.Write ">"
	Response.Write " 不置顶　<input type=""radio"" name=""isTop"" value=""1"" "
	If isEdit Then
		If CInt(Rs("isTop")) = 1 Then
			Response.Write "checked"
		End If
	End If
	Response.Write ">"
	Response.Write " 软件置顶　</td>"
	Response.Write " </tr>"
	Response.Write " <tr height=""22"">"
	Response.Write " <td align=""right"" class=""forumRowHighlight"">会员软件设置：</td>"
	Response.Write " <td class=""forumRow""> <select name=""isMember"" size=""1"">"
	Set Rs1 = DownsysClass.Execute("select * from NC_UserGroup order by groupid")
	Do While Not Rs1.EOF
		Response.Write "<option value="""
		Response.Write Rs1("Grades")
		Response.Write """ "
		If isEdit Then
			If Trim(Rs("isMember")) = "" & Rs1("Grades") & "" Then
				Response.Write "selected"
			End If
		End If
		Response.Write ">"
		Response.Write Rs1("GroupName")
		Response.Write "</option>"
		Rs1.movenext
	Loop
	Rs1.Close
	Set Rs1 = Nothing
	Response.Write " </select>&nbsp;&nbsp;"
	Response.Write "下载软件所需的点数：<input name=""MoneyNum"" type=""text"" size=""6"" value="""
	If isEdit Then
		Response.Write Rs("MoneyNum")
	Else
		Response.Write "0"
	End If
	Response.Write """>&nbsp;&nbsp;"
	If isEdit Then
		Response.Write "<input name=""updateTime"" type=""checkbox"" value=""yes"">更新时间"
	End If
	If CInt(DownsysClass.Setting(5)) = 0 Then Response.Write "<input type=checkbox name='isCreateHtml' value='yes' checked> 同时生成（HTML）"
	Response.Write "</td>"
	Response.Write " </tr>"
	If isEdit Then
		Response.Write " <tr height=""22"">"
		Response.Write " <td colspan=""4"" class=""forumRow"">"
		SQL = "select * from NC_softsite where SoftID=" & Request("SoftID")
		SiteRs.Open SQL, Conn, 1, 1
		If SiteRs.EOF And SiteRs.bof Then
			Response.Write "目前还没有添加任何下载连接！"
		Else
			totalPut = SiteRs.recordcount
			i = 1
			Do While Not SiteRs.EOF
				Response.Write "<input type=""text"" name=""stRsiteName" & i & """ value=""" & SiteRs("SiteName") & """ size=12>&nbsp;"
				SelDownServer SiteRs("serverid"), "server" & i
				Response.Write "&nbsp;URL：<input type=""text"" name=""strDownSite" & i & """ size=35 value=""" & SiteRs("DownSite") & """> "
				Response.Write "[<a href=""admin_software.asp?action=delsite&id=" & SiteRs("id") & "&SoftID=" & Request("SoftID") & """ onclick=""{if(confirm('您确定要删除该连接吗?')){this.document.myform.submit();return true;}return false;}"">删 除</a>]<BR>"
				Response.Write "<input name=""ID" & i & """ type=""hidden"" value=""" & SiteRs("ID") & """>"
				i = i + 1
				SiteRs.movenext
			Loop
		End If
		SiteRs.Close
		Response.Write "<input name=""totalPut"" type=""hidden"" id=""totalPut"" value=""" & totalPut & """>"
		Response.Write " </td></tr>"
	End If
	Response.Write " <tr height=""22"">"
	Response.Write " <td colspan=""2"" class=""forumRow"">"
	Response.Write " <script language=""javascript"">" & vbCrLf
	Response.Write Chr(9) & " function setid()" & vbCrLf
	Response.Write Chr(9) & " {" & vbCrLf
	Response.Write Chr(9) & " str='';" & vbCrLf
	Response.Write Chr(9) & " if(!window.myform.no.value)" & vbCrLf
	Response.Write Chr(9) & " window.myform.no.value=1;" & vbCrLf
	Response.Write " " & Chr(9) & " for(i=1;i<=window.myform.no.value;i++)" & vbCrLf
	Response.Write Chr(9) & " str+=''+'<input type=""text"" name=""SiteName'+i+'"" value=""下载地址'+i+'"" size=12>&nbsp;URL：<input type=""text"" name=""DownSite'+i+'"" size=40 value="""">&nbsp;"
	i = "'+i+'"
	SelDownServer 0, "serverid" & i
	Response.Write "<BR>';" & vbCrLf
	Response.Write Chr(9) & " window.upid.innerHTML=str+' <font color=red>* 如果选择了下载服务器，请根据相应的下载地址输入软件名称，前面请不要添加“/”。</font>';" & vbCrLf
	Response.Write Chr(9) & " }" & vbCrLf
	Response.Write Chr(9) & " </script>设置添加地址的数量:&nbsp;<input type=""text"" name=""no"" value=""1"" size=2>&nbsp;&nbsp;<input type=""button"" name=""Button"" class=button onclick=""setid();"" value=""添加下载地址数"">"
	Response.Write " <font color=red>* 如果没有选择下载服务器请输入完整的下载路径</font> "
	Response.Write " </td>"
	Response.Write " </tr>"
	Response.Write " <tr height=""22"">"
	Response.Write " <td colspan=""2"" id=""upid"" class=""forumRow""> </td>"
	Response.Write " </tr>"
	Response.Write " <tr>"
	Response.Write " <td colspan=2 class=""forumRow""><iframe name=""ad"" frameborder=0 width=""100%"" height=42 scrolling=no src=upfile.asp?type=file></iframe> </td></tr>"
	Response.Write " <tr>"
	Response.Write " <td height=""22"" align=""right"" class=""forumRowHighlight"">&nbsp;</td>"
	Response.Write " <td align=""center"" class=""forumRow"">"
	Response.Write " <input type=button class=button value=""查看内容长度"" name=Button onclick=""checklength(document.myform);"">&nbsp;&nbsp;"
	Response.Write " <input type=reset name=Submit2 class=button value=""清 除"" onclick=""ClearReset()"">&nbsp;&nbsp;"
	Response.Write " <input type=Submit class=button value=""提 交"" name=Submit>&nbsp;&nbsp;"
	Response.Write " </td>"
	Response.Write " </tr>"
	Response.Write "</form>"
	Response.Write "</table>"
	Response.Write "</div>"
	If CInt(DownsysClass.Setting(19)) = 0 Then
		Response.Write "<Script language=javascript>" & vbCrLf
		Response.Write "<!--//" & vbCrLf
		Response.Write "document.myform.content1.value = ubbcode(document.myform.content1.value);" & vbCrLf
		Response.Write "function ubbcode(temp) {" & vbCrLf
		Response.Write "temp = temp.replace(/<br>/ig,""\n"");" & vbCrLf
		Response.Write "temp = temp.replace(/<p>/ig,""\n"");" & vbCrLf
		Response.Write "temp = temp.replace(/<\/p>/ig,""\n"");" & vbCrLf
		Response.Write "return (temp);" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "function ClearReset()" & vbCrLf
		Response.Write "{" & vbCrLf
		Response.Write " document.myform.content1.value = '';" & vbCrLf
		Response.Write " focus();" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "function checklength(theform)" & vbCrLf
		Response.Write "{" & vbCrLf
		Response.Write " alert(""您的内容目前有 ""+theform.content1.value.length+"" 字节。"");" & vbCrLf
		Response.Write "}" & vbCrLf
		Response.Write "//-->" & vbCrLf
		Response.Write "</Script>" & vbCrLf
	End If
	Set NC_HtmlEdit = Nothing
	If isEdit Then
		Rs.Close
		Set Rs = Nothing
	End If

End Sub


Private Sub checksave()
	If Len(Request.Form("softname")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>软件名称不能为空！</li>"
		Exit Sub
	End If
	If Len(Request.Form("sortid")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>软件分类不能为空！</li>"
		Exit Sub
	Else
		strSortid = Split(Trim(Request.Form("sortid")), ",")
	End If
	If Len(Request.Form("content1")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>软件简介不能为空！</li>"
		Exit Sub
	End If
	If Len(Request.Form("RunSystem")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>运行环境不能为空！</li>"
		Exit Sub
	End If
	If Len(Request.Form("SoftSize")) = 0 Then
		Founderr = True
		ErrMsg = ErrMsg + "<li>大小不能为空！</li>"
		Exit Sub
	End If
	If CInt(DownsysClass.Setting(19)) = 1 Then
		TxtContent = Request.Form("content1")
	Else
		TxtContent = DownsysClass.HTMLEncodes(Request.Form("content1"))
	End If
End Sub


Private Sub saveAdd()
	Call checksave
	If Founderr = False Then
		SQL = "select * from NC_SoftInfo where (softid is null)"
		Rs.Open SQL, Conn, 1, 3
		Rs.addnew
		Rs("softname") = DownsysClass.ChkFormStr(Request.Form("softname"))
		Rs("SoftVer") = DownsysClass.ChkFormStr(Request.Form("SoftVer"))
		Rs("rootid") = strSortid(0)
		Rs("sortid") = strSortid(1)
		Rs("SortName") = strSortid(2)
		Rs("content") = TxtContent
		Rs("Language") = Request.Form("Language")
		Rs("SoftType") = Request.Form("SoftType")
		Rs("isCommend") = Request.Form("isCommend")
		Rs("RunSystem") = DownsysClass.ChkFormStr(Request.Form("RunSystem"))
		Rs("impower") = Request.Form("impower")
		If Trim(Request.Form("SizeUnit")) = "MB" Then
			Rs("SoftSize") = CLng(Request.Form("SoftSize") * 1024)
		Else
			Rs("SoftSize") = CLng(Request.Form("SoftSize"))
		End If
		Rs("RunSystem") = Request.Form("RunSystem")
		Rs("Grades") = Request.Form("Grades")
		Rs("Decode") = Request.Form("Decode")
		Rs("isMember") = Request.Form("isMember")
		Rs("Homepage") = Request.Form("Homepage")
		Rs("Contact") = Request.Form("Contact")
		Rs("PreviewImg") = Request.Form("PreviewImg")
		Rs("Softimg") = Request.Form("Softimg")
		Rs("Errcode") = 0
		Rs("username") = Session(DownsysClass.CacheName & "AdminName")
		If Len(Request.Form("MoneyNum")) = 0 Then
			Rs("MoneyNum") = 0
		Else
			Rs("MoneyNum") = Request.Form("MoneyNum")
		End If
		Rs("isTop") = Request.Form("isTop")
		Rs("DayHits") = 0
		Rs("WeekHits") = 0
		Rs("MonthHits") = 0
		Rs("Hits") = 0
		Rs("HitsTime") = DownsysClass.NowTime
		Rs("SoftTime") = DownsysClass.NowTime
		Rs("isUpdate") = 1
		Rs("isLock") = 0
		Rs.Update
		Rs.Close
		Rs.Open "select top 1 softid from NC_SoftInfo order by softid desc", Conn, 1, 1
		pubSoftID = Rs("softid")
		Rs.Close
		SQL = "update NC_softSort set SoftNum=SoftNum+1,isUpdate=1 where depth<>0 and sortid=" & strSortid(1)
		DownsysClass.Execute SQL
		SQL = "update NC_softSort set SoftNum=SoftNum+1,isUpdate=1 where depth=0 and rootid=" & strSortid(0)
		DownsysClass.Execute SQL
		'//////添加下载连接地址//////
		If Request.Form("no") <> "" And pubSoftID <> "" Then
			For i = 1 To Request("no")
				If Request("DownSite" & i & "") <> "" Then
					SQL = "select * from NC_SoftSite where (ID is null)"
					SiteRs.Open SQL, Conn, 1, 3
					SiteRs.addnew
					SiteRs("SiteName") = Request.Form("SiteName" & i & "")
					SiteRs("DownSite") = Request.Form("DownSite" & i & "")
					SiteRs("sortid") = strSortid(1)
					SiteRs("SoftID") = pubSoftID
					SiteRs("serverid") = Request.Form("serverid" & i & "")
					SiteRs.Update
					SiteRs.Close
				End If
			Next
			Set SiteRs = Nothing
		End If
		Set Rs = Nothing
		'//////生成HTML//////
		If Request.form("isCreateHtml")="yes" then
			Dim DownloadClass
			Set DownloadClass = New Create_SoftInfo_Cls
			DownloadClass.CreateSoftInfo(pubSoftID)
			Set DownloadClass = Nothing
		End If
		NC_Admin.Succeed_Msg ("<li>添加" & Request.Form("softname") & "成功!</li>")
		Response.Write "<meta http-equiv=""refresh"" content=""2;url='" & Request.ServerVariables("HTTP_REFERER") & "'"">" & vbCrLf
	End If
End Sub


Private Sub savemodify()
	Call checksave
	Dim ChangedStr
	If CInt(DownsysClass.Setting(44)) = 1 Then
		ChangedStr = DownsysClass.mainset(43)
		ChangedStr = Replace(ChangedStr, "{$Now}", Now())
		ChangedStr = "[br][align=right]" & ChangedStr & "[/align]"
	End If
	If Founderr = False Then
		SQL = "select * from NC_SoftInfo where softid=" & Request("softid")
		Rs.Open SQL, Conn, 1, 3
		Rs("softname") = DownsysClass.ChkFormStr(Request.Form("softname"))
		Rs("SoftVer") = DownsysClass.ChkFormStr(Request.Form("SoftVer"))
		Rs("rootid") = strSortid(0)
		Rs("sortid") = strSortid(1)
		Rs("SortName") = strSortid(2)
		Rs("content") = TxtContent & ChangedStr
		Rs("Language") = Request.Form("Language")
		Rs("SoftType") = Request.Form("SoftType")
		Rs("isCommend") = Request.Form("isCommend")
		Rs("RunSystem") = DownsysClass.ChkFormStr(Request.Form("RunSystem"))
		Rs("impower") = Request.Form("impower")
		If Trim(Request.Form("SizeUnit")) = "MB" Then
			Rs("SoftSize") = CLng(Request.Form("SoftSize") * 1024)
		Else
			Rs("SoftSize") = CLng(Request.Form("SoftSize"))
		End If
		Rs("Grades") = Request.Form("Grades")
		Rs("Decode") = Request.Form("Decode")
		Rs("isMember") = Request.Form("isMember")
		Rs("Homepage") = Request.Form("Homepage")
		Rs("Contact") = Request.Form("Contact")
		Rs("PreviewImg") = Request.Form("PreviewImg")
		Rs("Softimg") = Request.Form("Softimg")
		Rs("MoneyNum") = Request.Form("MoneyNum")
		Rs("isTop") = Request.Form("isTop")
		Rs("isUpdate") = 1
		Rs("isLock") = 0
		Rs("Errcode") = 0
		If Trim(Request.Form("updateTime")) = "yes" Then
			Rs("SoftTime") = DownsysClass.NowTime
		End If
		Rs.Update
		pubSoftID = Rs("softid")
		Rs.Close
		SQL = "update NC_softSort set isUpdate=1 where depth<>0 and sortid=" & strSortid(1)
		DownsysClass.Execute SQL
		SQL = "update NC_softSort set isUpdate=1 where depth=0 and rootid=" & strSortid(0)
		DownsysClass.Execute SQL
		'//////修改下载连接//////

		If Request.Form("totalPut") <> "" And Request.Form("SoftID") <> "" Then
			For i = 1 To Request.Form("totalPut")
				If Request("StrDownSite" & i & "") <> "" Then
					SQL = "select * from NC_softsite where ID=" & Request("ID" & i & "")
					SiteRs.Open SQL, Conn, 1, 3
					SiteRs("SiteName") = Request.Form("StRsiteName" & i & "")
					SiteRs("DownSite") = Request.Form("StrDownSite" & i & "")
					SiteRs("sortid") = strSortid(1)
					SiteRs("serverid") = Request.Form("server" & i & "")
					SiteRs.Update
					SiteRs.Close
				End If
			Next
		End If
		'//////添加下载连接地址//////
		If Request.Form("no") <> "" And Request.Form("SoftID") <> "" Then
			For i = 1 To Request("no")
				If Request("DownSite" & i & "") <> "" Then
					SQL = "select * from NC_softsite where (ID is null)"
					SiteRs.Open SQL, Conn, 1, 3
					SiteRs.addnew
					SiteRs("SiteName") = Request.Form("SiteName" & i & "")
					SiteRs("DownSite") = Request.Form("DownSite" & i & "")
					SiteRs("softid") = Request.Form("softid")
					SiteRs("sortid") = strSortid(1)
					SiteRs("serverid") = Request.Form("serverid" & i & "")
					SiteRs.Update
					SiteRs.Close
				End If
			Next
		End If
		'//////生成HTML//////
		If Request.form("isCreateHtml")="yes" then
			Dim DownloadClass
			Set DownloadClass = New Create_SoftInfo_Cls
			DownloadClass.CreateSoftInfo(pubSoftID)
			Set DownloadClass = Nothing
		End If
		NC_Admin.Succeed_Msg ("<li>修改" & Request.Form("softname") & "成功!</li>")
		Set Rs = Nothing
		Response.Write "<meta http-equiv=""refresh"" content=""2;url='admin_software.asp'"">" & vbCrLf
	End If

End Sub


Private Sub batdel()
	Dim DownloadClass, DelSoftHtml, j
	DownsysClass.Execute ("delete from NC_SoftInfo where softid in (" & selSoftid & ")")
	DownsysClass.Execute ("delete from NC_SoftSite where softid in (" & selSoftid & ")")
	DownsysClass.Execute ("delete from NC_SoftEssay where softid in (" & selSoftid & ")")
       	If CInt(DownsysClass.Setting(5)) = 0 Then
        DelSoftHtml=split(selSoftid, ", ")
	Set DownloadClass = New Create_SoftInfo_Cls
	For j = 0 To Ubound(DelSoftHtml)
		DownloadClass.DelSoftInfo(DelSoftHtml(j))
	Next
		Set DownloadClass = Nothing
	End If
	'Response.Write ("批量删除操作成功！")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub


Private Sub batdele()
	Dim DownloadClass, DelSoftHtml, j
	DownsysClass.Execute ("update NC_SoftInfo set isLock=1,isUpdate=1 where softid in (" & selSoftid & ")")
       	If CInt(DownsysClass.Setting(5)) = 0 Then
        DelSoftHtml=split(selSoftid, ", ")
	Set DownloadClass = New Create_SoftInfo_Cls
	For j = 0 To Ubound(DelSoftHtml)
		DownloadClass.DelSoftInfo(DelSoftHtml(j))
	Next
		Set DownloadClass = Nothing
	End If
	'Response.Write ("你选择的文件已成功放入回收站！")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub


Private Sub batmove()
	Dim selSort
	selSort = Split(Trim(Request.Form("sortid")), ",")
	If Len(Request.Form("sortid")) <> 0 Then
		DownsysClass.Execute ("update NC_SoftInfo set rootid='" & selSort(0) & "',sortid='" & selSort(1) & "',SortName='" & selSort(2) & "',isUpdate=1 where softid in (" & selSoftid & ")")
		Response.Write ("批量移动操作成功,请重新生成移动的HTML文件!")
	Else
		Response.Write ("不能移动到一级分类，请选择正确的分类！")
	End If
End Sub

Private Sub isCommend()
	DownsysClass.Execute ("update [NC_SoftInfo] set isCommend=1 where softid in (" & selSoftid & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub


Private Sub noCommend()
	DownsysClass.Execute ("update [NC_SoftInfo] set isCommend=0 where softid in (" & selSoftid & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub


Private Sub upindate()
	DownsysClass.Execute ("update [NC_SoftInfo] set SoftTime=" & DownsysClass.SqlString & " where softid in (" & selSoftid & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub


Private Sub isTop()
	DownsysClass.Execute ("update NC_SoftInfo set isTop=1 where softid in (" & selSoftid & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub


Private Sub noTop()
	DownsysClass.Execute ("update NC_SoftInfo set isTop=0 where softid in (" & selSoftid & ")")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub

Private Sub BatCreateHtml()
	Dim DownloadClass, CreateSoftHtml, o, p
	o = 0
	Response.Write "<table width=""400"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbCrLf
	Response.Write "<tr> " & vbCrLf
	Response.Write "<td bgcolor=000000>" & vbCrLf
	Response.Write " <table width=""400"" border=""0"" cellspacing=""0"" cellpadding=""1"">" & vbCrLf
	Response.Write "<tr> " & vbCrLf
	Response.Write "<td bgcolor=ffffff height=9><img src=""images/bar9.gif"" width=0 height=16 id=img2 name=img2 align=absmiddle></td></tr></table>" & vbCrLf
	Response.Write "</td></tr></table></td></tr><tr> " & vbCrLf
	Response.Write "<td align=center bgcolor=000000> <span id=txt2 name=txt2 style=""font-size:9pt"">0</span><span style=""font-size:9pt"">%</span>  <span id=txt3 name=txt3 style=""font-size:9pt"">0</span></td></tr>" & vbCrLf
	Response.Write "</table>" & vbCrLf
	Response.Flush
	CreateSoftHtml = Split(selSoftid, ",")
	p = Ubound(CreateSoftHtml)
	Set DownloadClass = New Create_SoftInfo_Cls
	Do while o <= p 
		DownloadClass.CreateSoftInfo(Cint(Trim(CreateSoftHtml(o))))
		Response.Write "<script>img2.width=" & Fix((o + 1) / (p + 1) * 400) & ";" & vbCrLf
		Response.Write "txt2.innerHTML=""生成进度:" & FormatNumber((o + 1) / (p + 1) * 100, 4, -1) & """;" & vbCrLf
		Response.Write "txt3.innerHTML=""共有 <B><font color=RED>" & p + 1 & "</font></B> 个 　正在生成第 " & o + 1 & " 个"";" & vbCrLf
		Response.Write "img2.title=""(" & o + 1 & ")"";</script>" & vbCrLf
		o = o + 1
	Loop
	Response.Write "<script>txt3.innerHTML=""完成! 总共生成<B><font color=RED>" & p + 1 & "</font></B> 个文件"";</script>" & vbCrLf
	Response.Write "<script>img2.width=400;txt2.innerHTML=""100"";</script>"& vbCrLf
	Set DownloadClass = Nothing
	NC_Admin.Succeed_Msg ("完成! 总共生成<B><font color=RED>" & p + 1 & "</font></B> 个文件")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub

Private Sub showpage()
	If pagination = 0 Then
		If totalnumber Mod maxperpage = 0 Then
			n = totalnumber \ maxperpage
		Else
			n = totalnumber \ maxperpage + 1
		End If
		Response.Write "<table cellspacing=1 width='100%' border=0><form method=Post action=?clasid=" & Request("clasid") & "><tr><td align=center> " & vbCrLf
		Response.Write "<font color='red'>" & strSortName & "</font> "
		If CurrentPage < 2 Then
			Response.Write "共有软件 <font COLOR=#FF0000><strong>" & totalnumber & "</strong></font> 个&nbsp;首 页&nbsp;上一页&nbsp;"
		Else
			Response.Write "共有软件 <font COLOR=#FF0000><strong>" & totalnumber & "</strong></font> 个&nbsp;<a href=?page=1&clasid=" & Request("calsid") & ">首 页</a>&nbsp;"
			Response.Write "<a href=?page=" & CurrentPage - 1 & "&clasid=" & Request("clasid") & ">上一页</a>&nbsp;"
		End If
		If n - CurrentPage < 1 Then
			Response.Write "下一页&nbsp;尾 页" & vbCrLf
		Else
			Response.Write "<a href=?page=" & (CurrentPage + 1) & "&clasid=" & Request("clasid") & ">下一页</a>"
			Response.Write "&nbsp;<a href=?page=" & n & "&clasid=" & Request("clasid") & ">尾 页</a>" & vbCrLf
		End If
		Response.Write "&nbsp;页次：<strong><font color=red>" & CurrentPage & "</font>/" & n & "</strong>页 "
		Response.Write "&nbsp;转到："
		If GotoPageType = 1 Then
			Response.Write "&nbsp;<select name='page' size='1' style=""font-size: 9pt"" onChange='javascript:submit()'>" & vbCrLf
			For ii = 1 To n
				Response.Write "<option value='" & ii & "' "
				If CurrentPage = CInt(ii) Then
					Response.Write "selected "
				End If
				Response.Write ">第" & ii & "页</option>"
			Next
			Response.Write "</select> " & vbCrLf
		Else
			Response.Write "<input name=page size=3> <input type=submit name=Submit value='GO→'>"
		End If
		Response.Write "</td></tr></FORM></table>" & vbCrLf
	Else
		n = CurrentPage
		If n < maxpagecount Then
			n = maxpagecount
		End If
		Response.Write "<table width=""100%"" border=""0"" align=""center"" cellpadding=""0"" cellspacing=""2"">"
		Response.Write " <tr><form method=""POST"" action='?clasid=" & Request("clasid") & "'>"
		Response.Write " <td align=""center""><font color='red'>" & strSortName & "</font> 共有软件 <font COLOR=#FF0000><strong>"
		Response.Write totalnumber
		Response.Write "</strong></font> 个 <a href=?page=1&clasid=" & Request("clasid") & " title=返回第一页><font face=""Webdings"">97</font></a> "
		For ii = pagestart To pageend
			If ii = 0 Then ii = 1
			If ii = CurrentPage Then
				Response.Write "<font color='red'><strong>" & ii & "</strong></font> "
			Else
				Response.Write "<a href=?page=" & ii & "&clasid=" & Request("clasid") & " title=第" & ii & "页><strong>" & ii & "</strong></a> "
			End If
		Next
		Response.Write "<a href=?page="
		Response.Write maxpagecount
		Response.Write "&clasid=" & Request("clasid") & " title=尾页><font face=""Webdings"">8:</font></a> 页次:<strong><font color=red>"
		Response.Write CurrentPage
		Response.Write "</font>/"
		Response.Write maxpagecount
		Response.Write "</strong>页 转到:"
		If GotoPageType = 1 Then
			Response.Write "&nbsp;<select name='page' size='1' style=""font-size: 9pt"" onChange='javascript:submit()'>" & vbCrLf
			For ii = 1 To n
				Response.Write "<option value='" & ii & "' "
				If CurrentPage = CInt(ii) Then
					Response.Write "selected "
				End If
				Response.Write ">第" & ii & "页</option>"
			Next
			Response.Write "</select> " & vbCrLf
		Else
			Response.Write "<input name=page size=3> <input type=submit name=Submit value='GO'>"
		End If
		Response.Write " </td></form></tr></table>" & vbCrLf
	End If

End Sub


Private Function SortingJumpMenu()
	Dim CacheJumpMenu
	Dim SQL
	Dim Rs1
	Dim i
	DownsysClass.Name = "SortingJumpMenu"
	If DownsysClass.ObjIsEmpty() Then
		CacheJumpMenu = "<select onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"">" & vbCrLf
		CacheJumpMenu = CacheJumpMenu & "<option value=admin_software.asp>≡全部软件列表≡</option>" & vbCrLf
		Set Rs1 = CreateObject("Adodb.recordset")
		SQL = "select * from NC_SoftSort order by rootid,orders"
		Rs1.Open SQL, Conn, 1, 1
		DownsysClass.SqlQueryNum = DownsysClass.SqlQueryNum + 1
		Do While Not Rs1.EOF
			CacheJumpMenu = CacheJumpMenu & "<option value=""admin_software.asp?clasid=" & Rs1("sortid") & """ {SortID=" & Rs1("sortid") & "}"
			If Trim(Request("clasid")) <> "" Then
				If CLng(Request("clasid")) = Rs1("sortid") Then CacheJumpMenu = CacheJumpMenu & " selected"
			End If
			CacheJumpMenu = CacheJumpMenu & ">"
			If Rs1("depth") = 1 Then CacheJumpMenu = CacheJumpMenu & "　├ "
			If Rs1("depth") > 1 Then
				For i = 2 To Rs1("depth")
					CacheJumpMenu = CacheJumpMenu & "　"
				Next
				CacheJumpMenu = CacheJumpMenu & "　├ "
			End If
			CacheJumpMenu = CacheJumpMenu & Rs1("SortName") & "</option>" & vbCrLf
			Rs1.movenext
		Loop
		Rs1.Close
		Set Rs1 = Nothing
		CacheJumpMenu = CacheJumpMenu & "</select>"
		DownsysClass.Value = CacheJumpMenu
	End If
	SortingJumpMenu = DownsysClass.Value
End Function

Private Function SelDownServer(intServerid, snid)
	Dim Rs_site
	Response.Write " <select name=""" & snid & """ size=""1"">"
	Response.Write "<option value=""0"""
	If intServerid = 0 Then Response.Write " selected"
	Response.Write ">↓请选择下载服务器↓</option>"
	Set Rs_site = CreateObject("adodb.recordset")
	SQL = "select serverid,ServerName,depth,rootid from NC_ServerSite where depth=0"
	Rs_site.Open SQL, Conn, 1, 1
	Do While Not Rs_site.EOF
		Response.Write "<option value=""" & Rs_site("rootid") & """"
		If intServerid = Rs_site("rootid") Then Response.Write " selected"
		Response.Write ">" & Rs_site(1) & "</option>"
		Rs_site.movenext
	Loop
	Rs_site.Close
	Set Rs_site = Nothing
	Response.Write "</select>"
End Function

Private Sub delsite()
	DownsysClass.Execute ("delete from NC_softsite where ID=" & Request("ID") & "")
	Response.redirect (Request.ServerVariables("HTTP_REFERER"))
End Sub
%>
