⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 special_process.asp

📁 一个很好的asp cms管理系统
💻 ASP
字号:
<%
Option Explicit
'----------------------------------------------------------------------------------
'本页:
'	资源特性处理页面
'说明:
'
'----------------------------------------------------------------------------------
%>
<!--#include file="inc/Config.class.asp"-->
<!--#include file="inc/DBControl.class.asp"-->
<!--#include file="inc/FunctionLib.class.asp"-->
<!--#include file="inc/Manager.class.asp"-->
<%
Dim Cfg, Db, FLib, Admin
Set Cfg = New Config
Set Db = New DBControl
Set FLib = New FunctionLib
Set Admin = New Manager

If Not Admin.Logined Then
    FLib.Alert "对不起,你已经超时或未登录","./",1
    Response.End
End If

If Not Admin.CheckPopedom("TSYS_GROUP2_RES_SPECIAL") Then
    FLib.Alert "权限不足", "BACK", 0
    Response.End
ENd If

Db.Open()

Dim Work
    Work = Request("Work")

'选择执行操作
Select Case Work
    Case "MdyReco"
        MdyReco()
    Case "AddReco"
        AddReco()
    Case "DeleteReco"
        DeleteReco()
End Select

Function AddReco()
    Dim parent, title, show_order, remark, show
    parent          = FLib.SafeSql(Request("parent"))
    title           = FLib.SafeSql(Request("title"))
    show_order      = FLib.SafeSql(Request("show_order"))
    remark          = FLib.SafeSql(Request("remark"))
    show            = FLib.SafeSql(Request("show"))

    Dim Sql, Rs
    Sql = "INSERT INTO special_list (parent, title, show_order, remark, show, creator, addtime)VALUES(" & parent & ", '" & title & "', " & show_order & ",  '" & remark & "', " & show & ", '" & Admin.UserName & "', GETDATE())"
    Db.ExeCute(Sql)
    FLib.AddLog "增加资源特性:" & title

    FLib.Alert "执行完毕","Special_List.asp?Parent=" & FLib.GetCookie("SpecialList_Parent"), 0
    Response.En

End Function

Function MdyReco()
    Dim rId, parent, title, show_order, remark, show
    rId             = FLib.SafeSql(Request("rId"))
    parent          = FLib.SafeSql(Request("parent"))
    title           = FLib.SafeSql(Request("title"))
    show_order      = FLib.SafeSql(Request("show_order"))
    remark          = FLib.SafeSql(Request("remark"))
    show            = FLib.SafeSql(Request("show"))

    Dim Sql, Rs
    Sql = "UPDATE special_list SET parent=" & parent & ", title='" & title & "', show_order=" & show_order & ", remark='" & remark & "', show=" & show & " WHERE id=" & rId
    Db.ExeCute(Sql)
    FLib.AddLog "修改Id为" & rId &"的源特性"

    FLib.Alert "执行完毕","Special_List.asp?Parent=" & FLib.GetCookie("SpecialList_Parent"), 0
    Response.End

End Function

'函数:删除记录
Function DeleteReco()
    Dim IdList
        IdList = FLib.SafeSql(Request("IdList"))
    If IdList = "" Then
        Exit Function
    End If

    Dim arrIdList, I, Sql, Rs
        arrIdList = Split(IdList, ",")

    For I=0 To UBound(arrIdList)
        Sql = "SELECT Top 1 * FROM special_list WHERE parent=" & arrIdList(I)
        Set Rs = Db.ExeCute(Sql)
        If Rs.Eof And Rs.Eof Then
            Sql = "DELETE FROM special_list WHERE id  = " & arrIdList(I)
            Db.ExeCute(Sql)
        End If
    Next

    FLib.AddLog "删除资源特性,Id:" & IdList

    FLib.Alert "执行完毕","Special_List.asp?Parent=" & FLib.GetCookie("SpecialList_Parent"), 0
    Response.End

End Function
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -