modifytzpost.asp
来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 203 行
ASP
203 行
<%Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"%>
<!--#include file="../../Connections/oavbsconn.asp" -->
<!--#include file="../../Connections/leq.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
%>
<!--#include file="../../Connections/ifr/ifrasp.asp" -->
<!-- #include file="u/Upload.asp" -->
<%
Server.ScriptTimeout = 9999
set Upload = new DoteyUpload
Upload.MaxTotalBytes = 999999999999999999999999 *1024 *1024 ' 最大10MB
If Request.TotalBytes > 999999999999999999999999 *1024 *1024 Then
Response.Write "<script>alert(""不要上传超过1GB的文件"");</script>"
End If
Upload.ProgressID = Request.QueryString("ProgressID")
dim path
path="../../dataandfiles/files/tz/"
Dim objFSO1
Set objFSO1= Server.CreateObject("Scripting.FileSystemObject")
If objFSO1.FolderExists(Server.MapPath(path)) Then
Else
objFSO1.CreateFolder(Server.MapPath(path))
Set objFSO1 = Nothing
End If
dim path1
path1="../../dataandfiles/files/tz/"&session("bumen")&"/"
Dim objFSO11
Set objFSO11= Server.CreateObject("Scripting.FileSystemObject")
If objFSO11.FolderExists(Server.MapPath(path1)) Then
Else
objFSO11.CreateFolder(Server.MapPath(path1))
Set objFSO11 = Nothing
End If%>
<%Upload.SaveTo(path1)
ok="是"
if Upload.ErrMsg <> "" then
Response.Write(Upload.ErrMsg)
Response.End()
end if
bt=upload.Form("标题")
o=upload.Form("开关")
if o<>"" then o="否"
if o="" then o="是"
c=upload.Form("content")
for each File in Upload.Files.Items
%>
<%next%>
<% Set UploadRequest = CreateObject("Scripting.Dictionary")
dim upload,file,formName,formPath,iCount
if chongmingfou="1" then
if fset="1" then
fn=File.FileName&o
end if
end if
if chongmingfou="1" then
if fset="2" then
path1=path1&date()&"-"&hour(now())&"-"&minute(now())&"-"&second(now())&"_"&rndnum
end if
end if
%>
<%
for each File in Upload.Files.Items
dim f
f=File.FileSize/1024
IF f<1024 then
f1=ROUND((f),2)&"KB"
end if
IF f>=1024 then
f1=ROUND((f)/1000,2)&"MB"
END IF
if isempty(bt) or trim(bt)="" then
ok="否"
end if
if isempty(c) or trim(c)="" then
ok="否"
end if
fdaxiao=round(File.FileSize/1024,2)&"KB"
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_oavbsconn_STRING
Command1.CommandText = "insert into 通知附件db (文件名,通知编号,文件路径,文件大小,发送人帐号,发送人姓名,发送人部门,ok) values ('"& File.FileName&"','"& upload.Form("id")&"','"& path1&File.FileName &"','"& f1 &"','"& Session("userssdfgfhtrh") &"','"& Session("names") &"','"& Session("bumen") &"','"& ok &"')"
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
next
%>
<%
if isempty(bt) or trim(bt)="" then
%>
<script>
alert("请输入通知标题或标题不能为空格。");history.go(-1)
</script>
<%'response.end()
end if%>
<% if len(bt)<2 then %>
<script language="javascript">
{
alert("标题需要2位或2位以上字符 !");history.go(-1)
}
</script>
<%response.end()
end if%>
<%
if isempty(c) or trim(c)="" then
Response.Write("<script>alert(""请输入通知内容!"");location=""javascript:history.back()"";</script>")
Response.End
end if
%>
<%
if len(c)>65535then
Response.Write("<script>alert(""您输入的内容超出数据库极限,系统最多接收的字符是65535个!"");location=""javascript:history.back()"";</script>")
Response.End
end if
%>
<%
o=upload.Form("开关")
%>
<%if o="" then
o="是"
end if%>
<%dim id
id=upload.Form("id")
Dim Recordset1__varid
Recordset1__varid = "1"
If (id <> "") Then
Recordset1__varid = id
End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Session("userssdfgfhtrh") <> "") Then
Recordset1__MMColParam = Session("userssdfgfhtrh")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_oavbsconn_STRING
Recordset1.Source = "SELECT * FROM infoall WHERE 发送人帐号 = '" + Replace(Recordset1__MMColParam, "'", "''") + "' AND 信息属性='通知' and id=" + Replace(Recordset1__varid, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 3
Recordset1.LockType = 3
Recordset1.Open()
if not Recordset1.eof or not Recordset1.bof then
Recordset1("标题")=bt
Recordset1("内容")=c
Recordset1("最后更新时间")=now()
Recordset1("开关")=o
Recordset1("最后更新日期")=date()
Recordset1.update
Recordset1_numRows = 0
end if
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<script language="javascript">
{
alert("通知修改成功!");
}
</script>
<script language="javascript">
{
window.location.href="admintzlistdfghwerth.asp"
}
</script>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?