📄 author_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
Db.Open()
Dim sKey, sType, UrlInfo
sKey = FLib.SafeSql(Request("sKey"))
sType = FLib.SafeSql(Request("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">
<SCRIPT LANGUAGE="JavaScript" src="inc/FunctionLib.js"></script>
<script src="inc/Tkl_PageList.js"></script>
<SCRIPT LANGUAGE="JavaScript">
<!--
function AddReco()
{
self.location.href = "Author_Mdy.asp?Work=AddReco";
}
function MdyReco(mId)
{
self.location.href = "Author_Mdy.asp?Work=MdyReco&rId=" + mId;
}
function DeleteReco(IdList)
{
if(IdList == "") return false;
if(confirm("是否确定要删除选中项?"))
{
self.location.href = "Author_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>资源管理 > 附属资源 > 作者列表</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);">[增加作者]</a></td>
<td align="right">
<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>
<table width="100%" border="0" cellspacing="1" cellpadding="2" class="tabBgColor">
<tr>
<td width="2%" class="tabHead" align="center"> </td>
<td width="47%" align="center" class="tabHead">作者名称</td>
<td width="18%" class="tabHead" align="center">创建者</td>
<td width="18%" align="center" class="tabHead">创建时间</td>
<td width="15%" 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 = "&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 name="IdList" type="checkbox" class="input_checkbox" value="<%=Rs("id")%>">
</td>
<td height="11"><%=Rs("title")%></td>
<td width="18%" align="center" height="11"><%=Rs("creator")%></td>
<td height="11" align="center"><%=FormatDateTime(Rs("addtime"),2)%></td>
<td width="15%" 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="5" 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 id, title, addtime, creator FROM author_list WHERE {WHERE}"
If sKey = "" Then
sType = "0"
End If
Select Case sType
Case "1"
mWhere = "title LIKE '%" & sKey & "%'"
Case Else
mWhere = "'1'='1'"
End Select
If Not Admin.CheckPopedom("TSYS_GROUP2_OTHER_RES") Then
mWhere = mWhere & " AND creator='" & Admin.UserName & "'"
End If
Sql = Replace(Sql, "{WHERE}", mWhere)
ExeSql = Sql
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -