%@language=vbscript codepage=936 %>
<%
option explicit
response.buffer=true
%>
<%
if CheckUserLogined()=False then
response.Redirect "User_Login.asp"
end if
dim strFileName,FileName
const MaxPerPage=20
dim totalPut,CurrentPage,TotalPages
dim i,j
dim keyword,strField
dim sql,rsSoftList
dim ClassID
dim PurviewChecked
dim ManageType
dim strAdmin,arrAdmin
dim AdminPurview,AdminPurview_Soft
dim tClass,ClassName,RootID,ParentID,Depth,ParentPath,Child,ChildID,tID,tChild,ClassMaster
FileName="User_SoftManage.asp"
ClassID=Trim(request("ClassID"))
keyword=trim(request("keyword"))
if keyword<>"" then
keyword=ReplaceBadChar(keyword)
end if
strField=trim(request("Field"))
if ClassID="" then
ClassID=0
else
ClassID=CLng(ClassID)
end if
if ClassID>0 then
set tClass=conn.execute("select ClassName,RootID,ParentID,Depth,ParentPath,Child,ClassMaster From SoftClass where ClassID=" & ClassID)
if tClass.bof and tClass.eof then
founderr=True
ErrMsg=ErrMsg & "
找不到指定的栏目
"
Call WriteErrMsg()
response.end
else
ClassName=tClass(0)
RootID=tClass(1)
ParentID=tClass(2)
Depth=tClass(3)
ParentPath=tClass(4)
Child=tClass(5)
end if
end if
strFileName=FileName & "?ClassID=" & ClassID & "&strField=" & strField & "&keyword=" & keyword
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
软件管理
<%
sql="select S.SoftID,S.ClassID,C.ClassName,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Editor,S.Hits,S.SoftSize,S.OnTop,S.Elite,S.Passed,S.Stars,S.SoftLevel,S.SoftPoint from Soft S"
sql=sql & " inner join SoftClass C on S.ClassID=C.ClassID where S.Deleted=False and S.Editor='" & UserName & "' "
if ClassID>0 then
if Child>0 then
ChildID=""
if Depth<=0 then
set tClass=conn.execute("select ClassID from SoftClass where ParentID=" & ClassID & " or ParentPath like '" & ClassID & ",%'")
else
set tClass=conn.execute("select ClassID from SoftClass where ParentID=" & ClassID & " or ParentPath like '" & ParentPath & "," & ClassID & ",%'")
end if
do while not tClass.eof
if ChildID="" then
ChildID=tClass(0)
else
ChildID=ChildID & "," & tClass(0)
end if
tClass.movenext
loop
sql=sql & " and S.ClassID in (" & ChildID & ")"
else
sql=sql & " and S.ClassID=" & ClassID
end if
end if
if keyword<>"" then
select case strField
case "SoftName"
sql=sql & " and S.SoftName like '%" & keyword & "%' "
case "SoftIntro"
sql=sql & " and S.SoftIntro like '%" & keyword & "%' "
case "Author"
sql=sql & " and S.Author like '%" & keyword & "%' "
case else
sql=sql & " and S.SoftName like '%" & keyword & "%' "
end select
end if
sql=sql & " order by S.SoftID desc"
Set rsSoftList= Server.CreateObject("ADODB.Recordset")
rsSoftList.open sql,conn,1,1
if rsSoftList.eof and rsSoftList.bof then
totalPut=0
if Child=0 then
response.write "
没有任何软件!
"
else
response.write "
此栏目的下一级子栏目中没有任何软件!
"
end if
else
totalPut=rsSoftList.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,true,"个软件"
else
if (currentPage-1)*MaxPerPage