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

📄 admin_sendmsg.asp

📁 本程序是一款比较完善的图书租赁系统
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="ChkErr.asp"-->
<!--#include file="ChkAdmin.asp"-->
<!--#include file="ChkSQL.asp"-->
<!--#include file="ResultMsg.asp"-->
<%
If Request("IsSend")<>"" Then
	Dim MsgTitle,MsgContent
	MsgTitle=ChkSQL(Trim(Request("MsgTitle")))
	MsgContent=ChkSQL(Trim(Request("MsgContent")))
	
	'判断输入是否合法
	If MsgTitle="" Or MsgContent="" Then
		Response.Write GetErr(10)
		Response.End
	End If
	
	If Len(MsgTitle)>50 Or Len(MsgContent)>250 Then
		Response.Write GetErr(9)
		Response.End
	End If
	
	strSQL="SELECT UI_ID_N FROM [UserInfo]"
	Set objRS=Server.CreateObject("ADODB.RecordSet")
	objRS.Open strSQL,objConn,1,3
	'读取所有用户ID,写入同一字符串
	Dim InceptIDs
	For i=1 To objRS.RecordCount
		If i<>objRS.RecordCount Then
			InceptIDs=InceptIDs&objRS("UI_ID_N")&"," '使用“,”分隔用户ID
		Else
			InceptIDs=InceptIDs&objRS("UI_ID_N")
		End If
		objRS.MoveNext
	Next
	'将存储用户ID的字符串分解为一个数组
	InceptIDs=Split(InceptIDs,",")
	
	For i=0 To Ubound(InceptIDs)
		strSQL="INSERT INTO [Message] (MSG_Sender_UI_ID_FN,MSG_Incept_UI_ID_FN,Msg_Time_D,Msg_DelS_B,Msg_DelR_B,Msg_Title_S,Msg_Content_S,Msg_Flag_B)"&_
			"VALUES("&InceptIDs(i)&","&Session("UserID")&",'"&Now()&"',0,0,'"&MsgTitle&"','"&MsgContent&"',0) "
		objConn.Execute(strSQL)
	Next
	objRS.Close
	Call ResultMsg("发送成功!")
Else
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>群发短信</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<br><br><br><br><br><br><br><br>
<form action=admin_sendmsg.asp method=post>
<table class=tableborder1 align=center cellspacing=1 cellpadding=3 width=50% height=25%>
	<tr><th colspan=2 id=tabletitlelink height=25 style=font-weight:normal align=center><b>群发短信</b></th></tr>
	<tr><td class=TableBody2 align=right width=20% >短信标题:</td><td class=TableBody1 align=left><input type=text name=MsgTitle maxlength=50 size=58></td></tr>
	<tr><td class=TableBody2 align=center width=20% >短信内容:<br>(250字以<br>内)</td><td class=TableBody1 align=left><textarea name=MsgContent cols=58 rows=10></textarea></td></tr>
	<tr><td class=TableBody2 align=center width=20% colspan=2><input type=submit value=发送>&nbsp;<input type=reset value=重写></td></tr>
</table>
<input type=hidden name=IsSend value=yes>
</form>
</body>
</html>
<%End If%>

⌨️ 快捷键说明

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