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

📄 writepostbumen.asp

📁 绿叶oa系统办公自动化 2008.工作日志管理,文件管理
💻 ASP
字号:
<%
' *** 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=5000%>
<%  
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%> 
<!--#include file="../../Connections/oavbsconn.asp" -->
<%
Dim users__varbumen
users__varbumen = "1"
If (request("userdept")  <> "") Then 
  users__varbumen = request("userdept") 
End If
%>
<%on error resume next
if request.form("标题")="" or len(request.form("标题"))>=50 then 
	  Response.Write("<script>alert(""您没有输入标题或字符超过50位!"");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
%>


<!--#include file="../../Connections/ifr/ifrasp.asp" -->


<% 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 *  FROM usertertggbng  WHERE (usersdsfg56<>'请选择接收对象' or usersdsfg56<>'对所有人群发') and 部门='" + Replace(users__varbumen, "'", "''") + "'"
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 * FROM infoall"
Recordset22.CursorType = 0
Recordset22.CursorLocation = 3
Recordset22.LockType = 3
Recordset22.Open()
Recordset22.addnew
Recordset22("sms接收部门")=users("部门")
Recordset22("标题")=request.form("标题")
Recordset22("内容")=request.form("content")
'Recordset2("接收人姓名")=Session("smmsgetnames")
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
%>
<%'response.end %>
<%else%>


<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("接收人帐号") <> "") Then 
  Recordset1__MMColParam = Request.Form("接收人帐号")
End If
%>
<%
Dim Recordset1__MMColParam1
Recordset1__MMColParam1 = "1"
If (Request.Form("接收人帐号") =Session("userssdfgfhtrh") )Then 
 response.Redirect("writefail.asp")
End  if
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_oavbsconn_STRING
Recordset1.Source = "SELECT * FROM usertertggbng WHERE usersdsfg56 = '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>

<% if not Recordset1.eof or not Recordset1.bof then 
Session("smmsgetnames")=Recordset1("names")
%>
<%end if%>
<%
Dim Recordset2
Dim Recordset2_numRows
Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_oavbsconn_STRING
Recordset2.Source = "SELECT * FROM infoall"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 3
Recordset2.LockType = 3
Recordset2.Open()
Recordset2.addnew
Recordset2("sms接收部门")=request.form("bumen")
Recordset2("标题")=request.form("标题")
Recordset2("内容")=request.form("content")
'Recordset2("接收人姓名")=Session("smmsgetnames")
Recordset2("接收人姓名")=request.form("city")
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
%>


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
users.Close()
Set users = Nothing
%>
<%
Session.Contents.Remove("smmsgetnames")
%>
<%end if%>
<script language="javascript">

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

</script>

⌨️ 快捷键说明

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