📄 admin_soft.asp
字号:
<!--#include file="setup.asp"-->
<!--#include file="../inc/ubbcode.asp"-->
<!--#include file="check.asp"-->
<%
Admin_header
'=====================================================================
' 软件名称:新云网站管理系统
' 当前版本:NewCloud Site Management System Version 2.1
' 文件名称:admin_Soft.asp
' 更新日期:2004-11-20
' 官方网站:新云网络(www.newasp.net www.newasp.cn) QQ:94022511
'=====================================================================
' Copyright 2002-2005 newasp.net - All Rights Reserved.
' newasp is a trademark of newasp.net
'=====================================================================
Dim Action
Dim i,ii,isEdit,RsObj
Dim keyword,FindWord,strClass,AlphaSoftName
Dim maxperpage,CurrentPage,totalnumber,TotalPageNum
Dim s_ClassName,ClassID,ChildStr,FoundSQL,isAccept,selSoftID
Dim TextContent,SoftTop,SoftBest,SoftID,ForbidEssay,showreg,SoftAccept
Dim DownAddress,findsize
ChannelID = Newasp.ChkNumeric(Request("ChannelID"))
findsize = 0
If Trim(Request("isAccept")) <> "" Then
isAccept = 0
Else
isAccept = 1
End If
If CInt(ChannelID) = 0 Then ChannelID = 2
Action = LCase(Request("action"))
Select Case Trim(Action)
Case "save"
Call SaveSoft
Case "modify"
Call ModifySoft
Case "add"
isEdit = False
Call SoftEdit(isEdit)
Case "edit"
isEdit = True
Call SoftEdit(isEdit)
Case "del"
Call SoftDel
Case "batdel"
Call PageTop
Call BatcDelete
Case "alldel"
Call AllDelSoft
Case "view"
Call SoftView
Case "renew"
Call SoftRenew
Case "setting"
Call PageTop
Call BatchSetting
Case "saveset"
Call SaveSetting
Case "move"
Call PageTop
Call BatchMove
Case "savemove"
Call SaveMove
Case "reset"
Call ResetDateTime
Case "sdel"
Call DelDownAddress
Case Else
Call showmain
End Select
If FoundErr = True Then
ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
CloseConn
Private Sub PageTop()
Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=TableBorder>"
Response.Write " <tr>"
Response.Write " <th colspan=2>" & sModuleName & "管理选项</th>"
Response.Write " </tr>"
Response.Write " <tr><form method=get name=myform action='admin_Soft.asp' onSubmit='return JugeQuery(this);'>"
Response.Write "<input type=hidden name=ChannelID value='" & ChannelID & "'>"
Response.Write "<td class=TableRow1>搜索:"
Response.Write " <input name=keyword type=text size=20>"
Response.Write " 条件:"
Response.Write " <select name=queryopt>"
Response.Write " <option value='1' selected>" & sModuleName & "名称</option>"
Response.Write " <option value='2'>录 入 者</option>"
Response.Write " <option value='3'>不限条件</option>"
Response.Write " </select> <input type=submit name=Submit value='开始搜索' class=Button></td>"
Response.Write " <td class=TableRow1>软件导航:"
Dim srtClassMenu
Response.Write "<select onchange=""if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}"">" & vbCrLf
Response.Write "<option value='admin_Soft.asp?ChannelID=" & ChannelID & "'>≡全部" & sModuleName & "列表≡</option>" & vbCrLf
srtClassMenu = Newasp.ClassJumpMenu(ChannelID)
srtClassMenu = Replace(srtClassMenu, "{ClassID=" & Request("sortid") & "}", "selected")
Response.Write srtClassMenu
Response.Write "</select>"
Response.Write " </td></form>"
Response.Write " </tr>"
Response.Write " <tr>"
Response.Write " <td colspan=2 class=TableRow2><b>操作选项:</b> <a href='admin_Soft.asp?ChannelID=" & ChannelID & "'>管理首页</a> | "
Response.Write " <a href='admin_Soft.asp?ChannelID=" & ChannelID & "&action=add'>添加软件</a> | "
Response.Write " <a href='admin_classify.asp?ChannelID=" & ChannelID & "&action=add'>添加软件分类</a> | "
Response.Write " <a href='admin_classify.asp?ChannelID=" & ChannelID & "'>软件分类管理</a> | "
Response.Write " <a href='?ChannelID=" & ChannelID & "&specialID=0'>" & sModuleName & "专题列表</a> | "
Response.Write " <a href='?ChannelID=" & ChannelID & "&isAccept=0'>待审" & sModuleName & "</a> | "
Response.Write " <a href='Admin_CreateSoft.Asp?ChannelID=" & ChannelID & "'>生成HTML</a></td>"
Response.Write " </tr>"
Response.Write "</table>"
Response.Write "<br>"
End Sub
Private Sub showmain()
If Not ChkAdmin("AdminSoft" & ChannelID) Then
Server.Transfer("showerr.asp")
Response.End
End If
Dim strListName
If Not IsEmpty(Request("selSoftID")) Then
selSoftID = Request("selSoftID")
Select Case Newasp.CheckStr(Request("act"))
Case "批量删除":Call batdel
Case "批量推荐":Call isCommend
Case "取消推荐":Call noCommend
Case "批量置顶":Call isTop
Case "取消置顶":Call noTop
Case "批量审核":Call BatAccept
Case "取消审核":Call NotAccept
Case "生成HTML":Call BatCreateHtml
Case Else
Response.Write "无效参数!"
End Select
End If
Call PageTop
Dim specialID,sortid,Cmd,child
Response.Write chr(0)
Response.Write "<script language=""JavaScript"" src=""include/showpage.js""></script>" & vbNewLine
Response.Write "<table border=0 align=center cellpadding=3 cellspacing=1 class=TableBorder>"
Response.Write " <tr>"
Response.Write " <th width='5%' nowrap>选择</th>"
Response.Write " <th width='60%'>" & sModuleName & "名称</th>"
Response.Write " <th width='8%' nowrap>文件大小</th>"
Response.Write " <th width='9%' nowrap>管理操作</th>"
Response.Write " <th width='5%' nowrap>审核</th>"
Response.Write " <th width='9%' nowrap>录 入 者</th>"
Response.Write " <th width='9%' nowrap>整理日期</th>"
Response.Write " </tr>"
strListName = "&channelid="& ChannelID &"&sortid="& Request("sortid") &"&specialID="& Request("specialID") &"&isAccept="& Request("isAccept") &"&keyword=" & Request("keyword")
If Trim(Request("sortid")) <> "" Then
SQL = "select ClassID,ChannelID,ClassName,child,ChildStr from [NC_Classify] where ChannelID = " & ChannelID & " And ClassID=" & Request("sortid")
Set Rs = Newasp.Execute(SQL)
If Rs.BOF And Rs.EOF Then
Response.Write "Sorry!没有找到任何软件分类。或者您选择了错误的系统参数!"
Response.End
Else
s_ClassName = Rs("ClassName")
ClassID = Rs("ClassID")
child = Rs("child")
ChildStr = Rs("ChildStr")
sortid = CLng(Request("sortid"))
End If
Rs.Close
Else
s_ClassName = "全部" & sModuleName
sortid = 0
child = 0
End If
maxperpage = 30 '###每页显示数
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 = CLng(Request("page"))
Else
CurrentPage = 1
End If
If CInt(CurrentPage) = 0 Then CurrentPage = 1
If Not IsNull(Request("keyword")) And Request("keyword") <> "" Then
keyword = Trim(Newasp.ChkQueryStr(Trim(Request("keyword"))))
If CInt(Request("queryopt")) = 1 Then
findword = "A.SoftName like '%" & keyword & "%'"
ElseIf CInt(Request("queryopt")) = 2 Then
findword = "A.username like '%" & keyword & "%'"
Else
findword = "A.SoftName like '%" & keyword & "%' or A.username like '%" & keyword & "%'"
End If
FoundSQL = findword
s_ClassName = "查询" & sModuleName
Else
specialID = 99999
If Trim(Request("sortid")) <> "" Then
FoundSQL = "A.isAccept="& isAccept & " And A.ClassID in (" & ChildStr & ")"
Else
If Trim(Request("specialID")) <> "" Then
specialID = CLng(Request("specialID"))
If Request("specialID") <> 0 Then
FoundSQL = "A.isAccept = " & isAccept & " And specialID =" & Request("specialID")
Else
FoundSQL = "A.isAccept = " & isAccept & " And specialID > 0"
End If
Else
If findsize > 0 Then
FoundSQL = "A.isAccept = " & isAccept
Else
FoundSQL = "A.isAccept = " & isAccept
End If
End If
End If
End If
On Error Resume Next
TotalNumber = Newasp.Execute("Select Count(SoftID) from NC_SoftList A where A.ChannelID = " & ChannelID & " And "& FoundSQL &"")(0)
TotalPageNum = CLng(TotalNumber / maxperpage) '得到总页数
If TotalPageNum < TotalNumber / maxperpage Then TotalPageNum = TotalPageNum + 1
If CurrentPage < 1 Then CurrentPage = 1
If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
Set Rs = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT A.SoftID,A.ChannelID,A.ClassID,A.SpecialID,A.SoftName,A.SoftVer,A.ColorMode,A.FontMode,A.username,A.SoftTime,A.isTop,A.isBest,A.isAccept,A.SoftSize,C.ClassName FROM [NC_SoftList] A inner join [NC_Classify] C on A.ClassID=C.ClassID where A.ChannelID = " & ChannelID & " And "& FoundSQL &" ORDER BY A.isTop DESC, A.SoftTime DESC,A.SoftID DESC"
If IsSqlDataBase = 1 Then
If CurrentPage > 100 Then
Rs.Open SQL, Conn, 1, 1
Else
Set Rs = Newasp.Execute(SQL)
End If
Else
Rs.Open SQL, Conn, 1, 1
End If
Newasp.SqlQueryNum = Newasp.SqlQueryNum + 1
If Rs.BOF And Rs.EOF Then
Response.Write "<form name=selform method=post action="""">"
Response.Write "<input type=hidden name=ChannelID value='" & ChannelID & "'>"
Response.Write "<input type=hidden name=action value=''>"
Response.Write "<tr><td align=center colspan=7 class=TableRow2>还没有找到任何" & sModuleName & "!</td></tr>"
Else
Rs.MoveFirst
If TotalPageNum > 1 then Rs.Move (CurrentPage - 1) * maxperpage
If Rs.Eof Then Exit Sub
SQL=Rs.GetRows(maxperpage)
Response.Write " <tr>"
Response.Write " <td colspan=7 class=TableRow2>"
ShowListPage CurrentPage,TotalPageNum,totalnumber,maxperpage,strListName,s_ClassName
Response.Write "</td>"
Response.Write " </tr>"
Response.Write " <form name=selform method=post action="""">"
Response.Write " <input type=hidden name=ChannelID value='" & ChannelID & "'>"
Response.Write " <input type=hidden name=action value=''>"
For i=0 To Ubound(SQL,2)
If Not Response.IsClientConnected Then Response.End
If (i mod 2) = 0 Then
strClass = "class=TableRow1"
Else
strClass = "class=TableRow2"
End If
Admin_Soft_list SQL(0,i),SQL(1,i),SQL(2,i),SQL(4,i),SQL(5,i),SQL(6,i),SQL(7,i),SQL(8,i),SQL(9,i),SQL(10,i),SQL(11,i),SQL(12,i),SQL(13,i),SQL(14,i),strClass
Next
SQL=Null
End If
Rs.Close:Set Rs = Nothing
Set Cmd = Nothing
%>
<tr>
<td colspan="7" class="TableRow1">
<input class=Button type="button" name="chkall" value="全选" onClick="CheckAll(this.form)"><input class=Button type="button" name="chksel" value="反选" onClick="ContraSel(this.form)">
管理选项:
<select name="act">
<option value="0">请选择操作选项</option>
<option value="批量删除">批量删除</option>
<option value="批量置顶">批量置顶</option>
<option value="取消置顶">取消置顶</option>
<option value="批量推荐">批量推荐</option>
<option value="取消推荐">取消推荐</option>
<option value="批量审核">批量审核</option>
<option value="取消审核">取消审核</option>
<option value="生成HTML">生成HTML</option>
</select>
<input class=Button type="submit" name="Submit2" value="执行操作" onclick="return confirm('您确定执行该操作吗?');">
<input class=Button type="submit" name="Submit3" value="批量设置" onclick="document.selform.action.value='setting';">
<input class=Button type="submit" name="Submit4" value="批量移动" onclick="document.selform.action.value='move';">
<input class=Button type="submit" name="Submit4" value="批量删除" onclick="document.selform.action.value='batdel';"></td>
</tr>
</form>
<tr>
<td colspan="7" align="right" class="TableRow2"><%ShowListPage CurrentPage,TotalPageNum,totalnumber,maxperpage,strListName,s_ClassName %></td>
</tr>
</table>
<%
End Sub
Function Admin_Soft_list(SoftID,ChannelID,ClassID,SoftName,SoftVer,ColorMode,FontMode,username,SoftTime,isTop,isBest,isAccept,SoftSize,ClassName,strClass)
Response.Write " <tr>"
Response.Write " <td align=center " & strClass & "><input type=checkbox name=selSoftID value=" & SoftID & "></td>"
Response.Write " <td " & strClass & ">"
If isTop <> 0 Then
Response.Write "<img src=""images/istop.gif"" width=15 height=17 border=0 alt=置顶软件>"
End If
Response.Write "[<a href=?ChannelID=" & ChannelID & "&sortid="
Response.Write ClassID
Response.Write ">"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -