?? mynotes.asp
字號:
<!-- #include file="inc/db.inc" -->
<!-- #include file="inc/func.inc" -->
<!-- #include file="char.asp" -->
<%
userid=session("myuserid")
password=session("mypwd")
if isman(userid,password)=0 then
%>
<script>
alert("你不是管理員,無權(quán)進入!");
parent.location.href="index.asp";
</script>
<%
else%>
<html>
<head>
<title>班級留言管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="jscs/css.CSS" type=text/css rel=stylesheet>
<script language="JavaScript" src="jscs/jsfun.js"></script>
</head>
<%
sub alldelete()
sql="select id from [classnote]"
set rs=conn.execute(sql)
if rs.eof then
errmsg="操作失敗!目前沒有留言!\n"
call error(errmsg,"javascript:history.back()")
exit sub
end if
i=0
do until rs.eof
call delnotice(rs(0))
rs.movenext
i=i+1
loop
set rs=nothing
stitle="刪除留言"
smsg="您已經(jīng)成功的刪除了"&i&"條留言!\n"
call success(stitle,smsg,"mynotes.asp")
end sub
sub seldelete()
dim idlist,idarr,id
If request("id")="" then
Errmsg="請選擇所要刪除的留言!\n"
call error(errmsg,"javascript:history.back()")
exit sub
end if
idlist=request("id")
if instr(idlist,",")>0 then
idArr=split(idlist)
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call delnotice(id)
next
else
call delnotice(clng(idlist))
end if
stitle="刪除留言"
smsg="您已經(jīng)成功刪除了留言!"
call success(stitle,smsg,"mynotes.asp")
End sub
sub delnotice(id)
sql="delete from [classnote] where id="&id
conn.execute(sql)
end sub
sub shownotice()
%>
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#0099CC">
<form action="mynotes.asp" method="post" name="notice">
<tr bgcolor="#99CCFF">
<td colspan="4"> <div align="center"><strong>:::站點留言管理:::</strong></div>
<div align="center"></div></td>
</tr>
<tr bgcolor="#D2E9FE">
<td width="12%"><div align="center"><strong>時間</strong></div></td>
<td width="16%"><div align="center"><strong>發(fā)布者</strong></div></td>
<td width="59%"><div align="center"><strong>內(nèi)容</strong></div></td>
<td width="13%" bgcolor="#D2E9FE"><div align="center"><strong>操作</strong></div></td>
</tr>
<%
set rs=server.createobject("ADODB.Recordset")
sql="select * from classnote order by id desc"
rs.open sql,conn,1,1
if rs.eof or rs.bof then%>
<tr><td colspan="4">目前沒有留言</td></tr>
<%
else
Rs.Pagesize =15
Pageno = CLng(Request("page"))
If Pageno < 1 Then Pageno = 1
If Pageno > Rs.PageCount Then Pageno = Rs.PageCount
If pageNo = "" Then Pageno = 1
'Sub Showpage(Rs,pageno)
Rs.AbsolutePage = Pageno
for I =1 To Rs.PageSize
%>
<tr bgcolor="#D2E9FE">
<td> <div align="center"><%=FormatDateTime(rs("posttime"),2)%></div></td>
<td> <div align="center"><%=rs("truename")%></div></td>
<td><%=rs("content")%></td>
<td> <div align="center">
<input type="checkbox" name="id" value="<%=rs("id")%>">
</div></td>
</tr>
<%
Rs.Movenext
If Rs.Eof Then Exit For
Next
'end sub
end if%>
<% 'showpage rs,pageno %>
<tr bgcolor="#99CCFF">
<td colspan="4"><div align="right">
<input type=checkbox name=chkall value=on onClick="return CheckAll(this.form)">選中所有顯示記錄 <input type=submit name=action onClick="{if(confirm('確定刪除選定的紀錄嗎?')){this.document.notice.submit();return true;}return false;}" value="刪除所選"> <input type=submit name=action onClick="{if(confirm('確定清除所有的紀錄嗎?')){this.document.notice.submit();return true;}return false;}" value="全部刪除">
</div></td>
</tr>
</form>
</table>
<table width="80%" border="0" align="center">
<tr>
<td><div align="right"><%
If Pageno <>1 Then
Response.Write " <A href=mynotes.asp>首頁</A> "
Response.Write " <A href=mynotes.asp?page=" & (Pageno-1) & ">前頁</A> "
Else
Response.Write " 首頁 "
Response.Write " 前頁 "
End If
If Pageno <> rs.PageCount Then
Response.Write " <A href=mynotes.asp?page=" & (Pageno+1) & ">后頁</A> "
Response.Write " <A href=mynotes.asp?page=" & (Rs.PageCount) & ">末頁</A> "
Else
Response.Write " 后頁 "
Response.Write " 末頁 "
End If
%>位置<%=pageno%>/<%=rs.pagecount%></div></td>
</tr>
</table>
<%end sub%>
<body bgcolor="#F2F8FF">
<%if request("action")="全部刪除" then
call alldelete()
elseif request("action")="刪除所選"then
call seldelete()
elseif request("action")="發(fā)布公告" then
'call upform()
elseif request("action")="upload" then
'call addnow()
else
call shownotice()
end if%>
<br>
</body>
</html>
<%end if%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -