📄 slice_list.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_SLICE") Then
FLib.Alert "权限不足", "BACK", 0
Response.End
End If
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
Db.Open()
%>
<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">
<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 = "Slice_Mdy.asp?Work=AddReco&ClassTitle=<%=Server.UrlEncode(ClassTitle)%>&Parent=<%=Parent%>";
}
function MdyReco(mId)
{
self.location.href = "Slice_Mdy.asp?Work=MdyReco&rId=" + mId;
}
function DeleteReco(IdList)
{
if(IdList == "") return false;
if(confirm("是否确定要删除选中项?"))
{
self.location.href = "Slice_Process.asp?Work=DeleteReco&IdList=" + IdList;
}else{
return false;
}
}
//-->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabTitleBar">
<tr>
<td> 资源配置 > 碎片管理 > <%=Classtitle%></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<form name="form1" method="post" action="">
<tr>
<td> <a href="javascript:AddReco();void(0);" title="在当前位置增加">[增加碎片]</a></td>
<td align="right">
<input type="hidden" name="Parent" value="<%=Parent%>">
<input type="text" name="sKey" size="20" value="<%=sKey%>" class="input_text">
<select name="sType" class="select_list">
<option value="0" selected> </option>
<option value="1">碎片名称</option>
</select>
<input type="submit" name="Submit" value="提交" class="input_button">
</td>
</tr>
</form>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="tabBgColor">
<tr>
<td width="2%" class="tabHead" align="center"> </td>
<td width="37%" align="center" class="tabHead">碎片名称</td>
<td width="15%" align="center" class="tabHead">分类</td>
<td width="16%" class="tabHead" align="center">创建者</td>
<td width="17%" class="tabHead" align="center">创建时间</td>
<td width="13%" class="tabHead" align="center">操作</td>
</tr>
<%
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
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
%>
<tr class="<%=trClass%>">
<td width="2%" align="center" height="11">
<input type="checkbox" name="IdList" value="<%=Rs("id")%>" class="input_checkbox">
</td>
<td height="11" width="37%"><%=Rs("title")%></td>
<td align="center" width="15%"><%=Rs("class_title")%></td>
<td width="16%" align="center" height="11"><%=Rs("creator")%></td>
<td width="17%" align="center" height="11"><%=FormatDateTime(Rs("addtime"),2)%></td>
<td width="13%" align="center" height="11"> <a href="javascript:MdyReco('<%=Rs("id")%>');void(0);">编辑</a></td>
</tr>
<%
Rs.MoveNext
Next
If Rs.Eof And Rs.Bof Then%>
<tr>
<td colspan="6" align="center">暂无相关数据</td>
</tr>
<%End If%>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="17%"> <a href="javascript:SelectAllCheckBox('IdList');void(0);">[返选]</a>
<a href="javascript:DeleteReco(GetCheckBoxList('IdList'));void(0);">[删除]</a></td>
<td width="83%" align="right">
<script language="JavaScript">
<!--
var plb = new PageListBar('plb', <%=PageCount%>, <%=CurrPage%>, '<%=UrlInfo%>', 20);
document.write(plb);
//-->
</script>
</td>
</tr>
</table>
</body>
</html>
<%
'函数:处理Sql脚本
'返回:Sql
Function ExeSql()
Dim Sql, mWhere
Sql = "SELECT A.id, A.title, A.creator, A.addtime, B.title AS class_title FROM slice_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 + -