?? admin_sendmsg.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">
<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">
<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">
<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 + -