dim cls
if session("admin")="" then
Response.Redirect("admin.asp")
else
if session("flag")"0" then
cls = Instr(session("flag"), "feedback")
if cls %>
if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
location.href="admin.asp";
else
location.href="quit.asp";
end if
end if
end if
%>
管理界面
a:link {color: #FFFFFF;text-decoration: none;}
a:visited {color: #FFFFFF;text-decoration: none;}
a:hover {color: #FFFF99;text-decoration: underline;}
.b{color:#cccc99;font-size:10pt;border:dotted 1px}
-->
function CheckAll(form) {
for (var i=0;i var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
function checksend(){
if (javaTrim(document.repl.Replay.value)==""){
alert("您没有填写回复内容。");
document.repl.Replay.focus();
document.repl.Replay.value="";
return false;
}
return true;
}
function javaTrim(str) {
for (var i=0; (str.charAt(i)==' ') && i if (i == str.length) return ''; //whole string is space
var newstr = str.substr(i);
for (var i=newstr.length-1; newstr.charAt(i)==' ' && i>=0; i--);
newstr = newstr.substr(0,i+1);
return newstr;
}
当前位置:网站管理中心--留言管理
if action="" then
%>
姓名
留言内容
留言日期
回复内容
回复日期
是否隐藏
删除
dim rs,msg_per_page
dim sql
msg_per_page = 10 '定义每页显示记录条数
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from Feedback where del=false order by PostDate desc"
rs.cursorlocation = 3 '使用客户端游标,可以使效率提高
rs.pagesize = msg_per_page '定义分页记录集每页显示记录数
rs.open sql,conn,1,1
if err.number0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
if not (rs.eof and rs.bof) then '检测记录集是否为空
totalrec = RS.RecordCount 'totalrec:总记录条数
if rs.recordcount mod msg_per_page = 0 then '计算总页数,recordcount:数据的总记录数
n = rs.recordcount\msg_per_page 'n:总页数
else
n = rs.recordcount\msg_per_page+1
end if
currentpage = request("page") 'currentpage:当前页
If currentpage "" then
currentpage = cint(currentpage)
if currentpage < 1 then
currentpage = 1
end if
if err.number 0 then
err.clear
currentpage = 1
end if
else
currentpage = 1
End if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage 'absolutepage:设置指针指向某页开头
rowcount = rs.pagesize 'pagesize:设置每一页的数据记录数
dim i
dim k
Do while not rs.eof and rowcount>0
content=rs("Comments")
if content"" then content=Autolink(content)
Replay=rs("Replay")
if Replay"" then Replay=Autolink(Replay)
UserName=rs("UserName")
if UserName"" then UserName=Autolink(UserName)
Response.write ""&UserName&""
if len(rs("Comments"))>20 then
response.write left(content,20)&" ..."
else
Response.write content
end if
response.write " "&rs("Postdate")&""
if Isnull(rs("Replay")) then
response.write "马上回复 "
else
if len(rs("Replay"))>20 then
response.write left(Replay,20)&" ..."
else
Response.write Replay
end if
response.write ""&rs("ReplayDate")&""
if rs("Online")="0" then response.write "隐藏" else response.write "公开" end if
response.write ""
end if
response.write ""
rowcount=rowcount-1
rs.movenext
loop
else
response.write "无满足条件留言"
end if
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
call listPages()
end if
if action="删除" then
delid=replace(request("id"),"'","")
call delfeedback()
end if
if action="replay" then
id=request("id")
call detailfeedback()
end if
%>
sub delfeedback()
if delid="" or isnull(delid) then
Response.write "操作失败,没有选择合适参数!点击返回"
else
conn.execute("delete from Feedback where ID in ("&delid&")")
if err.number0 then '错误处理
response.write "数据库操作失败:" & err.description
err.clear
else
conn.close
set conn=nothing
Response.write "留言删除成功!点击返回"
end if
end if
end sub
sub detailfeedback()
if id="" then
response.write "非法留言编号"
response.write ""
else
'修改留言资料
if request("send")="ok" then
set rs=server.createobject("adodb.recordset")
sql = " select * from feedback where del=false and ID="&id
rs.open sql,conn,1,3
if err.number0 then
response.write "数据库操作失败:" & err.description '错误描述
err.clear
else
if not (rs.eof and rs.bof) then
rs("Replayer")=session("admin")
if request.form("Replay")"" then rs("Replay")=request.form("Replay")
rs("ReplayDate") = Now()
rs("Online")=request("Online")
rs.update
end if
end if
rs.close
response.write "留言已经修改、回复"
response.write ""
response.end
end if
'显示详细资料
set rs = server.createobject("adodb.recordset")
sql = "select * from feedback where ID="&id
rs.open sql,conn,1,1
if err.number0 then '错误处理
response.write "数据库操作失败:" & err.description '错误描述
err.clear
else
if not (rs.eof and rs.bof) then
Comments=rs("Comments")
Comments=Autolink(Comments)
replay=rs("Replay")
if replay"" then replay=Autolink(replay)
%>
序列ID :
留言日期[]
留言人
邮件
留言内容
回复
更新回复
是否隐藏
隐藏
公开
else
response.write "无此序号留言!请检查!"
end if
end if
rs.close
set rs=nothing
end if
end sub
sub listPages()
if n %>
>>
首页
首页
前页
后页
下页
末页
总:/页 总共:条留言 [条/页]