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

📄 admin_message.asp

📁 商业网站/图片管理系统/投票系统/新闻管理系统/
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<%
if request.cookies("admin_OK")="" then
	response.redirect("admin_login.html")
end if
%>
<%
dim db
db=0
%>
<!-- #include file="../config/db.asp" -->
<!-- #include file="../config/function.inc.asp" -->
<%
'-------------------------变量定义-----------------------------------
dim sql,rst,myErrors,page,pagelistnum,addselectwords,errstr

'-------------------------翻叶函数处理-------------------------------
pagelistnum=6
if request.querystring("page")="" then
	page=1
else
	page=request.querystring("page")
end if
'--------------------------rst纪录设置-------------------------------
set rst=server.createobject("adodb.recordset")
'-------------------------显示类型处理--------------------------------]
select case request.QueryString("showtype")
	case "all"
		session("msgshowtype")="all"
	case "checkup"
		session("msgshowtype")="checkup"
	case "uncheckup"
		session("msgshowtype")="uncheckup"
	case else
		if session("msgshowtype")="" then session("msgshowtype")="all"
end select

'------------------------处理显示类型时需要更改的SQL查询语句条件-----------------
select case session("msgshowtype")
	case "all"
		addselectwords=""
	case "checkup"
		addselectwords=" and m_check=true"
	case "uncheckup"
		addselectwords=" and m_check=false"
end select
	

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后台留言管理</title>
<link href="../css/mycss.css" rel="stylesheet" type="text/css" />
<script language="javascript">
<!--

function checkup(flag,mid)
{
  if (flag=="ok")
	location="admin_message.asp?page=<%=page%>&act=checkup&m_id="+mid;
  else
	location="admin_message.asp?page=<%=page%>&act=uncheckup&m_id="+mid;
}

function changeshowtype(val)
{
    location="admin_message.asp?page=<%=page%>&showtype="+val;
}
//-->
</script>
<style type="text/css">
<!--
.STYLE1 {font-size: 16px}
-->
</style>
</head>
<body>
<%
'--------------------------处理页面参数act=checkup-------------------------------
if request.querystring("act")<>"" then
	if not isnumeric(request.querystring("m_id")) or isempty(request.querystring("m_id")) then
		msgboxU "参数错误"
	else
		select case request.QueryString("act")
		   case "del"'删除留言
			sql="delete from shop_message where m_id="&request.Querystring("m_id")
			conn.execute sql
			errstr="删除留言"
		  case "checkup"'审核留言
			sql="update shop_message set m_check=true where m_id="&request.Querystring("m_id")
			conn.execute sql
			errstr="审核留言"
		  case "uncheckup"'取消审核留言
			sql="update shop_message set m_check=false where m_id="&request.Querystring("m_id")
			conn.execute sql
			errstr="取消审核留言"
		end select
		
		set myErrors=conn.errors
		if myErrors.count=0 then
			msgboxU errstr&"成功!"
		else
			msgboxU errstr&"失败!原因:"&myErrors.item(0).description
		end if
	end if
end if
%>
<div align="center">
  <p><span class="bluetitle STYLE1"><strong>网站留言管理</strong></span></p>
  <table width="754" height="30" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333">
  <tr>
    <td width="261" bgcolor="#00cccc">管理选项</td>
    <td width="487" bgcolor="#00CCCC">选择显示留言类型      

        <select name="select" onchange="changeshowtype(this.value)">
          <option value="all" <%if session("msgshowtype")="all" then response.write("selected")%>>
显示所有留言</option>
          <option value="checkup" <%if session("msgshowtype")="checkup" then response.write("selected")%>>显示已审核留言</option>
          <option value="uncheckup" <%if session("msgshowtype")="uncheckup" then response.write("selected")%>>显示未审核留言</option>
      </select></td>
  </tr>
</table>
<br>
<%

'------------------------显示所有留言--------------------------------
sql="select top " & (page*pagelistnum) & " shop_message.*,shop_user.u_name from shop_message,shop_user where shop_message.m_uid=shop_user.u_id " & addselectwords & " order by m_id DESC" 
rst.open sql,conn,1,1
if rst.eof and rst.bof then
	msgboxU "还没有任何人留言,或是没有任何留言符合当前的显示类型!"
else
	rst.PageSize=pagelistnum
	rst.AbsolutePage=page
	while not rst.eof
%>
	  <table width="754" height="169" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333">
		<tr>
		  <td width="225" height="23" align="left" valign="middle" bgcolor="#DCDCDC">第<font color="red">[<%=rst("m_id")%>]</font>楼&nbsp;留言人:<%=rst("u_name")%></td>
		  <td width="189" align="left" valign="middle" bgcolor="#DCDCDC">留言时间:<%=rst("m_adddate")%></td>
		  <td width="159" align="left" valign="middle" bgcolor="#DCDCDC">审核:
		  <%
		  	if rst("m_check")=false then
		  %> 	
				<input type="submit" name="Submit" value="审核" onClick="javascript:checkup('ok',<%=rst("m_id")%>);" />
		  <%	
			else
		  %> 	
				<input type="submit" name="Submit2" value="取消审核" onClick="javascript:checkup('cancel',<%=rst("m_id")%>);" />
		  <%
		  	end if
		  %></td>
		  <td width="102" align="left" valign="middle" bgcolor="#DCDCDC"><a href="admin_message_re.asp?id=<%=rst("m_id")%>" target="_blank">回复</a></td>
		  <td width="67" align="left" valign="middle" bgcolor="#DCDCDC"><a href="admin_message.asp?act=del&page=<%=page%>&m_id=<%=rst("m_id")%>" onClick="javascript:return confirm('您确定要删除此条纪录吗?');">删除</a></td>
		</tr>
		<tr>
		  <td height="29" colspan="5" align="left" valign="middle" bgcolor="#ECECEC">标题:<%=rst("m_title")%></td>
		</tr>
		<tr>
		  <td height="45" colspan="5" align="left" valign="middle" bgcolor="#DCDCDC">内容:<%=rst("m_content")%></td>
		</tr>
		<tr>
		  <td height="46" colspan="5" align="left" valign="middle" bgcolor="#ECECEC">回复:<%=rst("m_recontent")%></td>
		</tr>
		<tr>
		  <td height="16" colspan="5" align="left" valign="middle" bgcolor="#FFFFFF">&nbsp;</td>
		</tr>
  </table>
<%
		rst.movenext
	wend
end if
rst.close
sql="select count(*) as num from shop_message,shop_user where shop_message.m_uid=shop_user.u_id "& addselectwords
fy sql,page,pagelistnum,"admin_message.asp?t="
%>
</div>
<%
set rst=nothing
conn.close
set conn=nothing
%>
</body>
</html>

⌨️ 快捷键说明

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