?? mail_dele.asp
字號:
<%
'OA 表單生成器1.0
'功能:刪除內部信箱
'參數: request("del_check")=str #記錄ID集, request("mod") '模式(0永久刪除,1刪除到垃圾桶,刪除單條記錄到垃圾桶)
%>
<!--#include file="../inc/Secure.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Const.asp"-->
<%
formPath="./files/"
'response.buffer=false
'------------------------------------------------設置參數
LoginID=trim(session("LoginID")) : if LoginID="" then LoginID=0 '當前用戶ID
del_check=request("del_check") '記錄ID集
pmod=request("mod") '模式(0永久刪除,1刪除到垃圾桶,刪除單條記錄到垃圾桶)
'------------------------------------------------
'------------------------------------------------刪除記錄
table="tbioamail" '表名
oConn.BeginTrans
if pmod=0 then
for each i in Request.Form("del_check")
sql = "SELECT * from " & table & " WHERE ID="&i
set rs=Server.CreateObject("ADODB.RecordSet")
rs.open sql,oconn,3,3
if not rs.eof then
Parentid=rs("id")
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.folderexists(server.mappath(formPath&Parentid))=true then '判斷目錄是否存在
Fso.DeleteFolder(server.mappath(formPath&Parentid))
end if
oConn.Execute "DELETE FROM tbioaMail_Accessory WHERE Parentid="&i
end if
rs.delete
rs.close
set rs=nothing
next
end if
if pmod=1 then
for each i in Request.Form("del_check")
oConn.Execute "UPDATE " & table & " SET folder='垃圾桶' WHERE ID="&i
next
end if
if pmod="" then
oConn.Execute "UPDATE " & table & " SET folder='垃圾桶' WHERE ID="&del_check
end if
oConn.CommitTrans
'------------------------------------------------
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/main.css" type=text/css>
<title>main</title>
</head>
<body topmargin="10" leftmargin="10">
<table border=0 cellspacing="0" cellpadding="0">
<tr>
<td nowrap><img border="0" src="../images/icon_menu.gif" align="left"> 內部信箱->刪除郵件</td>
</tr>
</table>
<hr width="100%" size=1 color="#000000">
<br>
<div align="center">
<table width="400" cellspacing="1" cellpadding="2" class="tab">
<tr>
<td width="100%" class="tdTop">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="tdTop">
<p align="left"><img border="0" src="../images/icon_title.gif" align="left">刪除郵件</p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="25%" class="td1">
<table border="0" width="100%" cellspacing="10" cellpadding="0">
<tr>
<td width="36%">
<p align="right"><img border="0" src="../images/edit.gif" width="32" height="32">
</td>
<td width="64%"><p> </p>
<p>郵件成功刪除!</p>
<p><img border="0" src="../images/icon_return.gif" align="left">
<a href="javascript:history.<%if pmod="" then%>go(-2)<%else%>go(-1)<%end if%>">返回列表</a>
</td>
</tr>
<tr>
<td width="100%" colspan="2">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="25%" class="tdBottom">
</td>
</tr>
</table>
</div>
</body>
</html>
<%'釋放對象變量
oConn.close
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -