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

📄 senddateindb.asp

📁 很好的OA办公系统
💻 ASP
字号:
<!--#INCLUDE FILE="asp/fupload.inc"-->
<!--#include file="asp/opendb.asp"-->
<!--#include file="asp/sqlstr.asp"-->
<!--#include file="asp/checked.asp"-->
<!--#include file="asp/bgsub.asp"-->
<%
function strlength(inputstr)
	dim length,i
	length=0
	for i=1 to len(inputstr)
		if asc(mid(inputstr,i,1))<0 then
			length=length+2
		else
			length=length+1
		end if
	next
	strlength=length
end function
On Error Resume Next
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
if oabusyusername="" then 
	response.write("<script language=""javascript"">")
	response.write("window.top.location.href='default.asp';")
	response.write("</script>")
	response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/css.css">
<title> Office管理系统</title>
</head>
<body bgcolor="#ffffff" topmargin="5" leftmargin="5">
<%
 
%>
<center>
<table align="center">
<tr>
<td>
<b>公文发送</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</td>
<form action="sendarticle.asp" method="post" name="form1">
<td>
<input type="submit" value="返回">
</td>
</form>
</tr>
</table>
</center>
<%
 
if Request.ServerVariables("REQUEST_METHOD") = "POST" Then
	Dim Fields
	UploadSizeLimit=5000000
	Set Fields = GetUpload()
	dim Field
	For Each Field In Fields.Items
		if Field.name="title" then title=BinaryToString(Field.value)
		if Field.name="lb" then lb=BinaryToString(field.value)
		if Field.name="content" then content=BinaryToString(Field.value)
		if Field.name="sendto" then sendto=BinaryToString(Field.value)
		if Field.name="file1" then
			filename=field.FileName
			fileContentType=field.ContentType
			filevalue=field.value
		end if
	next
	dim mysendto
	set conn=opendb("oabusy","conn","accessdsn")
	conn.begintrans
	mysendto=split(sendto,"|",-1,1)
	for each sendtoinf in mysendto
		userdeptpoint=InStr(sendtoinf,":")
		addflag=false
		if userdeptpoint>0 then
			sendtoinflen=len(sendtoinf)
			recipientusername=right(sendtoinf,sendtoinflen-userdeptpoint)
			recipientuserdept=left(sendtoinf,userdeptpoint-1)
			if recipientusername="所有人" then
				recipientusername="所有人"
				addflag=true
			elseif recipientusername<>"所有人" and instr(sendto,"|"&recipientuserdept&":所有人")<=0 then
				usernamepoint=Instr(recipientusername,"(")
				usernamelen=len(recipientusername)
				recipientusername=left(recipientusername,usernamelen-1)
				recipientusername=right(recipientusername,usernamelen-1-usernamepoint)
				addflag=true
			end if
			if addflag then
				set rs=server.createobject("ADODB.recordset") 
				sql = "select * from senddate"
				rs.Open sql,conn,1,3
				rs.addnew 
				rs("title")=title
				rs("documenttype")=lb
				rs("content")=content
				rs("sender")=oabusyusername
				rs("recipientusername")=recipientusername
				rs("recipientuserdept")=recipientuserdept
				if filename<>"" then
					rs("filename")=filename
					rs("fileContentType")=fileContentType
					rs("filevalue").appendchunk filevalue
				end if
				rs.update 
				rs.close 
				set rs=nothing 
			end if
		end if
	next
	if err.number<>0 then
		conn.rollbacktrans
%>
<br><br>
<center><font color="#ee0000" size="+1">公文发送出错,请返回重试!</font></center>
<% 
	else
		conn.committrans
%>
<br><br>
<center><font color="#ee0000" size="+1">公文发送成功!</font></center>
<% 
	end if
end if
conn.close
set conn=nothing
%>
<div align="center">
  <center>
  <table>
    <tr>
      <td height=19>
        <table border="0" cellpadding="0" cellspacing="0" width="610" height="19">
		  <tr>
          <td width="100%" height=20><p align="center"><font color="#808080">IE37 &copy; <a href="http://www.ie37.com" target="_blank">IE37.com</a></font></td> 
		  </tr>
        </table>
      </td>
    </tr>
<%
%>
  </table>
  </center>
</div>
</body>  

⌨️ 快捷键说明

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