📄 admin_sendmsg.asp
字号:
<!--#include file="function.asp"-->
<%CheckAdmin2%>
<!--#include file="conn.asp"-->
<%
dim action,msg
action=Request.QueryString ("action")
if action="save" then
title=trim(Request.Form ("title"))
content=trim(Request.Form ("content"))
if title="" then
conn.close
set conn=nothing
errmsg="<li>短信息标题没有填写!请返回填写完整。</li>"
call error()
Response.End
elseif content="" then
conn.close
set conn=nothing
errmsg="<li>短信息内容没有填写!请返回填写完整。</li>"
call error()
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="发送成功!"
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="成功删除所有短信息"
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="成功删除用户"&UserName&thismsg&"的短信息"
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="成功删除"&selectdate&"天前的短信息"
elseif action="delweek" then
thisdate=date()
conn.execute("delete * from message where datediff('d',datevalue(sendtime),#"& thisdate &"#)>7 and flag<>0")
msg="成功删除一周前的短信息"
elseif action="delmonth" then
thisdate=date()
conn.execute("delete * from message where datediff('d',datevalue(sendtime),#"& thisdate &"#)>30 and flag<>0")
msg="成功删除一个月前的短信息"
end if
%>
<!--#include file="const.asp"-->
<!--#include file="top.asp"-->
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750" id="AutoNumber1" height="90">
<tr>
<td width="5" background="images/line_bg02.gif">
</td>
<td width="741" height="211">
<img border="0" src="images/new.gif" width="1" height="1"><table border="0" width="741" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td valign=top width="175">
<!--#include file="admin_left.asp"-->
</td>
<td valign=top width="5" background="images/line_bg02.gif"> </td>
<td align=center valign=top width="545">
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="TableLine" style="border-collapse: collapse" bordercolor="#408AC1">
<tr>
<td width="100%" height="20" align=center class=TFColor bgcolor="#234156"><b>短信精灵</b></td>
</tr>
</table><br>
<table border="1" width="100%" cellspacing="0" cellpadding="0" class="TableLine" style="border-collapse: collapse" bordercolor="#408AC1">
<tr>
<td width="100%" height=22 align=center bgcolor="#234156"><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" class="TableLine" style="border-collapse: collapse" bordercolor="#408AC1">
<form method="POST" action="admin_sendmsg.asp?action=save" id=form1 name=form1>
<tr>
<td width="100%" height="20" colspan=2 align=center class=TFColor bgcolor="#234156" bordercolor="#408AC1"><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">
<input type="reset" value=" 清 除 " name="cmdcancel">
</td>
</tr>
</form>
</table><br>
<table border="1" width="50%" cellspacing="0" cellpadding="0" class="TableLine" style="border-collapse: collapse" bordercolor="#408AC1">
<form method="POST" action="admin_sendmsg.asp?action=del" id=form2 name=form2>
<tr>
<td width="100%" height="20" align=center class=TFColor bgcolor="#234156"><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" checked style='background-color:#c0c0c0; border: 0' value="ON">包含收到的短信息</td>
</tr>
<tr>
<td width="30%" height="30" align=center>
<input type="checkbox" name="delW" checked style='background-color:#c0c0c0; border: 0' value="ON">包含发出的短信息</td>
</tr>
<tr>
<td align=center>
<input type="submit" value=" 确定 " name="cmdok">
<input type="reset" value=" 清 除 " name="cmdcancel">
</td>
</tr>
</form>
</table><br>
<table border="1" width="50%" cellspacing="0" cellpadding="0" class="TableLine" style="border-collapse: collapse" bordercolor="#408AC1">
<tr>
<td width="100%" height="20" align=center class=TFColor bgcolor="#234156"><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">
<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>
<td width="5" background="images/line_bg02.gif">
</td>
</tr>
<tr>
<td width="750" height="1" colspan="3" background="images/line_bg01.gif">
<img border="0" src="images/line_bg01.gif"></td>
</tr>
</table>
</center>
</div><br>
<div align="center">
<!--#include file="friendsite.asp"-->
</div>
<br>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -