📄 listnotice.asp
字号:
<!-- #include file="utility/check.asp" -->
<%
'****************************************
'目的: 列表显示所有公告信息
'开始时间: 2005-6-4 9:49
'最后修改时间: 2005-6-4 9:49
'编写人: 某某某
'****************************************
dim sql
dim rs
dim tFlag '教师级别
'根据不同级别的管理员信息显示不同的操作链接
dim opMessage
dim pageSize '每页显示信息数目
dim pgnm '总共的页面数目
dim page '用户请求的页面索引
dim count '消息计数器,用来判断是否到达分页条目
count = 0
pageSize = 9
sql = "select teacher.tName,notice.* from teacher,notice"
sql = sql & " where teacher.ID = notice.tID "
'保证最新的Notice显示在最前面
sql = sql & " order by notice.ID desc"
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>已发信息列表</title>
<link rel="stylesheet" type="text/css" href="images/link.css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<div align="center">
<table border="1" width="700" id="table2" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="22">
<tr>
<td> 当前操作: 公告列表</td>
</tr>
</table>
<br>
<%
set rs = ExecuteQuery(sql)
if(rs.EOF) then
Response.write("暂时没有任何公告!")
else
rs.PageSize = pageSize
pgnm = rs.PageCount
if(IsEmpty(page) or cint(page) < 1 or cint(page) > pgnm) then
page = 1
end if
rs.absolutePage = page '指定当前页码
%>
<table border="1" width="700" id="table1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="78" bordercolor="#CCCCCC">
<tr>
<td width="84" height="25" align="center">发布人</td>
<td height="25" align="center" width="338">标题</td>
<td height="25" align="center" width="86">发布时间</td>
<td height="25" align="center">操作</td>
</tr>
<%
while(not rs.EOF)
'依据不同的管理员级别显示不同的信息
if(Session("userFlag") = "管理员" or Session("userID") = rs("tID")) then
opMessage = "<a href=showNotice.asp?nID=" & rs("ID")
opMessage = opMessage & ">查看</a>/"
opMessage = opMessage & "<a href=changeNotice.asp?nID=" & rs("ID")
opMessage = opMessage & ">修改</a>/"
opMessage = opMessage & "<a href=manageNotice.asp?actionType=delete&nID=" & rs("ID")
opMessage = opMessage & ">删除</a>"
else
opMessage = "<a href=showNotice.asp?nID=" & rs("ID") & ">查看</a>"
end if
%>
<tr>
<td width="84" align="center" height="25"><%=rs("tName")%></td>
<td height="25" width="338"> <a href="showNotice.asp?nID=<%=rs("ID")%>"><%=rs("nTitle")%></a></td>
<td height="25" width="86" align=center><%=rs("nTime")%></td>
<td height="25" align="center"><%=opMessage%></td>
</tr>
<%
rs.MoveNext()
wend
%>
<tr>
<td align="right" height="26" colspan="4"><%if page=1 then%>
<font color="#CCCCCC">上一页</font><%else%>
<a href="listNotice.asp?page=<%=page-1%>">上一页</a><%end if%>
<%if page\pgnm=0 then%><a href="listNotice.asp?page=<%=page+1%>">下一页</a><%else%>
<font color="#CCCCCC">下一页</font><%end if%>
共<font color="#FF0000"><%=rs.recordcount%></font>条信息,每页<font color="#FF0000"><%=pageSize%></font>条,共<font color="#FF0000"><%=pgnm%></font>页,<span lang="zh-cn">当前为第<font color="#FF0000"><%=page%></font>页,</span>跳转到<select name="page" onChange="MM_jumpMenu('this',this,0)" style="border:1px solid #8293E6; font-size: 9pt;width=62px;height=16px; color:#111111; background-color:#DDDDFF">
<option selected value="#">请选择</option>
<%for i=1 to pgnm%>
<option value="listNotice.asp?page=<%=i%>">第<%=i%>页
</option>
<%next%>
</select></td>
</tr>
</table>
<%
end if
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -