📄 admin_sms.asp
字号:
<!--#include file="admin_conn.asp"-->
<!--#include file="../include/admin_setting.asp"-->
<!--#include file="admin_function.asp"-->
<%
'==============================================================
'程序名称:茂盛网站管理系统(Maoin CSM)
'当前版本:Maosin CMS Version 1.1 Powered by maosin.com
'程序作者:阿茂(李胜茂)
'网站地址:www.maosin.com www.maosin.net
' QQ:57861417
'电子邮箱:maosin@163.com maosin@maosin.com
'--------------------------------------------------------------
'Copyright (C) 2006 maosin.com All Rights Reserved.
'免费版本请在程序首页保留(Powered by:Maosin CMS)版权链接信息;
'您可以对此版本进行修改,美化,但请保留此ASP文件内的版权信息;
'茂盛设计网保留此软件的法律追究权利
'==============================================================
Call admin_top()
Call deletesms()
Select Case LCase(Request.QueryString("action"))
Case LCase("del")
Call del()
Case LCase("deluser")
Call deluser()
Case Else
Call send()
End Select
Call admin_foot()
Sub deletesms()
if getPopedom("smsAdmin")=false then
popedomMsg
exit sub
end if
%>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="text table_border mainTable">
<tr><td class="td_titleT">用户短信管理</td></tr>
<form action="?action=del" name="delform" method="post">
<tr class="td_bgcolor">
<td height="30" valign="middle" style="border-bottom:red;">
批量清除
<select name="daynum">
<option value=7>一个星期前</option>
<option value=30>一个月前</option>
<option value=180>半年前</option>
<option value=0>所有短信</option>
</select>
的短信 <input type="checkbox" name="isread" value=true>
包含未读短信 <input type="submit" name="deldate" value="提交">
</td></tr>
</form>
<form action="?action=deluser" name="userform" method="post">
<tr class="td_bgcolor">
<td style="border-top:red;">
批量删除
<input type="text" name="username">
用户的短信 <input type="submit" name="deluser" value="提交">
</td>
</tr>
</form>
</table>
<%table(5)%>
<%
End Sub
Sub send
if getPopedom("smsAdmin")=false then
popedomMsg
exit sub
end if
if request.Form("sendsms")<>"" then
dim title,userName,content,errmsg,sql
title=request.Form("title")
username=request.Form("username")
content=request.Form("content")
if title="" then
errmsg="<li>请写短信标题</li>"
end if
if username="" then
errmsg=errmsg&"<li>请填写接收对象</li>"
else
username=cint(username)
end if
if username="" then
errmsg=errmsg&"<li>请填写短信内容</li>"
end if
if username=0 then
sql="select user_name from ms_user"
elseif username=1 then
sql="select user_name from ms_user where user_type=1"
elseif username=2 then
sql="select user_name from ms_user where user_type=2"
end if
if errmsg="" then
dim rs,insql,i:i=0
Set rs=conn.execute(sql)
Do While Not rs.Eof
insql="insert into ms_sms(send_user,incept_user,sms_title,sms_content,sms_date,sms_isSend,sms_isSystem) values('管理员','"&rs("user_name")&"','"&title&"','"&content&"',#"&now&"#,1,1)"
conn.Execute(insql)
rs.MoveNext
i=i+1
Loop
rs.close
set rs=nothing
adminShowMsg "短信发送成功","</li>共计发送 <font color='#ff0000'>"&i&"</font> 条短信</li>"
exit sub
else
adminShowMsg "短信发送失败",errmsg
exit sub
end if
end if
dim editpath:editpath="../editor/"
%>
<table width="100%" border="0" cellpadding="4" cellspacing="1" class="text table_border mainTable">
<tr valign="middle">
<td height="23" colspan="2" class="td_titleT">短信群发</td>
</tr>
<form action="?action=send" method="post" onSubmit="submits();">
<tr class="td_bgcolor">
<td width="98" height="21" valign="middle" align="right"> 短信标题:</td>
<td width="503" valign="middle"> <input name="title" type="text" size="40"></td>
</tr>
<tr class="td_bgcolor">
<td height="21" valign="middle" align="right"> 接收对象:</td>
<td valign="middle">
<input type="radio" name="username" value="0">
所有会员
<input type="radio" name="username" value="1">
普通会员
<input type="radio" name="username" value="2">
VIP会员</td>
</tr>
<script language="JavaScript" type="text/javascript">var editorpath="../editor/";</script>
<tr class="td_bgcolor">
<td height="57" valign="top" align="right"> 短信内容:</td>
<td valign="top"><input type="hidden" name="content" id="edit"><!--#include file="../editor/edit.asp"-->
</td>
</tr>
<tr valign="middle">
<td height="30" colspan="2" align="center" class="td_titleB"> <input type="submit" name="sendsms" value="发送短信">
<input name="re" type="reset" id="re" value="清除重写"> </td>
</tr>
</form>
</table>
<%
End Sub
Sub del()
if getPopedom("smsAdmin")=false then
popedomMsg
exit sub
end if
if request.form("deldate")<>"" then
if request.form("isread") then
setread=""
else
setread=" and sms_isread=true"
end if
Select Case Request("dayNum")
Case 7
sql="delete from ms_sms where datediff('d',sms_date,#"&now()&"#)>7"&setread
Case 30
sql="delete from ms_sms where datediff('d',sms_date,#"&now()&"#)>30"&setread
Case 180
sql="delete from ms_sms where datediff('d',sms_date,#"&now()&"#)>180"&setread
Case 0
sql="delete from ms_sms WHERE sms_id>0"&setread
End Select
dim num
conn.execute sql,num
adminShowMsg "成功信息","<li>删除短信成功</li><li>共计删除 <font color=#ff0000>"&num&"</font> 条短信</li>"
exit sub
end if
End Sub
Sub deluser()
if getPopedom("smsAdmin")=false then
popedomMsg
exit sub
end if
if Request.form("deluser")<>"" then
username=Request.Form("username")
if username<>"" then
sql="delete from ms_sms where incept_user='"&username&"'"
conn.execute sql,num
adminShowMsg "成功信息","<li>删除 "&username&" 用户短信成功</li><li>共计删除 <font color=#ff0000>"&num&"</font> 条短信</li>"
exit sub
else
adminShowMsg "成功信息","<li>请输入要删除的用户名</li>"
exit sub
end if
end if
End Sub
'========================================================
'MaoSin CMS 1.1 Power by maosin.com
'Email: maosin@163.com , maosin@maosin.com
'Web: http://www.maosin.com http://www.maosin.net
'Copyright (C) 2006 maosin.com All Rights Reserved.
'========================================================
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -