📄 trashbox.htm
字号:
<!--#include file="../inc/Secure.htm"-->
<!--#include file="../inc/conn.htm"-->
<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0
UserName=GetTableValue ("tblUser","Name","ID",LoginID)
dim orderby,order1,order2,order3,order4,order5,order6
order1="order by times desc"
order2="order by times"
order3="order by FromName"
order4="order by FromName desc"
order5="order by subject"
order6="order by subject desc"
orderby=trim(request("orderby"))
if orderby="" then orderby=order1
if request("cmdDel")<>"" then
ids=trim(request("delmail"))
arrids=split(ids,",")
if not isempty(arrids) then
for i=0 to ubound(arrids)
set rstmp=Server.CreateObject("ADODB.RecordSet")
sql="select id,attachfile from tblMailin where id="& cint(arrids(i))
rstmp.open sql,oConn,1,1
if not rstmp.eof then
if trim(rstmp("attachfile"))<>"" then
DeleteOneFile "../File_up/Mail/"&LoginID&"/"& trim(rstmp("attachfile"))
end if
end if
oConn.execute "delete tblMailIn where id="& cint(arrids(i))
rstmp.close
next
end if
end if
if request("delall")<>"" then
oConn.execute "delete tblMailIn where status=1 and ToID="& LoginID
end if
'获取垃圾箱邮件
nMailTrash_n = GetMailIn (LoginID,1,0)
nMailTrash_y = GetMailIn (LoginID,1,1)
nMailTrash = cint(nMailTrash_n) + cint(nMailTrash_y)
maxmessage=10
currentpage=request("page")
if currentpage="" then
currentpage=1
end if
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select ID,isRead,FromName,Subject,Times,AttachFile,FromID from tblMailin where status=1 and ToID="& LoginID &" "
sql=sql& orderby
rs.pagesize=maxmessage
rs.open sql,oConn,1,1
totalpage=rs.pagecount
totalmessage=rs.recordcount
if totalmessage<>0 then
rs.AbsolutePage=currentpage
msgArr=rs.getrows(maxmessage)
end if
rs.close
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</HEAD>
<script language="JavaScript">
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}
</script>
<BODY BGCOLOR="#FFFFFF">
<form name="deletemail" method="post" action="trashbox.htm?page=<%=currentpage%>">
<table border=0 width="90%">
<tr>
<td><img src="../images/trash.gif" border=0></td>
<td> <%=UserName%>,当前您的垃圾箱中的邮件数:</td>
<td align=left width=10><%=nMailTrash%></td>
<td></td>
</tr>
<tr>
<td></td><td>其中新邮件数目为</td>
<td><%=nMailTrash_n%></td>
<td align=right><INPUT TYPE="submit" class="boldwhite" value="清 空" name="delall" onclick="return CheckDelete1();"></td>
</tr>
</table>
<hr size=1 width="90%" align=left color=#D0D090>
<%
response.write "共" & totalmessage & "条/" & totalpage & "页,每页"& maxmessage &"条"
if totalpage>0 then
response.write ",第" & currentpage & "页 "
end if
if totalpage>1 then
if currentpage>1 then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage-1%>">上页</a>
<%
end if
if currentpage+1<=totalpage then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage+1%>">下页</a>
<%
end if
end if
%>
<table border=0 width="100%" bgcolor=#FFFFFF cellpadding=3>
<tr bgcolor=#D0D090>
<td width=10><img src="../images/mail-new.gif" border=0></td>
<td width=3></td>
<td width=20></td>
<td>
<%if orderby=order3 then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order4%>">发件人
<img src="../images/up.gif" border=0></a>
<%elseif orderby=order4 then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order3%>">发件人
<img src="../images/down.gif" border=0></a>
<%else%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order3%>">发件人</a>
<%end if%>
</td>
<td>
<%if orderby=order5 then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order6%>">主题
<img src="../images/up.gif" border=0></a>
<%elseif orderby=order6 then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order5%>">主题
<img src="../images/down.gif" border=0></a>
<%else%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order5%>">主题</a>
<%end if%>
</td>
<td valign="top">
<%if orderby=order1 then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order2%>">日期
<img src="../images/down.gif" border=0></a>
<%elseif orderby=order2 then%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order1%>">日期
<img src="../images/up.gif" border=0></a>
<%else%>
<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage%>&orderby=<%=order1%>">日期</a>
<%end if%>
</td>
<td>附件</td>
</tr>
<%
if isempty(msgArr) then
response.write "<tr bgcolor=#eeeddb><td colspan=7>该文件夹没有邮件。</td></tr>"
else
for i = 0 to UBound(msgArr,2)
%>
<tr bgcolor=#eeeddb>
<td align=center><%if trim(msgArr(1,i))="0" then response.write "<img src='../images/newmail.gif' border=0>"%></td>
<td></td>
<td><input type="checkbox" name="delmail" value=<%=trim(msgArr(0,i))%>></td>
<td nowrap><a href="TrashDetail.htm?ID=<%=trim(msgArr(0,i))%>"><%=trim(msgArr(2,i))%></a></td>
<td><a href="trashDetail.htm?ID=<%=trim(msgArr(0,i))%>"><%=trim(msgArr(3,i))%></a></td>
<td><%=trim(msgArr(4,i))%></td>
<td><%if trim(msgArr(5,i))<>"" then response.write "<img src='../images/attach.gif' border=0>"%>
</td>
</tr>
<%
next
end if
%>
<tr><td colspan=7 align=center>
<input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)">选中所有显示的邮件
</td></tr>
</table>
<input type="submit" name="cmdDel" value="删 除" class="BoldWhite" onclick="return CheckDelete();">
</form>
</BODY>
</HTML>
<%
Function GetTableValue(TableName,Field,ValueField,Value)
if TableName<>"" and Value<>"" then
Set RsTmp = Server.Createobject("Adodb.recordset")
strSql = "Select "& Field &" from "& TableName &" where "& ValueField &"='"& Value &"'"
Rstmp.open strSql,oConn,1,1
If not Rstmp.eof then
GetTableValue=trim(Rstmp(Field))
else
GetTableValue=""
end if
Rstmp.close
'set RsTmp = Nothing
else
GetTableValue=""
end if
End Function
Function GetMailIn(ToID, Status, Isread)
'isRead 0代表未读,1代表已读 Status 0代表正常 1代表已发入垃圾箱 2代表彻底删除
Set Rstmp = Server.CreateObject("ADODB.RecordSet")
intMail=0
strSql = "Select count(id) as intNumber from tblMailIn where ToID ="&ToID &" and Status="& status &" And Isread="& Isread
RsTmp.Open strSql,oConn
if not Rstmp.eof then
intMail=Rstmp("intNumber")
end if
Rstmp.close
set Rstmp = nothing
GetMailIn=IntMail
End Function
%>
<!--#include file="../inc/conn_close.htm"-->
<script language=javascript>
function CheckDelete()
{
return confirm("确实删除吗?");
}
function CheckDelete1()
{
return confirm("清空垃圾箱将不能恢复\n确实清空吗?");
}
</script>
<%
sub DeleteOneFile (FilePathName)
FilePathName=Server.Mappath(FilePathName)
dim fs
Set fs = server.CreateObject("Scripting.FileSystemObject")
if trim(FilePathName)<>"" and fs.FileExists(FilePathName) then
fs.DeleteFile FilePathName
end if
set fs=nothing
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -