writepostqungroup.asp

来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 251 行

ASP
251
字号
<%server.ScriptTimeout=500%>
<%'on error resume next%>
<%  
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%> 
<!--#include file="../../Connections/oavbsconn.asp" -->
<%'on error resume next
if request.form("content")="" or len(request.form("content"))>65535then 
	  Response.Write("<script>alert(""您输入的数据不符合要求,过多或没有!"");location=""javascript:history.back()"";</script>")  
	  Response.End
  end if
%>
<%sendto=request("sendto")%>
<%
' *** 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
%>
<%
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
%>
<!--#include file="../../Connections/ifr/ifrasp.asp" -->
<% if Request.Form("city")=Session("names") then%>
<script language="javascript">

<!--
alert("很抱歉,你不能给自己发送短消息!");history.back()
-->

</script>
<%
response.end 
end if%>
<%
Dim confirmqun__MMColParam
confirmqun__MMColParam = "1"
If (Request("组名")    <> "") Then 
  confirmqun__MMColParam = Request("组名")   
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
%>


<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim confirmqun_total
Dim confirmqun_first
Dim confirmqun_last

' set the record count
confirmqun_total = confirmqun.RecordCount

' set the number of rows displayed on this page
If (confirmqun_numRows < 0) Then
  confirmqun_numRows = confirmqun_total
Elseif (confirmqun_numRows = 0) Then
  confirmqun_numRows = 1
End If

' set the first and last displayed record
confirmqun_first = 1
confirmqun_last  = confirmqun_first + confirmqun_numRows - 1

' if we have the correct record count, check the other stats
If (confirmqun_total <> -1) Then
  If (confirmqun_first > confirmqun_total) Then
    confirmqun_first = confirmqun_total
  End If
  If (confirmqun_last > confirmqun_total) Then
    confirmqun_last = confirmqun_total
  End If
  If (confirmqun_numRows > confirmqun_total) Then
    confirmqun_numRows = confirmqun_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (confirmqun_total = -1) Then

  ' count the total records by iterating through the recordset
  confirmqun_total=0
  While (Not confirmqun.EOF)
    confirmqun_total = confirmqun_total + 1
    confirmqun.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (confirmqun.CursorType > 0) Then
    confirmqun.MoveFirst
  Else
    confirmqun.Requery
  End If

  ' set the number of rows displayed on this page
  If (confirmqun_numRows < 0 Or confirmqun_numRows > confirmqun_total) Then
    confirmqun_numRows = confirmqun_total
  End If

  ' set the first and last displayed record
  confirmqun_first = 1
  confirmqun_last = confirmqun_first + confirmqun_numRows - 1
  
  If (confirmqun_first > confirmqun_total) Then
    confirmqun_first = confirmqun_total
  End If
  If (confirmqun_last > confirmqun_total) Then
    confirmqun_last = confirmqun_total
  End If

End If
%>
<%
 for i =1 to confirmqun_total

Dim Recordset22
Dim Recordset22_numRows

Set Recordset22 = Server.CreateObject("ADODB.Recordset")
Recordset22.ActiveConnection = MM_oavbsconn_STRING
Recordset22.Source = "SELECT * FROM infoall"
Recordset22.CursorType = 0
Recordset22.CursorLocation = 3
Recordset22.LockType = 3
Recordset22.Open()
Recordset22.addnew
'Recordset22("sms接收部门")=confirmqun("部门")
Recordset22("标题")=request.form("标题")
Recordset22("内容")=request.form("content")
'Recordset2("接收人姓名")=Session("smmsgetnames")
Recordset22("接收人姓名")=confirmqun("好友姓名")
Recordset22("发送人姓名")=request.form("发送人姓名")
Recordset22("发送人帐号")=request.form("发送人帐号")
Recordset22("入库日期")=request.form("datas")
Recordset22("信息属性")=request.form("信息属性")
Recordset22("sms发送人level")=Session("levels")
Recordset22("发送人部门")=session("bumen")
Recordset22.update
Recordset22_numRows = 0
confirmqun.movenext
next
%>


<%
confirmqun.Close()
Set confirmqun = 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()

%>
<%
Session.Contents.Remove("smmsgetnames")
%>
<script language="javascript">

<!--
alert("恭喜你,短消息发送成功!");history.back()
-->

</script>

⌨️ 快捷键说明

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