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

📄 slicepackageupdate_list.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

Db.Open()

Dim sKey, sType, Parent, UrlInfo, ClassTitle
    sKey = FLib.SafeSql(Request("sKey"))
    sType = FLib.SafeSql(Request("sType"))
    Parent = FLib.SafeSql(Request("Parent"))
    ClassTitle = Request("ClassTitle")

If Parent = "" Or Not IsNumeric(Parent) Then
    FLib.Alert "参数有误", "BACK", 0
    Response.End
End If

If Not FLib.chkPope_AboutTheClass(Parent, "slice") Then
    FLib.Alert "你无法在此频道更新碎片、碎片包", "BACK", 0
    Response.End
End If

Dim Rs, Sql
Dim CurrPage, PageCount

Set Rs = Db.CreateRS()
Sql = Db.SqlTran(ExeSql())
Rs.PageSize = 20
Rs.CacheSize = Rs.PageSize
Rs.Open Sql, Db.Conn, 1, 1
PageCount = Rs.PageCount

If Request("CurrPage") = "" Then
    CurrPage = 1
Else
    CurrPage = Request("CurrPage")
End If

If Not(Rs.Eof And Rs.Bof) Then
    Rs.AbsolutePage = CurrPage
End If

UrlInfo = "&Parent=" & Parent & "&ClassTitle=" & ClassTitle & "&sKey=" & sKey &"&sType=" & sType
%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="inc/style.css" type="text/css">
<style>
.myslice {
    color: #006699;
    font-size: 12px;
    border: 2 solid #006699;
    background-color: #F6F6F6;
}
.myslice_mouseout {
    color: #006699;
    font-size: 12px;
    border: 2 solid #006699;
    background-color: #F6F6F6;
}

.myslice_mouseover {
    color: #000000;
    font-size: 12px;
    border: 2 solid #000000;
    background-color: #FFFFFF;
}

.myslice_click {
    color: #0000CC;
    font-size: 12px;
    border: 2 solid #0000CC;
    background-color: #FFFFFF;
}

</style>
<SCRIPT LANGUAGE="JavaScript" src="inc/FunctionLib.js"></script>
<script src="inc/Tkl_PageList.js"></script>
<!-- 右键菜单 开始-->
<link href="lib/ContextMenu/css/WebFX-ContextMenu.css" rel="stylesheet" type="text/css">
<script src="lib/ContextMenu/js/ieemu.js"></script>
<script src="lib/ContextMenu/js/ContextMenu.js"></script>
<!-- 右键菜单 结束-->
<SCRIPT LANGUAGE="JavaScript">
<!--
if (moz) {
    extendEventObject();
    emulateEventHandlers(["click", "mouseover", "mouseout"]);
    extendElementModel();
    // needed to attach keydown
    emulateAttachEvent();
}

function contextForSPItem(SP_Id)
{
   var eobj,popupoptions
   popupoptions = [
                    new ContextItem("更新碎片包",function(){UpdateSlicePackage(SP_Id);})
                  ]
   ContextMenu.display(popupoptions);
}

function contextForBody()
{
   var eobj,popupoptions
   popupoptions = [
                    new ContextItem("刷新",function(){window.location.reload()}),
                    new ContextItem("源码",function(){window.location = 'view-source:' + window.location.href})
                  ]
   ContextMenu.display(popupoptions)
}

function UpdateSlicePackage(SP_Id)
{
    window.location.href = "SliceUpdate_Process.asp?Work=ExeCuteSlicePackage&Id=" + SP_Id;
}

var objLastSlice = null
function SliceOnMouseOver(obj)
{
    if(obj == objLastSlice) return;
    obj.className = "myslice_mouseover";
}

function SliceOnMouseOut(obj)
{
    if(obj == objLastSlice) return;
    obj.className = "myslice_mouseout";
}

function SliceOnClick(obj)
{
    if(objLastSlice)
    {
        objLastSlice.className = "myslice_mouseout";
    }

    obj.className = "myslice_click";
    objLastSlice = obj;
}
//-->
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000" onload="ContextMenu.intializeContextMenu()" oncontextmenu="contextForBody()">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabTitleBar">
  <tr> 
    <td> 频道更新 &gt; 更新碎片包 &gt; <%=Classtitle%></td>
  </tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>
      <%


Dim I, trClass
For I=1 To Rs.PageSize
    If Rs.Eof Then
        Exit For
    End If

    If I Mod 2 = 0 Then
        trClass = "tabRow1"
    Else
        trClass = "tabRow2"
    End if

    Response.Write "<span id=""mySpan" & Rs("id") & """ class=""mySlice"" style=""width:200px; height:70px; overflow:hidden; padding:3px; margin:3px; cursor:hand;"" onmouseover=""SliceOnMouseOver(this)"" onmouseout=""SliceOnMouseOut(this)"" onclick=""SliceOnClick(this)"" oncontextmenu=""contextForSPItem(" & Rs("id") & ")"" title=""" & Server.HtmlEncode(Rs("content")) & """>名称:" & Rs("title") & "<br>频道:" & Rs("class_title") & "<br>人物:" & FormatLastUpdateUser(Rs("last_update_user")) & "<br>上次:" & FormatLstUpdateTime(Rs("last_update_date")) & "</span>" & vbCrLf

    Rs.MoveNext
Next

If Rs.Eof And Rs.Bof Then
    Response.Write "none"
End If
%>
    </td>
  </tr>
</table>
<hr size="1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form name="form1" method="post" action="">
    <tr> 
      <td width="53%"><script language="JavaScript">
    <!--
    var plb = new PageListBar('plb', <%=PageCount%>, <%=CurrPage%>, '<%=UrlInfo%>', 20);
    document.write(plb);
    //-->
    </script></td>
      <td width="47%" align="right"> <input type="hidden" name="Parent" value="<%=Parent%>"> 
        <input name="sKey" type="text" class="input_text" value="<%=sKey%>" size="20"> 
        <select name="sType" class="select_list">
          <option value="0" selected>    </option>
          <option value="1">碎片包名称</option>
        </select> <input name="Submit" type="submit" class="input_button" value="提交"> 
      </td>
    </tr>
  </form>
</table>
</body>
</html>
<%
'函数:处理Sql脚本
'返回:Sql
Function ExeSql()
    Dim Sql, mWhere
    Sql = "SELECT A.id, A.title, A.content, A.last_update_user, A.last_update_date, A.creator, A.addtime, B.title AS class_title FROM slice_package_list A LEFT JOIN res_class_list B ON A.class_id = B.id WHERE {WHERE} ORDER BY A.id DESC"
    If sKey = "" Then
        sType = "0"
    End If
    Select Case sType
        Case "1"
            mWhere = "A.title LIKE '%" & sKey & "%'"
        Case Else
            mWhere = "'1'='1'"
    End Select

    Dim ChildList
        ChildList = FLib.ChildenList(Parent)
    If ChildList <> "" Then
        ChildList = Parent & "," & ChildList
    Else
        ChildList = Parent
    End If

    mWhere = mWhere & " AND A.class_id IN (" & ChildList & ")"
    Sql = Replace(Sql, "{WHERE}", mWhere)
    ExeSql = Sql
End Function

Function FormatLastUpdateUser(val)
    If IsNull(val) Or val="" Then
        FormatLastUpdateUser = "-"
    Else
        FormatLastUpdateUser = val
    End If
End Function

Function FormatLstUpdateTime(val)
    If IsNull(val) Or val="" Then
        FormatLstUpdateTime = "-"
    Else
        FormatLstUpdateTime = val
    End If
End Function
%>

⌨️ 快捷键说明

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