📄 user_soft_code.asp
字号:
<!--#include file="CommonCode.asp"-->
<!--#include file="../Include/PowerEasy.Common.Purview.asp"-->
<!--#include file="../Include/PowerEasy.Common.Manage.asp"-->
<!--#include file="../Include/PowerEasy.Common.Content.asp"-->
<%
'**************************************************************
' Software name: PowerEasy SiteWeaver
' Web: http://www.powereasy.net
' Copyright (C) 2005-2008 佛山市动易网络科技有限公司 版权所有
'**************************************************************
Dim SoftID, AuthorName, Status, ManageType
Dim ClassID, SpecialID, OnTop, IsElite, IsHot, Created
Dim tClass, ClassName, RootID, ParentID, Depth, ParentPath, Child, arrChildID, ParentDir, ClassDir, ClassPurview
Dim arrFields_Options, arrSoftType, arrSoftLanguage, arrCopyrightType, arrOperatingSystem
Sub Execute()
ChannelID = PE_CLng(Trim(Request("ChannelID")))
If ChannelID > 0 Then
Call GetChannel(ChannelID)
Else
FoundErr = True
ErrMsg = ErrMsg & "<li>请指定要查看的频道ID!</li>"
Response.Write ErrMsg
Exit Sub
End If
SoftID = Trim(Request("SoftID"))
ClassID = PE_CLng(Trim(Request("ClassID")))
Status = Trim(Request("Status"))
AuthorName = Trim(Request("AuthorName"))
strField = Trim(Request("Field"))
If Status = "" Then
Status = 9
Else
Status = PE_CLng(Status)
End If
If IsValidID(SoftID) = False Then
SoftID = ""
End If
arrFields_Options = Split(",,,", ",")
arrSoftType = ""
arrSoftLanguage = ""
arrCopyrightType = ""
arrOperatingSystem = ""
If Fields_Options & "" <> "" Then
arrFields_Options = Split(Fields_Options, "$$$")
If UBound(arrFields_Options) = 3 Then
arrSoftType = Split(arrFields_Options(0), vbCrLf)
arrSoftLanguage = Split(arrFields_Options(1), vbCrLf)
arrCopyrightType = Split(arrFields_Options(2), vbCrLf)
arrOperatingSystem = Split(arrFields_Options(3), vbCrLf)
End If
End If
If Action = "" Then Action = "Manage"
FileName = "User_Soft.asp?ChannelID=" & ChannelID & "&Action=" & Action & "&ManageType=" & ManageType
strFileName = FileName & "&ClassID=" & ClassID & "&Field=" & strField & "&keyword=" & Keyword
If AuthorName <> "" Then
AuthorName = ReplaceBadChar(AuthorName)
strFileName = strFileName & "&AuthorName=" & AuthorName
End If
If XmlDoc.Load(Server.MapPath(InstallDir & "Language/Gb2312_Channel_" & ChannelID & ".xml")) = False Then XmlDoc.Load (Server.MapPath(InstallDir & "Language/Gb2312.xml"))
Response.Write "<table align='center'><tr align='center' valign='top'>"
If CheckUser_ChannelInput() Then
Response.Write "<td width='90'><a href='User_Soft.asp?ChannelID=" & ChannelID & "&Action=Add'><img src='images/Soft_add.gif' border='0' align='absmiddle'><br>添加" & ChannelShortName & "</a></td>"
End If
Response.Write "<td width='90'><a href='User_Soft.asp?ChannelID=" & ChannelID & "&Status=9'><img src='images/Soft_all.gif' border='0' align='absmiddle'><br>所有" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Soft.asp?ChannelID=" & ChannelID & "&Status=-1'><img src='images/Soft_draft.gif' border='0' align='absmiddle'><br>草 稿</a></td>"
Response.Write "<td width='90'><a href='User_Soft.asp?ChannelID=" & ChannelID & "&Status=0'><img src='images/Soft_unpassed.gif' border='0' align='absmiddle'><br>待审核的" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Soft.asp?ChannelID=" & ChannelID & "&Status=3'><img src='images/Soft_passed.gif' border='0' align='absmiddle'><br>已审核的" & ChannelShortName & "</a></td>"
Response.Write "<td width='90'><a href='User_Soft.asp?ChannelID=" & ChannelID & "&Status=-2'><img src='images/Soft_reject.gif' border='0' align='absmiddle'><br>未被采用的" & ChannelShortName & "</a></td>"
Response.Write "</tr></table>" & vbCrLf
Select Case Action
Case "Add"
Call Add
Case "Modify"
Call Modify
Case "SaveAdd", "SaveModify"
Call SaveSoft
Case "Preview"
Call Preview
Case "Show"
Call Show
Case "Del"
Call Del
Case "Manage"
Call main
End Select
If FoundErr = True Then
Call WriteErrMsg(ErrMsg, ComeUrl)
End If
End Sub
Sub main()
Call GetClass
If FoundErr = True Then Exit Sub
Call ShowJS_Main(ChannelShortName)
Response.Write "<br>"
Response.Write "<table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>"
Response.Write " <tr class='title'>"
Response.Write " <td height='22'>" & GetRootClass() & "</td>"
Response.Write " </tr>" & GetChild_Root() & ""
Response.Write "</table><br>"
Call ShowContentManagePath(ChannelShortName & "管理")
Response.Write "<table width='100%' border='0' cellpadding='0' cellspacing='0'><tr>"
Response.Write " <form name='myform' method='Post' action='User_Soft.asp' onsubmit='return ConfirmDel();'>"
Response.Write " <td><table class='border' border='0' cellspacing='1' width='100%' cellpadding='0'>"
Response.Write " <tr class='title' height='22'> "
Response.Write " <td height='22' width='30' align='center'><strong>选中</strong></td>"
Response.Write " <td width='25' align='center'><strong>ID</strong></td>"
Response.Write " <td align='center' ><strong>" & ChannelShortName & "名称</strong></td>"
Response.Write " <td width='60' align='center' ><strong>录入</strong></td>"
Response.Write " <td width='40' align='center' ><strong>下载数</strong></td>"
Response.Write " <td width='80' align='center' ><strong>" & ChannelShortName & "属性</strong></td>"
Response.Write " <td width='60' align='center' ><strong>审核状态</strong></td>"
Response.Write " <td width='80' align='center' ><strong>管理操作</strong></td>"
Response.Write " </tr>"
Dim rsSoftList, sql
sql = "select S.SoftID,S.ClassID,C.ClassName,C.ParentDir,C.ClassDir,S.SoftName,S.SoftVersion,S.Author,S.Keyword,S.UpdateTime,S.Inputer,S.Editor,S.Hits,S.SoftSize,S.OnTop,S.Elite,S.Status,S.Stars,S.InfoPoint from PE_Soft S"
sql = sql & " left join PE_Class C on S.ClassID=C.ClassID where S.ChannelID=" & ChannelID & " and S.Deleted=" & PE_False & " and S.Inputer='" & UserName & "' "
If AuthorName <> "" Then
sql = sql & " and S.Author='" & AuthorName & "|' "
End If
Select Case Status
Case 3
sql = sql & " and S.Status=3"
Case 0
sql = sql & " and (S.Status=0 Or S.Status=1 Or S.Status=2)"
Case -1
sql = sql & " and S.Status=-1"
Case -2
sql = sql & " and S.Status=-2"
End Select
If ClassID > 0 Then
If Child > 0 Then
sql = sql & " and S.ClassID in (" & arrChildID & ")"
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 "Inputer"
sql = sql & " and S.Inputer='" & 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.BOF And rsSoftList.EOF Then
totalPut = 0
Response.Write "<tr class='tdbg'><td colspan='20' align='center'><br>" & GetStrNoItem(ClassID, Status) & "<br><br></td></tr>"
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
If (CurrentPage - 1) * MaxPerPage < totalPut Then
rsSoftList.Move (CurrentPage - 1) * MaxPerPage
Else
CurrentPage = 1
End If
End If
Dim SoftNum
SoftNum = 0
Do While Not rsSoftList.EOF
Response.Write " <tr class='tdbg' onmouseout=""this.className='tdbg'"" onmouseover=""this.className='tdbgmouseover'"">"
Response.Write " <td width='30' align='center'><input name='SoftID' type='checkbox' onclick='unselectall()' id='SoftID' value='" & rsSoftList("SoftID") & "'></td>"
Response.Write " <td width='25' align='center'>" & rsSoftList("SoftID") & "</td>"
Response.Write " <td>"
If rsSoftList("ClassID") <> ClassID Then
Response.Write "<a href='" & FileName & "&ClassID=" & rsSoftList("ClassID") & "'>[" & rsSoftList("ClassName") & "]</a> "
End If
Response.Write "<a href='User_Soft.asp?ChannelID=" & ChannelID & "&Action=Show&SoftID=" & rsSoftList("SoftID") & "' title='" & GetLinkTips(rsSoftList("SoftName"), rsSoftList("SoftVersion"), rsSoftList("Author"), rsSoftList("UpdateTime"), rsSoftList("Hits"), rsSoftList("Keyword"), rsSoftList("Stars"), rsSoftList("InfoPoint")) & "'>" & rsSoftList("SoftName")
If rsSoftList("SoftVersion") <> "" Then
Response.Write " " & rsSoftList("SoftVersion")
End If
Response.Write "</a></td>"
Response.Write " <td width='60' align='center'><a href='" & FileName & "&field=Inputer&keyword=" & rsSoftList("Inputer") & "' title='点击将查看此用户录入的所有" & ChannelShortName & "'>" & rsSoftList("Inputer") & "</a></td>"
Response.Write " <td width='40' align='center'>" & rsSoftList("Hits") & "</td>"
Response.Write " <td width='80' align='center'>" & GetInfoProperty(rsSoftList("OnTop"), rsSoftList("Hits"), rsSoftList("Elite")) & "</td>"
Response.Write " <td width='60' align='center'>" & GetInfoStatus(rsSoftList("Status")) & "</td>"
Response.Write " <td width='80' align='center'>"
If rsSoftList("Inputer") = UserName And (rsSoftList("Status") <= 0 Or EnableModifyDelete = 1) Then
Response.Write "<a href='User_Soft.asp?ChannelID=" & ChannelID & "&Action=Modify&SoftID=" & rsSoftList("SoftID") & "'>修改</a> "
Response.Write "<a href='User_Soft.asp?ChannelID=" & ChannelID & "&Action=Del&SoftID=" & rsSoftList("SoftID") & "' onclick=""return confirm('确定要删除此" & ChannelShortName & "吗?一旦删除将不能恢复!');"">删除</a>"
End If
Response.Write "</td>"
Response.Write "</tr>"
SoftNum = SoftNum + 1
If SoftNum >= MaxPerPage Then Exit Do
rsSoftList.MoveNext
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -