<!-- #include file="Setup.asp" -->
<%
if CookieUserName=empty then error2("您还未登录论坛")

id=int(Request("id"))
UserName=HTMLEncode(Trim(Request("UserName")))

if Request("menu")="Del" then
Conn.execute("Delete from [BBSXP_Messages] where id="&id&" and incept='"&CookieUserName&"'")
error2("删除成功")
elseif Request("menu")="allDel" then
Conn.execute("Delete from [BBSXP_Messages] where incept='"&CookieUserName&"'")
error2("已经成功清空收件箱")
end if




top

%>

<div class="mainnav">
<table cellspacing=1 cellpadding=5 border=0 width=100% class=a2>
<tr class=a3>
<td>&nbsp;<img src=images/Forum_nav.gif>&nbsp; <%ClubTree%> → 控制面板</td>
</tr>
</table>
<br>

<table cellspacing=1 cellpadding=5 border=0 width=100% class=a2>
	<TR id=TableTitleLink class=a1>
		<Td align="center"><b><a href="UserCp.asp">控制面板</a></b></td>
		<TD align="center"><b><a href="EditProfile.asp">资料修改</a></b></td>
		<TD align="center"><b><a href="EditProfile.asp?menu=pass">密码修改</a></b></td>
		<TD align="center"><b><a href="MySettings.asp">个性设置</a></b></td>
		<TD align="center"><b><a href="MyUpFiles.asp">上传管理</a></b></td>
		<TD align="center"><b><a href="MyFavorites.asp">管理书签</a></b></td>
		<TD align="center"><b><a href="MyMessage.asp">短信服务</a></b></td>
		<TD align="center"><b><a href="MyFriend.asp">好友列表</a></b></td>
	</TR>
</TABLE>
<br>


<table cellspacing=1 cellpadding=5 border=0 width=100% class=a2>
<TR class=a3><TD align="center" colspan=5>
          <a style="text-decoration: none; color: #000000" href="MyMessage.asp">
          <img alt src="images/m_inbox.gif" border="0" dypop="收件箱"></a>&nbsp;
          <a style="text-decoration: none; color: #000000" href="MyMessage.asp?send=1">
          <img alt src="images/M_issend.gif" border="0" dypop="已发送邮件"></a>&nbsp;
          <a href="MyMessage.asp?menu=allDel" onclick="return confirm('您确定要清空收件箱?')">
          <img alt src="images/Recycle.gif" border="0" dypop="清空收件箱"></a>&nbsp;
          <a href="MyFriend.asp">
          <img alt src="images/M_address.gif" border="0" dypop="发送讯息"></a>&nbsp;
          <a style=cursor:hand onclick="javascript:OpenFriendWindow('MyFriend.asp?menu=Post&FriendList=1')"><img alt src="images/m_write.gif" border="0" dypop="发送讯息"></a></td></TR>

  <TR class=a1>
          
    <TD vAlign=center align=center 
          width=5%>　</TD>
          
    <TD vAlign=center align=center 
          width="10%"><B><span id=send>发件人</span></B></TD>
          
    <TD vAlign=center align=center><B>内容</B></TD>
          
    <TD align=center 
          width=15%><B>日期</B></TD>
          
    <TD vAlign=center align=center 
          width=15%><B>操作</B></TD>
  </TR>



<%



if Request("send")="1" then
sql="select * from [BBSXP_Messages] where UserName='"&CookieUserName&"' order by id Desc"
response.write "<script>send.innerText='收件人'</script>"
else
sql="select * from [BBSXP_Messages] where incept='"&CookieUserName&"' order by id Desc"

end if

Rs.Open sql,Conn,1

PageSetup=10 '设定每页的显示数量
Rs.Pagesize=PageSetup
TotalPage=Rs.Pagecount  '总页数
PageCount = cint(Request.QueryString("PageIndex"))
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if TotalPage>0 then Rs.absolutePage=PageCount '跳转到指定页数

i=0
Do While Not Rs.EOF and i<PageSetup
i=i+1


if Request("send")="1" then
UserName=Rs("incept")
Del="<a style=cursor:hand onclick=javascript:OpenFriendWindow('MyFriend.asp?menu=Post&Log=1&incept="&UserName&"')>聊天记录</a>"

else
UserName=Rs("UserName")
Del="<a class=CommonImageTextButton style='BACKGROUND-IMAGE:url(images/NewPost.gif);cursor:hand' onclick=javascript:OpenFriendWindow('MyFriend.asp?menu=Post&incept="&Rs("UserName")&"&ParentID="&Rs("id")&"') title='回复讯息'>回复</a> <a class=CommonImageTextButton style=BACKGROUND-IMAGE:url(images/delete.gif) onclick="&CHR(34)&"return confirm('您确定要删除此条讯息?')"&CHR(34)&" href=?menu=Del&id="&Rs("id")&" title='删除讯息'>删除</a>"
end if


%>
<TR class=a3>
    <TD vAlign=center align=center width="5%"><IMG src="images/f_norm.gif"></TD>
    <TD vAlign=center align=center width="6%"><A href="Profile.asp?UserName=<%=UserName%>"><%=UserName%></A> </TD>
    <TD><%=Rs("content")%></TD>
    <TD align="center" width="17%"><%=Rs("DateCreated")%></TD>
    <TD align="center" width="16%"><%=Del%></TD>
</TR>
<%
Rs.MoveNext
loop
Rs.Close
if NewMessage>0 then Conn.execute("update [BBSXP_Users] set NewMessage=0 where ID="&CookieUserID&"")
%>
</TD></TR></TABLE>

<table cellspacing=0 cellpadding=0 border=0 width=100%>
<tr><td>
<%ShowPage()%></td>
</tr></table></div>




<%htmlend%>