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

📄 slicepackage_update.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
    Parent = 0
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>
<SCRIPT LANGUAGE="JavaScript">
<!--
function AddReco(Parent, ClassTitle)
{
    self.location.href = "SlicePackage_Mdy.asp?Work=AddReco&ClassTitle=<%=Server.UrlEncode(ClassTitle)%>&Parent=<%=Parent%>";
}

function MdyReco(mId)
{
    self.location.href = "SlicePackage_Mdy.asp?Work=MdyReco&rId=" + mId;
}

function DeleteReco(IdList)
{
    if(IdList == "") return false;
    if(confirm("是否确定要删除选中项?"))
    {
        self.location.href = "SlicePackage_Process.asp?Work=DeleteReco&IdList=" + IdList;
    }else{
        return false;
    }
}

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;

	EditSlice(obj);
}

function EditSlice(obj)
{
	window.open("fsdf");
}
//-->
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<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>
<hr size="1">
<%


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:80px; overflow:hidden; padding:3px; margin:3px; cursor:hand;"" onmouseover=""SliceOnMouseOver(this)"" onmouseout=""SliceOnMouseOut(this)"" onclick=""SliceOnClick(this)"" title=""" & Server.HtmlEncode(Rs("content")) & """>名称:" & Rs("title") & "<br>类型:静态碎片<br>频道:" & Rs("class_title") & "<br>人物:" & Rs("last_update_user") & "<br>上次:" & Rs("last_update_date") & "</span>" & vbCrLf

    Rs.MoveNext
Next

If Rs.Eof And Rs.Bof Then
	Response.Write "none"
End If
%>
</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
%>

⌨️ 快捷键说明

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