addpost.asp

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

ASP
92
字号
<%  
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<%
MM_authorizedUsers=""
MM_authFailedURL="../../adminlogin666.asp"
MM_grantAccess=false
If Session("MM_Usernamesyslogin") <> "" 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/oavbsconn.asp" -->
<%c=request("c")
p=request("p")
  if isempty(c) or trim(c)="" then
%>
<script>
alert("请输入归档名或归档名不能为空格。");history.go(-1)
</script>
<%response.end()
end if%>

<%
  if isempty(request.form("p")) or trim(request.form("p"))="" then
%>
<script>
alert("请输入排序或排序不能为空格。");history.go(-1)
</script>
<%response.end()
end if%>
<%if not isNumeric(p)=true then %>
<script language="javascript">

alert("排序需为数字!");history.go(-1)
</script>
<%end if%>
<%if p<0 then %>
<script language="javascript">
alert("排序需大于0!");history.go(-1)
</script>
<%end if%>



<%
Dim r__c
r__c = "1"
If (Request("c") <> "") Then 
  r__c = Request("c")
End If
%>
<%
Dim r
Dim r_numRows

Set r = Server.CreateObject("ADODB.Recordset")
r.ActiveConnection = MM_oavbsconn_STRING
r.Source = "SELECT *  FROM 归档类别  WHERE 归档名称 = '" + Replace(r__c, "'", "''") + "'"
r.CursorType = 0
r.CursorLocation = 3
r.LockType = 3
r.Open()
if r.eof and r.bof then 
r.addnew
r("归档名称")=c
r("排序")=p
r("收发文类别")="收文"
r.update
r_numRows = 0
%>
<%
r.Close()
Set r = Nothing
response.redirect ("guidangadmin.asp")
%>
<%else
r.Close()
Set r = Nothing
response.write"<script>alert('""很抱歉,您提交的"&c&"收文归档类别已存在。');location='"&request.ServerVariables("HTTP_REFERER")&"'</script>"
end if%>

⌨️ 快捷键说明

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