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

📄 sysadm_sms.asp

📁 功能非常完整的校友录
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="const.asp" -->
<!--#include file=char.asp-->
<!--#include file=checkuser.asp-->
<!--#include file=email.asp-->
<title><%=SchoolmateName%>--管理页面</title>
<link rel="stylesheet" type="text/css" href="txl.css">

<body alink=#333333 vlink=#333333 link=#333333 topmargin=0 bgcolor=<%=bodycolor%>>
<%
	if  issystemadmin(0)=false or session("adminlogin")<>"OK" then
		Errmsg=Errmsg+"<br>"+"<li>本页面为管理员专用,请<a href=sysadm_index.asp target=_top>登陆</a>后进入。"
		call Error(errmsg)
	else
		call main()
		set rs=nothing
		conn.close
		set conn=nothing
	end if

	sub main()
%><BR>
<table cellpadding=0 cellspacing=0 border=0 width=<%=tablewidth%> bgcolor=<%=tablebordercolor%> align=center>
  <tr>
    <td>
      <table cellpadding=3 cellspacing=1 border=0 width=100%>
        <tr bgcolor='<%=Tabletitlecolor%>'>
        <td><font color="<%=TablefontColor%>">欢迎<b><%=membername%></b>进入管理页面</font>
        </td>
        </tr>
            <tr bgcolor=<%=tablebodycolor2%>>
              <td width="100%" valign=top><font color="<%=TableContentColor%>">
<%
if request("action")="send" then
call sendmsg()
elseif request("action")="delete" then
call delmsg()
else
call msgform()
end if
%></font>
	      </td>
            </tr>
        </table>
        </td>
    </tr>
</table>
<%
end sub

sub msgform()
%>
<BR>
<form method="POST" action=sysadm_sms.asp?action=send>
<table width="95%" border="0" cellspacing="1" cellpadding="3"  align=center bgcolor=<%=Tablebordercolor%>>
<tr bgcolor=<%=Tabletitlecolor%>> 
<td height="11" colspan="2" align=center><font color="<%=TableContentColor%>"><b>短消息发布与管理</b></font></td>
</tr>
<tr bgcolor=<%=Tablebodycolor1%>> 
<td height="11" colspan="2" ><font color="<%=TableContentColor%>"><b>短消息广播</b></font></td>
</tr>
<tr  bgcolor=<%=Tablebodycolor2%>> 
<td width="30%" height="18">&nbsp;&nbsp;<font color="<%=TableContentColor%>">发送对象</font></td>
<td width="70%" height="18"> 
                    <select name=stype size=1>
					<option value="1">所有班级管理员</option>
					<option value="2">所有同学录用户</option>
					</select>
</td>
</tr>
<tr  bgcolor=<%=Tablebodycolor2%>> 
<td width="30%" height="18">&nbsp;&nbsp;<font color="<%=TableContentColor%>">消息标题</font></td>
<td width="70%" height="18"> 
<input type="text" name="title" size="40" >
</td>
</tr>
<tr   bgcolor=<%=Tablebodycolor2%> >
<td width="30%" height="18">&nbsp;&nbsp;<font color="<%=TableContentColor%>">消息内容</font></td>
<td width="70%" height="18"> 
        <textarea name="content" cols=40 rows=6></textarea>
</td></tr>
<tr bgcolor=<%=Tablebodycolor2%>> 
<td height="23" colspan="2" align=right > 
<input type="submit" name="Submit" value="发 送">&nbsp;&nbsp;<input type="reset" name="reset" value="重 写"></form>
</td>
</tr>

<tr bgcolor=<%=Tablebodycolor1%>> 
<td height="11" colspan="2" ><font color="<%=TableContentColor%>"><b>短消息管理</b>(批量删除指定日期内短消息)</font></td>
</tr>
<tr bgcolor=<%=Tablebodycolor2%>> <form action="sysadm_sms.asp?action=delete" method=post>
<td height="11" colspan="2" ><BR>			
                      <br>
					  <select name="delDate" size=1>
						<option value=7>一个星期前</option>
						<option value=30>一个月前</option>
						<option value=91>三个月前</option>
						<option value=182>半年前</option>
						<option value=365>一年前</option>
						<option value="all">所有信息</option>
					  </select>
					  &nbsp;<input type="checkbox" name="isread" value="yes">包括未读信息
			<input type="submit" name="Submit" value="删除"><br><BR></td></form>
</tr>
</table>

<%
end sub

sub sendmsg()
dim rs,sql,sendsql
'on error resume next
	if request("title")="" then
		Errmsg=Errmsg+"<br>"+"<li>请输入短信标题。"
		founderr=true
	else
		title=trim(request("title"))
	end if
	if request("content")="" then
		Errmsg=Errmsg+"<br>"+"<li>请输入短信内容。"
		founderr=true
	else
		content=request("content")
	end if

if founderr=true then 
	response.write Errmsg
	exit sub
end if


if request("stype")="1" then
    sql = "select userid from [student] where isadmin=1"
elseif request("stype")="2" then
	sql = "select userid from [student]"
end if

set rs=conn.execute(sql)
	do until rs.EOF 
	sendsql="insert into message(incept,sender,title,content,sendtime,flag,issend,delS) values('"&rs(0)&"','"&schoolmatename&"','"&title&"','"&content&"',Now(),0,1,2)"
	conn.Execute(sendsql)
	rs.MoveNext 
	Loop
	rs.Close


response.write "短信发送成功!<br>"

end sub

sub delmsg()

	if request("isread")="yes" then
	selflag=""
	else
	selflag=" and flag=1"
	end if

	howlong=request("delDate")
	if howlong="all" then
	sql="delete from message where id>0 "&selflag
	else
	sql="delete from message where datediff('d',sendtime,Now())>"&cint(howlong)&" "&selflag
	end if 
	conn.Execute(sql)
response.write "短信成功删除!<br>"

end sub


%>



⌨️ 快捷键说明

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