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

📄 admin_guestbook.asp

📁 玛雅自助导航系统 玛雅自助导航系统 玛雅自助导航系统
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Conn.asp"-->
<%
If Session(SiteSN&"_Admin_Login")<>AdminName&"_"&AdminPass Then
   Response.redirect "Admin_Login.asp"
   Response.End
End If

dim Action
Action=Request.QueryString("Action")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" 
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="style.css" rel="stylesheet" type="text/css">
<title>管理网站信息_<%=WebName & ChannelName%></title>
<style type="text/css">
<!--
.input {	font-size: 12px;
	border: 1px solid #CCCCCC;
	background-color: transparent;
	width: 130px;
}
.text {	font-size: 12px;
	border: 1px solid #CCCCCC;
	background-color: transparent;
}
-->
</style>

<script language="javascript">
//**********删除留言**********
function Del()
{
if(confirm("请确定是否删除留言,删除将无法恢复!"))
	return true;
else
	return false;

}
</script>
</head>
<body>
<div class="main_title1">
<a href="Admin_Manage.asp">管理首页</a> | <a href="Admin_Manage.asp?action=ListSite">管理网站信息</a> | <a href="Admin_Manage.asp?action=ShowLog">查看点击记录</a> | <a href="Admin_GuestBook.asp" class="t">管理网站留言</a> | <a href="Admin_Manage.asp?action=BatchDelform">批量删除数据</a> | <a href="admin_login.asp?action=exit">退出管理</a>
</div>

<div class="mainbar">
<%
select case Action
case "reply"'回复页面调用
    call reply
case "Replyy"'回复调用
    call Replyy
case "del"
    call del
case else
	call ListSite
end select
%></div><%

sub ListSite


dim MaxPageSize:MaxPageSize=10 '每页显示的记录数

'分页信息
dim PageNo
PageNo=Request.QueryString("PageNo")
if PageNo="" or not Isnumeric(PageNo) then
PageNo=1
else
PageNo=int(PageNo)
end if

'普通sql语句
Sql="select * from [Books] order by Books_Id desc"

%> 
<div style="text-align:center;">
  <div class="cutpage">      
<%Wap.showPageInfo "Books","Books_Id","",PageNo,MaxPageSize,""%>
</div>
</div>
<%

set rs=server.createobject("adodb.recordset")
rs.open sql,Conn,1,1

if not rs.eof then
	rs.PageSize = MaxPageSize
	rs.AbsolutePage = PageNo 
	dim i
	i=0   
%>
<table border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
  <tr align="center" class="main_title1"> 
    <td width="100">昵称</td>
    <td width="230">时间</td>
    <td width="388">操作管理</td>
  </tr>
  <%Do While Not rs.EOF and i<MaxPageSize%>
  <tr align="center"> 
    <td><% =Rs("Books_Name") %></td>
    <td><% =Rs("Books_Time") %></td>
    <td><a href='?Action=reply&Id=<%=Rs("Books_Id")%>' style='color:red'>回复</a>
    <a href='?Action=del&Id=<%=Rs("Books_Id")%>' onClick="return Del(this);" style='color:red'>删除</a>
    &nbsp;<font color='red'>IP为:<%=Rs("Books_Ip")%>
    </td>
                             <tr> 
    <td align="center">内容</td>
    <td colspan="2"><span style="width:730; word-break:break-all; word-wrap:break-word;">
      <% =Rs("Books_Info") %>
    </span></td>
  </tr>
<%If Rs("Books_Reply")<>"" then%>
  <tr> 
    <td bgcolor="#FDF0F9"><div align="center">回复:</div></td>
    <td colspan=2 bgcolor="#FDF0F9"><%=Rs("Books_Reply")%></td>
  </tr>
 <%End If%>

  <tr> 
    <td height="1" colspan="3" bgcolor="#8cc3de"></td>
  </tr>
 
  <%  
i=i+1  
rs.MoveNext  
Loop  
else
%>
  <tr> 
    <td height="80" colspan="3" align="center"><B>没有留言</B></td>
  </tr>
  <%
end if  
rs.close
set rs=nothing

%>
</table>
<%end sub


	sub reply
	dim rs
	Id=Request.QueryString("Id")
	Set Rs=Conn.execute("select * from [Books] where Books_Id="&Id)
	If Rs.eof then
	   Response.Write "<script>alert('非法操作:留言不存在!');this.location.href='Admin_GuestBook.asp';</SCRIPT>"
	   Response.End
	End If
	%> <form method="post" Action="?Action=Replyy&Id=<% =Id %>">
       <table width="83%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">

<tr class="tr2"> 
            <td width="13%" align="center">昵称:</td>
      <td width="87%" colspan="5"><input name="Books_Name" type="text" value="<% =Rs("Books_Name") %>" class="input"></td>
         </tr>
          <tr class="tr2"> 
            <td align="center">Q&nbsp; Q:</td>
            <td colspan="5"><input name="Books_Qq" type="text" value="<% =Rs("Books_Qq") %>" class="input"></td>
          </tr>
          <tr class="tr2"> 
            <td align="center">邮箱:</td>
            <td colspan="5"><input name="Books_Mail" type="text" value="<% =Rs("Books_Mail") %>" class="input"></td>
          </tr>
          <tr class="tr2"> 
            <td align="center">留言:</td>
            <td colspan="5"><textarea name="Books_Info" rows="9" cols="77" class="text"><% =Wap.HTMLCode(Rs("Books_Info"))%>
            </textarea>
            </td>
          </tr>
          
                    <tr class="tr2"> 
            <td align="center">回复:</td>
            <td colspan="5"><textarea name="Books_Reply" rows="9" cols="77" class="text"><% =Wap.HTMLCode(Rs("Books_Reply")) %></textarea></td>
                    </tr>
          <tr class="tr2"> 
            <td colspan="6" align="center" class="td"> <input name="submit1" type="submit" value="回复留言">&nbsp;&nbsp;<input type="reset" value=" 重新输入 "></td>
          </tr>
  </table>
      </form>
 <%end sub
 
'回复调用
sub Replyy
    Id=Request.QueryString("Id")
 	Sql="update [Books] Set Books_Name='"&Request.form("Books_Name")&"',Books_Qq='"&Request.form("Books_Qq") &"',Books_Mail='"&Request.form("Books_Mail") &"',Books_Info='"& Wap.HTMLEncode(Request.form("Books_Info"))&"',Books_Reply='"& Wap.HTMLEncode(Request.form("Books_Reply")) &"'where  Books_Id="& Id &""
	Conn.execute(Sql)
	Response.Write "<script>alert('回复成功!');this.location.href='Admin_GuestBook.asp';</SCRIPT>"
end sub

'删除调用
sub del
    Id=Request.QueryString("Id")
	Sql="delete from [Books] where Books_Id="&Id
	Conn.execute(Sql)
	Response.Write "<script>alert('删除成功!');this.location.href='Admin_GuestBook.asp';</SCRIPT>"
end sub
%> 

<!--#include file="under.asp"-->
<%set Wap=nothing%>

⌨️ 快捷键说明

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