⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mynotes.asp

📁 一路飞扬在线同学录单班级版,主要用于个人系统中的同学录,不过对于学习有帮助!
💻 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("你不是管理员,无权进入!");
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="您已经成功的删除了"&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="您已经成功删除了留言!"
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>发布者</strong></div></td>
      <td width="59%"><div align="center"><strong>内容</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)">选中所有显示记录&nbsp;<input type=submit name=action onClick="{if(confirm('确定删除选定的纪录吗?')){this.document.notice.submit();return true;}return false;}" value="删除所选">&nbsp;<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 "&nbsp;<A href=mynotes.asp>首页</A>&nbsp;"
	Response.Write "&nbsp;<A href=mynotes.asp?page=" & (Pageno-1) & ">前页</A>&nbsp;"
Else
	Response.Write "&nbsp;首页&nbsp;"
	Response.Write "&nbsp;前页&nbsp;"
End If
If Pageno <> rs.PageCount Then
	Response.Write "&nbsp;<A href=mynotes.asp?page=" & (Pageno+1) & ">后页</A>&nbsp;"
	Response.Write "&nbsp;<A href=mynotes.asp?page=" & (Rs.PageCount) & ">末页</A>&nbsp;"
Else
	Response.Write "&nbsp;后页&nbsp;"
	Response.Write "&nbsp;末页&nbsp;"
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")="发布公告" then
	'call upform()
elseif request("action")="upload" then
	'call addnow()
else
	call shownotice()
end if%>
<br>
</body>
</html>
<%end if%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -