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

📄 delete.asp

📁 功能齐全的oa系统
💻 ASP
字号:
<% option explicit%>
<!-- #include virtual="include/MyFunc.asp" -->
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
	Dim ObjDB,StrSQL,ObjRS
	Dim C,IntIDs
	Dim sql,rs,aryReturn,i
    
	Dim ObjFS
	Dim StrDelIDs,StrIDs
	Dim StrFileName,StrFilePath
	Dim ObjCrm,StrSqlCrm,StrReplace,KeyPath
	
	IntIDs=Request.QueryString("IDs")
	
	if InStr(IntIDs, 0)<>0  then 
		IntIDs= Replace(IntIDs,"0,","")
	end if
	
	Set ObjDB = Server.CreateObject("ADODB.Connection")
	OpenDBH ObjDB
	
     aryReturn = Split(IntIDs,",")
	 
	 Set ObjFS = Server.CreateObject("Scripting.FileSystemObject")
	 
	  If Request.Form.Count > 0 Then
	if request("OpeDesc")<>"" then 	'------------------判断理由不能为空开始
	
	
	'--------------删除附件---------------
	
	Set rs = Server.CreateObject("ADODB.Recordset")
	
	 
	For i = LBound(aryReturn) To UBound(aryReturn)

		 sql="select *  from t_Hrms_JobApplication_Interview Where ID IN(" & aryReturn(i) & ")"
		     
    Set ObjRS = ObjDB.Execute(sql)
	if ObjRS("Attachs") <>""  then
	
 	StrIDs =IntIDs
	StrDelIDs =ObjRS("Attachs")
	
	StrIDs = "," & StrIDs & ","
	StrIDs = Replace(StrIDs,"," & StrDelIDs & ",",",")
	
	If Len(StrIDs)>3 Then StrIDs = Mid(StrIDs,2,Len(StrIDs)-2)
	
	strSQL = "Select * From t_Hrms_Attach Where KeyPath In ('" & Replace(StrDelIDs,",","','") & "')"

	Set ObjRS = objDB.Execute(Strsql)
  
	 	
	While Not ObjRS.Eof
	'-------------------------------------------------------------------------------------------
	        KeyPath=ObjRS("KeyPath")
	'--------------------------------------------------------------------------------------------
		StrFilePath = Server.MapPath ( Application("RootPath") & "Hrms/Attach/Files/" & ObjRS("BasePath") & "/" & ObjRS("KeyPath") )
	 
		If ObjFS.FolderExists(StrFilePath) Then
		  ObjFS.DeleteFolder StrFilePath,true
		   
		objDB.Execute("DELETE FROM  t_Hrms_Attach Where KeyPath In ('" & Replace(StrDelIDs,",","','") & "')")
		
		end if
	
		ObjRS.MoveNext	
	Wend
		
		
end if
NEXT


 '--------------附件结束-----------------
 '删除文件
 	Set C = Server.CreateObject ("CMS2003.DBhandle")
	  
	C.Init(ObjDB)
		Call C.Delete(IntIDs,"t_Hrms_JobApplication_Interview")
'添加日志
dim FirstMenu,SecondMenu,Opertion,OTime,OName,OIP,ODesc,OChang
OIP=Request.ServerVariables("REMOTE_ADDR")
OName= Session("AccountName") 

if OName="administrator" then
OName="系统管理员"
end if
call AddLog("招聘管理","人才储备","删除",now(),OName ,OIP,request("OpeDesc"),"",ObjDB)

   '添加日志结束

	ObjDB.Close
	Set ObjDB = Nothing
	Response.Redirect "List.asp"

else
 call MsgBox("原因不能为空!","Back","none")
 response.End()
end if	'------------------判断理由不能为空结束
	
end if
 
	

%>
<BODY >
<table width="100%" border="0">
  <tr>
    <td>请填写删除原因! </td>
  </tr>
  <tr>
    <td><form name="form1" method="post" action="">
  <p>
          <textarea name="OpeDesc" id="OpeDesc" rows="10" cols="60"></textarea>
  </p>
  <p>
    <input type="submit" name="Submit" value="提 交" class=Button>
  </p>
</form></td>
  </tr>
</table>
</BODY>

⌨️ 快捷键说明

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