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

📄 admin_sendmsg.asp

📁 本程序采用花香内核
💻 ASP
字号:
<%Admin="message"%>
<!--#include file="check.asp"-->
<!--#include file="mdb.asp"-->
<!--#include file="inc/config.asp"-->
<%
if session("adminlogin")<>sessionvar then
  response.Write "<script>alert('你尚未登录,或者超时了!请重新登录!');top.location.href='admin.asp';</script>"
response.end
end if
dim action,msg
action=Request.QueryString ("action")
if action="save" then
	title=trim(Request.Form ("title"))
	content=trim(Request.Form ("content"))
        if title="" then
	response.write"<SCRIPT language=JavaScript>alert(' 短信息标题没有填写!请返回填写完整。');"
	response.write"javascript:history.go(-1)</SCRIPT>"
	response.end
        end if
        if content="" then
	response.write"<SCRIPT language=JavaScript>alert(' 短信息内容没有填写!请返回填写完整。');"
	response.write"javascript:history.go(-1)</SCRIPT>"
	response.end
        end if
	set rs=server.CreateObject("ADODB.RecordSet")
	sql="select username from [user]"
	rs.Open sql,conn,1,1
	if not rs.EOF then
		sendtime=now()
		sender="听雪短信精灵"
		do while not rs.EOF 
			sql="insert into message(incept,sender,title,content,sendtime) values('"
			sql=sql&(rs("username"))&"','"
			sql=sql&(sender)&"','"
			sql=sql&(title)&"','"
			sql=sql&(content)&"','"
			sql=sql&(sendtime)&"')"
			conn.execute(sql)
		rs.MoveNext 
		loop
	end if
	if err then
		conn.close
		set conn=nothing
		Response.Write err.description
		Response.End 
	else
		msg="<font color=red>发送成功!</font>"
	end if
	rs.Close 
	set rs=nothing
        elseif action="del" then
	UserName=trim(Request.Form("UserName"))
	DelR=trim(Request.Form("delR"))
	DelW=trim(Request.Form("delW"))
	if UserName="听雪短信精灵" then
		conn.execute("delete * from message")
                msg="成功删除所有短信息</font>"
	elseif DelR="on" or DelW="on" then
		if DelR="on" and DelW<>"on" then
			sql="delete * from message where incept='"&UserName&"'"
			thismsg="收到"
		elseif DelR<>"on" and DelW="on" then
			sql="delete * from message where sender='"&UserName&"'"
			thismsg="发出"
		elseif DelR="on" and DelW="on" then
			sql="delete * from message where sender='"&UserName&"' or incept='"&UserName&"'"
			thismsg="所有"
		end if
		conn.execute(sql)
		
		msg="<font color=red>成功删除用户"&UserName&thismsg&"的短信息</font>"
	end if
elseif action="deldate" then
	thisdate=date()
	selectdate=cint(trim(Request.Form ("selectdate")))
	conn.execute("delete * from message where datediff('d',datevalue(sendtime),#"& thisdate &"#)>"& selectdate &" and flag<>0")
	msg="<font color=red>成功删除"&selectdate&"天前的短信息</font>"
elseif action="delweek" then
	thisdate=date()
	conn.execute("delete * from message where datediff('d',datevalue(sendtime),#"& thisdate &"#)>7 and flag<>0")
	msg="<font color=red>成功删除一周前的短信息</font>"
elseif action="delmonth" then
	thisdate=date()
	conn.execute("delete * from message where datediff('d',datevalue(sendtime),#"& thisdate &"#)>30 and flag<>0")
	msg="<font color=red>成功删除一个月前的短信息</font>"
end if	
%>
<html>
<head>
<title>短消息管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="inc/admin.css" type="text/css">
</head>
<body topmargin="0" leftmargin="0">
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<tr>
<td align=center valign=top width="80%">
<table border="1" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#55595A">
<tr class=lanyuss>
<td><b>听雪短信精灵</b></td>
</tr>
</table><br>
<table border="1" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#55595A">
<tr class=lanyuss>
<td><b>帮 助</b></td>
</tr>
<tr>
<td width=100% height=20>
<li>听雪短信精灵将会对所有注册用户同时发出短信息。</li>
<li>听雪短信精灵能删除某个人甚至所有人的短信息,还能删除过期短信息。</li>
<li>如想删除所有人的短信息,请在用户栏内输入:听雪短信精灵 </li>
<li>过期短信息不包括未读的短信息。</li>
</td>
</tr>
<tr>
<td width="100%" align="center" colspan=2><%=msg%></td>
</tr>
</table><br>
<table border="1" width="100%" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#55595A">
<form method="POST" action="admin_sendmsg.asp?action=save" id=form name=form>
<tr class=lanyuss>
<td colspan="2"><b>向全体会员发送统一短信息</b></td>
</tr>
<tr>
<td width="30%" align="right">* 短信息标题:</td>
<td width="70%" height="30">
<input type="text" name="title" size="35"></td>
</tr>
<tr>
<td width="30%" align="right">* 短信息内容:</td>
<td width="70%" height="30"><TEXTAREA name=content rows=6 cols=59></TEXTAREA></td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="submit" value=" 确定 " name="cmdok">&nbsp; 
<input type="reset" value=" 清除 "  name="cmdcancel">
</td>
</tr>
</form>
</table><br>
<table border="1" width="50%" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#55595A">
<form method="POST" action="admin_sendmsg.asp?action=del" id=form2 name=form2>
<tr class=lanyuss>
<td><b>删除用户短信息</b></td>
</tr>
<tr>
<td width="30%" align=center>* 用户名:<input type="text" name="UserName" size="20"></td>
</tr>
<tr>
<td width="30%" height="30" align=center>
<input type="checkbox" name="delR" value="on">包含收到的短信息</td>
</tr>
<tr>
<td width="30%" height="30" align=center>
<input type="checkbox" name="delW" value="on">包含发出的短信息</td>
</tr>
<tr>
<td align=center>
<input type="submit" value=" 确定 " name="cmdok">&nbsp; 
<input type="reset" value=" 清除 "  name="cmdcancel">
</td>
</tr>
</form>
</table><br>
<table border="1" width="50%" cellspacing="0" cellpadding="0" class="zt00" style="border-collapse: collapse" bordercolor="#55595A">
<tr class=lanyuss>
<td><b>删除过期短信息</b></td>
</tr>
<form method="POST" action="admin_sendmsg.asp?action=deldate" id=form1 name=form1>
<tr>
<td width="30%" align=center>间隔天数:<input type="text" name="selectdate" size="20"></td>
</tr>
<tr>
<td align=center>
<input type="submit" value=" 确定 " name="cmdok">&nbsp; 
<input type="reset" value=" 清除 "  name="cmdcancel">
</td>
</tr>
</form>
<tr>
<td width="30%" height="30" align=center><a href="admin_sendmsg.asp?action=delweek">删除一周前的短信息</a></td>
</tr>
<tr>
<td width="30%" height="30" align=center><a href="admin_sendmsg.asp?action=delmonth">删除一个月前的短信息</a></td>
</tr>
</table>   
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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