delnigao.asp

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

ASP
209
字号
<%@LANGUAGE="VBSCRIPT"%>
<%  
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<%
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/oavbsconn.asp" -->
<%

if(request("id") <> "") then Command1__d = request("id")

if(Session("userssdfgfhtrh") <> "") then Command1__u = Session("userssdfgfhtrh")

%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request("ID") <> "") Then 
  Recordset1__MMColParam = Request("ID")
End If
%>
<%
Dim Recordset1__u
Recordset1__u = "1"
If (Session("userssdfgfhtrh")  <> "") Then 
  Recordset1__u = Session("userssdfgfhtrh") 
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_oavbsconn_STRING
Recordset1.Source = "SELECT *  FROM fawen  WHERE ID = " + Replace(Recordset1__MMColParam, "'", "''") + " and 添加人帐号='" + Replace(Recordset1__u, "'", "''") + "'and 已审稿人='无' and 已会签人列表 ='无'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
if not Recordset1.eof or not Recordset1.bof then
Recordset1.delete
Recordset1.update
Recordset1_numRows = 0

%>
<%
Dim p__d
p__d = "1"
If (request("id") <> "") Then 
  p__d = request("id")
End If
%>
<%
Dim p__u
p__u = "1"
If (Session("userssdfgfhtrh")   <> "") Then 
  p__u = Session("userssdfgfhtrh")  
End If
%>
<%
Dim p
Dim p_numRows

Set p = Server.CreateObject("ADODB.Recordset")
p.ActiveConnection = MM_oavbsconn_STRING
p.Source = "SELECT 文件路径 FROM fawenfiles  WHERE 邮件编号=" + Replace(p__d, "'", "''") + " and 上传人帐号='" + Replace(p__u, "'", "''") + "'"
p.CursorType = 0
p.CursorLocation = 2
p.LockType = 1
p.Open()
p_numRows = 0
%>


<%if  p.eof and p.bof then %>
<%else%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim p_total
Dim p_first
Dim p_last

' set the record count
p_total = p.RecordCount

' set the number of rows displayed on this page
If (p_numRows < 0) Then
  p_numRows = p_total
Elseif (p_numRows = 0) Then
  p_numRows = 1
End If

' set the first and last displayed record
p_first = 1
p_last  = p_first + p_numRows - 1

' if we have the correct record count, check the other stats
If (p_total <> -1) Then
  If (p_first > p_total) Then
    p_first = p_total
  End If
  If (p_last > p_total) Then
    p_last = p_total
  End If
  If (p_numRows > p_total) Then
    p_numRows = p_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (p_total = -1) Then

  ' count the total records by iterating through the recordset
  p_total=0
  While (Not p.EOF)
    p_total = p_total + 1
    p.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (p.CursorType > 0) Then
    p.MoveFirst
  Else
    p.Requery
  End If

  ' set the number of rows displayed on this page
  If (p_numRows < 0 Or p_numRows > p_total) Then
    p_numRows = p_total
  End If

  ' set the first and last displayed record
  p_first = 1
  p_last = p_first + p_numRows - 1
  
  If (p_first > p_total) Then
    p_first = p_total
  End If
  If (p_last > p_total) Then
    p_last = p_total
  End If
End If
%>
<%
dim filestaoll,filespath
response.write filespath
  Dim objFSO  
  Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
   for i =1 to p_total
   filespath=p("文件路径")
If objFSO.FileExists(Server.MapPath(filespath)) Then
objFSO.DeleteFile Server.MapPath(filespath),True
end if
p.movenext
next
end if
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
p.Close()
Set p = Nothing
%>
<%
set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_oavbsconn_STRING
Command1.CommandText = "DELETE FROM fawenfiles  WHERE 邮件编号=" + Replace(Command1__d, "'", "''") + " and 上传人帐号='" + Replace(Command1__u, "'", "''") + "' "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<%response.redirect "sentshengqinglistfsdghs.asp"%>
<%else%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<script>
{
alert("数据不存在或者该发文受理中无法删除...");history.go(-1)
}
</script>
<%
end if%>

⌨️ 快捷键说明

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