📄 note.asp
字号:
<% option explicit %>
<!--#include file="../function1/DBOpen.asp"-->
<%
if session("purview")="" then
Response.Redirect"../login.asp?id=0"
end if
dim isedit '是否在修改状态
dim color '表格颜色
dim sql,rs,rsc,sql2,rs2,classid,rs3,classname,curpage,i
color=1
isedit=false
function invert(str)
invert=replace(replace(replace(replace(str,"<","<"),">",">"),"<br>",chr(13))," "," ")
end function
if request("action")="edit" then
isedit=true
end if
if request("action")="del" then '**********************删除文章**********************
sql="delete from travel_notes where noteid=" & cstr(request("noteid"))
conn.execute sql
if err.number <> 0 then
response.write "数据库操作错误:" + err.description
err.clear
else
%>
<script language=vbscript>
msgbox "操作成功!该文章已删除!"
</script>
<% end if
end if
%><html>
<head>
<title>文章管理</title>
<meta http-equiv="Content-board" content="text/html; charset=gb2312">
<style type="text/css">
<!--
.style8 {color: #FFFFFF}
-->
</style>
<div align="center">
<STYLE>TABLE {FONT-SIZE: 12px;COLOR: ##FFFFFF; FONT-FAMILY: 宋体;LINE-HEIGHT: 180%}
.Shadow_white {FONT-SIZE: 14pt; FILTER: dropshadow(color:black, offx=1, offy=1, positive=1); WIDTH: 70%; COLOR: ##FFFFFF; FONT-FAMILY: 宋体; POSITION: relative}
.Shadow_white2 {FONT-SIZE: 10pt; FILTER: dropshadow(color:black, offx=1, offy=1, positive=1); WIDTH: 70%; COLOR: ##FFFFFF; FONT-FAMILY: 宋体; POSITION: relative}
A:link {COLOR: ##FFFFFF; TEXT-DECORATION: none}
A:active {COLOR: ##FFFFFF; TEXT-DECORATION: none}
A:visited {COLOR: ##FFFFFF; TEXT-DECORATION: none}
A:hover {COLOR: #ff0000; TEXT-DECORATION: underline}
</STYLE></head>
<body>
<script language=JavaScript>
function SureDel(id)
{
if ( confirm("确定删除这个文章吗?"))
{
window.location.href = "note.asp?action=del¬eid=" + id
}
}
</script>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from travel_notes",conn,1,1
if rs.bof and rs.eof then
rs.close
response.write "目前没有任何文章"
end if %>
<table border="0" width="90%" bgcolor="#0000CC" cellpadding="0" cellspacing="1" align="center">
<tr bgcolor="#0000CC">
<td height="20" colspan="6">
<div align="center"></div> <div align="center"></div>
<div align="center" class="style8">文章管理</div>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="36%">
<div align="center">文章标题</div>
</td>
<td width="16%"><div align="center">作者</div></td>
<td width="16%"><div align="center">发布时间</div></td>
<td width="15%"><div align="center">关联相册</div></td>
<td width="10%">
<div align="center">操作</div>
</td>
</tr>
<%if request("page")="" then
curpage = 1
else
curpage = cint(request("page"))
end if
rs.pagesize=15
rs.absolutepage = curpage
for i = 1 to rs.pagesize
classid=rs("classid")
set rs3=server.createobject("adodb.recordset")
rs3.open "select * from class where id="&classid,conn,1,1
if rs3.bof and rs3.eof then
classname="无"
else
classname=rs3("name")
end if
rs3.close
set rs3=nothing
%>
<tr>
<td width="36%" bgcolor="#FFFFFF">
<div align="left"> <a href='../shownotes.asp?noteid=<%=cstr(rs("noteid"))%>' target=_blank><%=rs("topic")%></a></div></td>
<td width="16%" bgcolor="#FFFFFF"><div align="center"><%=rs("author")%></div></td>
<td width="16%" bgcolor="#FFFFFF"><div align="center"><%=rs("time")%></div></td>
<td width="15%" bgcolor="#FFFFFF"><div align="center"><%=trim(classname)%></div></td>
<td width="10%" bgcolor="#FFFFFF">
<div align="center"><%if session("purview")="99999" then%><a href='editnote.asp?noteid=<%=cstr(rs("noteid"))%>&action=edit' target="_blank">编辑</a> <a href='javascript:SureDel(<%=cstr(rs("noteid"))%>)'>删除</a><%else%>无权限<%end if%></div>
</td>
</tr>
<% rs.movenext
if rs.eof then
i = i + 1
exit for
end if
next
%>
</table>
<form name="form2" method="post" action="note.asp">
<%
response.write "<div align=center>"
response.write "第<font color=red>" + cstr(curpage) + "</font>页/总<font color=red>" + cstr(rs.pagecount) + "</font>页 "
response.write "本页<font color=red>" + cstr(i-1) + "</font>条/总<font color=red>" + cstr(rs.recordcount) + "</font>条 "
if curpage = 1 then
response.write "首页 前页 "
else
response.write "<a href='notelist.asp?page=1'>首页</a> <a href='notelist.asp?page=" & cstr(curpage-1) & "'>前页</a> "
end if
if curpage = rs.pagecount then
response.write "后页 末页"
else
response.write "<a href='notelist.asp?page=" + cstr(curpage+1) + "'>后页</a> <a href='notelist.asp?page=" + cstr(rs.pagecount) + "'>末页</a>"
end if%>
转到
<select name="page" class="input" onChange="javascript:submit()">
<%for i=1 to rs.pagecount%>
<option value=<%=i%>
<%
if i=curpage then
response.write" selected"
end if
%>
>第<%=i%>页</option>
<%next%>
</select>
<%'rs.close
set rs=nothing
%>
</div>
<p align="center"><a href="editnote.asp" target="_blank">增加</a> </p>
</body>
</html>
<!--#include file="../function/DBclose.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -