📄 bulletinlist.asp
字号:
<!--#include File="../ConnDB.asp"-->
<!--#include File="../class/Bulletin.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>公告管理</title>
<link href="../style.css" rel="stylesheet">
<script language="javascript">
function newWin(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=400,height=300";
var newWin = window.open(url,"newWin",oth);
newWin.focus();
return false;
}
function SelectChk()
{
var s = false; //用来记录是否存在被选中的复选框
var Bulletinid, n=0;
var strid, strurl;
var nn = self.document.all.item("Bulletin"); //返回复选框Bulletin的数量
for (j=0; j<nn.length; j++) {
if (self.document.all.item("Bulletin",j).checked) {
n = n + 1;
s = true;
Bulletinid = self.document.all.item("Bulletin",j).id+""; //转换为字符串
//生成要删除公告编号的列表
if(n==1) {
strid = Bulletinid;
}
else {
strid = strid + "," + Bulletinid;
}
}
}
strurl = "BulletinDelt.asp?id=" + strid;
if(!s) {
alert("请选择要删除的公告!");
return false;
}
if (confirm("你确定要删除这些公告吗?")) {
form1.action = strurl;
form1.submit();
}
}
function sltAll()
{
var nn = self.document.all.item("Bulletin");
for(j=0;j<nn.length;j++)
{
self.document.all.item("Bulletin",j).checked = true;
}
}
function sltNull()
{
var nn = self.document.all.item("Bulletin");
for(j=0;j<nn.length;j++)
{
self.document.all.item("Bulletin",j).checked = false;
}
}
</script>
</head>
<body link="#000080" vlink="#080080">
<form name="form1" method="POST">
<%
'设置SQL语句,查询表Bulletin中的公告信息,读取到rs对象中
set obj = new Bulletin
obj.GetBulletinlist
Dim n '用来保存记录数量
'如果rs为空,则显示提示信息
If obj.rs.EOF Then
Response.Write "<tr><td colspan=5 align=center>目前还没有公告。</td></tr></table>"
Else
%>
<p align=center><font style='FONT-SIZE:12pt' color="#000080"><b>查 看 公 告</b></font></p>
<table align=center border="1" cellspacing="0" width="100%" bordercolorlight="#4DA6FF" bordercolordark="#ECF5FF" style='FONT-SIZE: 9pt'>
<tr>
<td width="6%" align="center" bgcolor="#FFCCFF"><strong>编号</strong></td>
<td width="50%" align="center" bgcolor="#FFCCFF"><strong>题目</strong></td>
<td width="24%" align="center" bgcolor="#FFCCFF"><strong>时间</strong></td>
</tr>
<%
'设置每页记录数量为15
obj.rs.PageSize = 15
'设置并读取页码参数page
iPage = CLng(Request("page"))
If iPage <=0 Then
iPage = 1
End If
If iPage > obj.rs.PageCount Then
iPage = obj.rs.PageCount
End If
RowCount = obj.rs.PageSize
'依次显示公告信息
Do While Not obj.rs.EOF And RowCount > 0
n = n + 1
%>
<tr>
<td align="center"><%=n%></td>
<td><a href="../BulletinView.asp?id=<%=obj.rs("Id")%>" onClick="return newWin(this.href)"><%=obj.rs("Title")%></a></td>
<td align="center"><%=obj.rs("PostTime")%></td>
</tr>
<%
obj.rs.MoveNext()
'控制每页显示记录的数量
RowCount = RowCount - 1
Loop
%>
</table>
<%
'显示页码链接
If obj.rs.PageCount>1 then
Response.Write "<table border='0'><tr><td><b>分页:</b></td>"
For i=1 to obj.rs.PageCount
Response.Write "<td><a href='BulletinList.asp?page=" & i & "'>"
Response.Write "[<b>" & i & "</b>]</a></td>"
Next
Response.Write "</tr></table>"
End If
End If
%>
<p align="center">
<input type=hidden name="Bulletin">
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -