geterupdateshouwenpostfornigaoren.asp

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

ASP
206
字号
<%@LANGUAGE="VBSCRIPT"%>
<% 
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<%
Dim StartTime,EndTime
StartTime=timer()
%>
<%server.ScriptTimeout=1800%>
<%
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
%>
<!--#include file="../shenpi/upload_5xsoft.inc"-->
<!--#include file="../../Connections/oavbsconn.asp" -->

<!--#include file="../../Connections/ifr/ifrasp.asp" -->
<%
Server.ScriptTimeout=900
dim upload,file,formName,formPath,iCount,fileformat
set upload=new upload_5xSoft
shouwenupid=upload.form("id")
%>
<% formPath=upload.form("filepath")
content=upload.form("content")
fasongren=session("names")
beizhu=upload.form("beizhu")
laiwenjiguan=upload.form("laiwenjiguan")
laiwenzihao=upload.form("laiwenzihao")
laiwenriqi=upload.form("laiwenriqi")
shouwenriqi=upload.form("shouwenriqi")
shiyou=upload.form("shiyou")
nibanyijian=upload.form("nibanyijian")
lingdaopishi=upload.form("content")

%>
<%
Dim Recordset1__d
Recordset1__d = "1"
If (upload.form("id") <> "") Then 
  Recordset1__d = upload.form("id")
End If
%>

<%if upload.form("filepath")<>"" then  %>
<%
 if right(formPath,1)<>"/" then formPath=formPath&"/" 
iCount=0
for each formName in upload.file ''列出所有上传了的文件
 set file=upload.file(formName)  ''生成一个文件对象
	fileformat="."&Mid(file.filename,InStrRev(file.filename,".")+1)
    	fileformatxz="."&Mid(file.filename,InStrRev(file.filename,".")+1)%>
<!--#include FILE="../gw/ftyepseesrfgtsf.asp"-->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If ("|"&session("names") <> "") Then 
  Recordset1__MMColParam = "|"&session("names")
End If
%>
<%
dim flength,fpath,fname
 if file.FileSize>0 then        
flength=cint(file.FileSize/1024)
fpath=formPath&File.FileName
fname=file.FileName
session("fnames")=fname
Dim datalog__MMColParam 
datalog__MMColParam = "1"
If (file.FileName  <> "") Then 
datalog__MMColParam = file.FileName 
End If
Dim datalog__vargeter
datalog__vargeter = "1"
If (upload.form("接收部门") <> "") Then 
  datalog__vargeter = upload.form("接收部门")
End If
Dim datalog
Dim datalog_numRows
Set datalog = Server.CreateObject("ADODB.Recordset")
datalog.ActiveConnection = MM_oavbsconn_STRING
datalog.Source = "SELECT *  FROM shouwenfiles  WHERE 文件名 = '" + Replace(datalog__MMColParam, "'", "''") + "'"
datalog.CursorType = 0
datalog.CursorLocation = 3
datalog.LockType = 3
datalog.Open()
if not datalog.eof then 
response.Redirect("../gw/wrong.asp")
end if
file.SaveAs Server.mappath(formPath&file.FileName) 
'response.write file.FilePath&file.FileName&" ("&cint(file.FileSize/1024)&"K) => "&formPath&File.FileName&" 成功!<br>"
  iCount=iCount+1
  dim total
total=1
dim ks
ks="k"
%>
<%
do while total<=iCount and datalog.eof 
datalog.addnew
datalog("邮件编号")=upload.form("id")
total=total+1
datalog("文件名")= fname
datalog("文件路径")=fpath
datalog("上传人帐号")=Session("userssdfgfhtrh")
datalog("上传人姓名")=Session("names")
datalog("上传人部门")=Session("bumen")

if flength=0 then
flength=1
end if
datalog("文件大小")=flength&"KB"
datalog.update
datalog_numRows = 0
loop
 end if
set file=nothing
next
Set datalog = Nothing
'set upload=nothing 
Htmend iCount&" 个文件上传结束!"
sub HtmEnd(Msg)
 'set upload=nothing
end sub
%>
<%
end if
%>
<%
Dim Recordset1__u
Recordset1__u = "1"
If (Session("userssdfgfhtrh")    <> "") Then 
  Recordset1__u = Session("userssdfgfhtrh")   
End If
%>
<%
 dim ip
ip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
If ip = "" Then ip = Request.ServerVariables("REMOTE_ADDR")
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_oavbsconn_STRING
Recordset1.Source = "SELECT *  FROM shouwen  WHERE (审稿人 like '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' or 签阅人 like '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' or 添加人帐号='" + Replace(Recordset1__u, "'", "''") + "') and id=" + Replace(Recordset1__d, "'", "''") + " "
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
if not Recordset1.eof or not Recordset1.bof then
dim p11
p11=Recordset1("审稿人")
Recordset1("备注")=beizhu
Recordset1("来文机关")=laiwenjiguan
Recordset1("来文字号")=laiwenzihao
Recordset1("来文日期")=laiwenriqi
Recordset1("收文日期")=shouwenriqi
'on error resume next
Recordset1("办完日期")=banwanriqi
Recordset1("事由")=shiyou
Recordset1("拟办意见")=nibanyijian
Recordset1("领导批示")=lingdaopishi
Recordset1("办理结果")=banlijieguo
Recordset1("发送人")=fasongren
Recordset1("最后更新ip")=ip
Recordset1("最后更新日期")=date()
Recordset1("最后更新时间")=now()
Recordset1("最后更新年份")=year(now())
Recordset1("最后更新月份")=month(now())
Recordset1("最后更新日")=day(now())
Recordset1("最后更新人")=session("names")
Recordset1("最后更新人部门")=session("bumen")
Recordset1("附件数")=Recordset1("附件数")+iCount
Recordset1.update
Recordset1_numRows = 0
%>
<%
else
response.write session("shouwenupid")

response.end()
end if
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%session("shenpishiyou")=wenjianbiaoti
session("shenqingren")=shengqingren
set upload=nothing
response.redirect "sendtoshenpiforup.asp?p="&p11  '审稿人与签阅人对收文的修改,不需要递交.
%>

⌨️ 快捷键说明

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