writepost2928ok.asp
来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 330 行
ASP
330 行
<%
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers=""
MM_authFailedURL="../../index.asp"
MM_grantAccess=false
If Session("userssdfgfhtrh") <> "" Then
If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<%server.ScriptTimeout=6000%>
<%'on error resume next%>
<!--#include file="../../Connections/oavbsconn.asp" -->
<%
if request.form("sendto")="|" then
Response.Write("<script>alert(""请选择接收对象!"");location=""javascript:history.back()"";</script>")
Response.End
end if
%>
<%
if left(request.form("sendto"),6)="|请选择对象" then
Response.Write("<script>alert(""请选择接收对象!"");location=""javascript:history.back()"";</script>")
Response.End
end if
%>
<%on error resume next
if request.form("标题")="" or len(request.form("标题"))>=40 then
Response.Write("<script>alert(""您没有输入标题或字符超过40位!"");location=""javascript:history.back()"";</script>")
Response.End
end if
%>
<%
if request.form("content")="" then
Response.Write("<script>alert(""请输入消息内容!"");location=""javascript:history.back()"";</script>")
Response.End
end if
%>
<%
if len(request.form("content"))>65535 then
Response.Write("<script>alert(""您输入的消息超出了数据库极限!"");location=""javascript:history.back()"";</script>")
Response.End
end if
%>
<%
if request.form("sendto")="" then
Response.Write("<script>alert(""请增加接收对象!"");location=""javascript:history.back()"";</script>")
Response.End
end if
%>
<%sendto=request("sendto")%>
<!--#include file="../../Connections/ifr/ifrasp.asp" -->
<% if Request.Form("city")=Session("names") then%>
<script language="javascript">
<!--
alert("很抱歉,你不能给自己发送短消息!");history.go(-1)
-->
</script>
<%
response.end
end if%>
<%
Dim confirmqun__MMColParam
confirmqun__MMColParam = "1"
If (Request.QueryString("组名") <> "") Then
confirmqun__MMColParam = Request.QueryString("组名")
End If
%>
<%
Dim confirmqun__varuser
confirmqun__varuser = "1"
If (Session("userssdfgfhtrh") <> "") Then
confirmqun__varuser = Session("userssdfgfhtrh")
End If
%>
<%
Dim confirmqun
Dim confirmqun_numRows
Set confirmqun = Server.CreateObject("ADODB.Recordset")
confirmqun.ActiveConnection = MM_oavbsconn_STRING
confirmqun.Source = "SELECT * FROM 群组 WHERE 组名 = '" + Replace(confirmqun__MMColParam, "'", "''") + "' and 群组拥有人帐号='" + Replace(confirmqun__varuser, "'", "''") + "'"
confirmqun.CursorType = 0
confirmqun.CursorLocation = 2
confirmqun.LockType = 1
confirmqun.Open()
confirmqun_numRows = 0
%>
<% if Request.Form("city")="对所有人群发"then%>
<% if Session("levels")="999" then%>
<script language="javascript">
<!--
alert("很抱歉,您无群发消息权限!");history.back()
-->
</script>
<%response.end()%>
<%end if%>
<%
Dim users
Dim users_numRows
Set users = Server.CreateObject("ADODB.Recordset")
users.ActiveConnection = MM_oavbsconn_STRING
users.Source = "SELECT names FROM usertertggbng where usersdsfg56<>'请选择接收对象' and usersdsfg56<>'对所有人群发'"
users.CursorType = 0
users.CursorLocation = 2
users.LockType = 1
users.Open()
users_numRows = 0
%>
<%
' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables
Dim users_total
Dim users_first
Dim users_last
' set the record count
users_total = users.RecordCount
' set the number of rows displayed on this page
If (users_numRows < 0) Then
users_numRows = users_total
Elseif (users_numRows = 0) Then
users_numRows = 1
End If
' set the first and last displayed record
users_first = 1
users_last = users_first + users_numRows - 1
' if we have the correct record count, check the other stats
If (users_total <> -1) Then
If (users_first > users_total) Then
users_first = users_total
End If
If (users_last > users_total) Then
users_last = users_total
End If
If (users_numRows > users_total) Then
users_numRows = users_total
End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them
If (users_total = -1) Then
' count the total records by iterating through the recordset
users_total=0
While (Not users.EOF)
users_total = users_total + 1
users.MoveNext
Wend
' reset the cursor to the beginning
If (users.CursorType > 0) Then
users.MoveFirst
Else
users.Requery
End If
' set the number of rows displayed on this page
If (users_numRows < 0 Or users_numRows > users_total) Then
users_numRows = users_total
End If
' set the first and last displayed record
users_first = 1
users_last = users_first + users_numRows - 1
If (users_first > users_total) Then
users_first = users_total
End If
If (users_last > users_total) Then
users_last = users_total
End If
End If
%>
<%
for i =1 to users_total
Dim Recordset22
Dim Recordset22_numRows
Set Recordset22 = Server.CreateObject("ADODB.Recordset")
Recordset22.ActiveConnection = MM_oavbsconn_STRING
Recordset22.Source = "SELECT 标题,内容,接收人姓名,发送人姓名,发送人帐号,入库日期,信息属性,sms发送人level,发送人部门,sms是否为群发 FROM infoall"
Recordset22.CursorType = 0
Recordset22.CursorLocation = 3
Recordset22.LockType = 3
Recordset22.Open()
Recordset22.addnew
Recordset22("标题")=request.form("标题")
Recordset22("内容")=request.form("content")
Recordset22("接收人姓名")=users("names")
Recordset22("发送人姓名")=request.form("发送人姓名")
Recordset22("发送人帐号")=request.form("发送人帐号")
Recordset22("入库日期")=request.form("datas")
Recordset22("信息属性")=request.form("信息属性")
Recordset22("sms发送人level")=Session("levels")
Recordset22("发送人部门")=session("bumen")
Recordset22("sms是否为群发")="是"
Recordset22.update
Recordset22_numRows = 0
users.movenext
next
%>
<%else%>
<%
dim mysendto,sendto
sendto=request("sendto")
mysendto=split(sendto,"|",-1,1)
%>
<%
a=splict("128,201,203",",")
for i=0 to ubound(mysendto)
Dim Recordset2
Dim Recordset2_numRows
Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_oavbsconn_STRING
Recordset2.Source = "SELECT 标题,内容,接收人姓名,发送人姓名,发送人帐号,入库日期,信息属性,sms发送人level,发送人部门,sms是否为群发 FROM infoall"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 3
Recordset2.LockType = 3
Recordset2.Open()
Recordset2.addnew
Recordset2("sms接收部门")=request.form("userdept")
Recordset2("标题")=request.form("标题")
Recordset2("内容")=request.form("content")
Recordset2("接收人姓名")=mysendto(i)
Recordset2("发送人姓名")=request.form("发送人姓名")
Recordset2("发送人帐号")=request.form("发送人帐号")
Recordset2("入库日期")=request.form("datas")
Recordset2("信息属性")=request.form("信息属性")
Recordset2("发送人部门")=session("bumen")
Recordset2("sms发送人level")=Session("levels")
Recordset2("sms是否为群发")="否"
Recordset2.update
Recordset2_numRows = 0
next
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
Recordset3.Close()
Set Recordset3 = Nothing
%>
<%
confirmqun.Close()
Set confirmqun = Nothing
%>
<%
users.Close()
Set users = Nothing
%>
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_oavbsconn_STRING
Command1.CommandText = "DELETE FROM infoall WHERE 接收人姓名='' and (信息属性='短消息' or 信息属性='短消息回复') "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<%
set Command2 = Server.CreateObject("ADODB.Command")
Command2.ActiveConnection = MM_oavbsconn_STRING
Command2.CommandText = "DELETE FROM infoall WHERE (信息属性='短消息' or 信息属性='短消息回复') and (接收人姓名='请选择接收对象' or 接收人姓名='对所有人群发' or 接收人姓名='请选择对象') "
Command2.CommandType = 1
Command2.CommandTimeout = 0
Command2.Prepared = true
Command2.Execute()
%>
<%end if%>
<%
Session.Contents.Remove("smmsgetnames")
%>
<script language="javascript">
<!--
alert("恭喜你,短消息发送成功!");history.back()
-->
</script>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?