<!-- #include file=../inc/BBSsetup.asp -->
<!-- #include file=../inc/Board_Popfun.asp -->
<!-- #include file=inc/UserTopic.asp -->
<%
DEF_BBS_HomeUrl = "../"

initDatabase
GBL_CHK_TempStr = ""

Dim Sdm_FromUser,Sdm_ToUser,Sdm_Title,Sdm_Content
Sdm_FromUser = GBL_CHK_User

SiteHead(DEF_SiteNameString & " - 用户会员区")
UpdateOnlineUserAtInfo GBL_board_ID,"我的发件箱"
GBL_CHK_TempStr=""
If GBL_UserID=0 or Sdm_FromUser = "" Then
	GBL_CHK_TempStr = GBL_CHK_TempStr & "你没有登录<br>" & VbCrLf
End If

Dim Start
Start = Left(Trim(Request("Start")),14)
If isNumeric(Start)=0 or Start="" Then Start=0
Start = cCur(Start)
If Start < 0 Then Start = 0

UserTopicTopInfo
DisplayUserNavigate("我的发件箱")
If GBL_CHK_TempStr <> "" Then
	Response.Write "<br><p align=left><font color=ff0000 class=RedFont><b>" & GBL_CHK_TempStr & "</b></font>"
Else%>
	<table width=100%>
	<tr>
	<td>
		<br><%PersonalInfoSend%>
		<br><a href=<%=DEF_BBS_HomeUrl%>User/SendMessage.asp>发送短消息</a>
		<%If GBL_UserID>0 and CheckSupervisorUserName = 1 Then%>
		<form action=MySendBox.asp method=Get>
		查看用户<input class=fminpt type=text name=FromUser size=14>的发件箱
		<input type=submit value=查看 name=查看 class=fmbtn></form>
		<%End If%>
	</td>
	</tr>
	</table>
<%
End If
UserTopicBottomInfo
closeDataBase
SiteBottom
If GBL_ShowBottomSure = 1 Then Response.Write GBL_SiteBottomString

Function PersonalInfoSend

	Dim FromUser
	If CheckSupervisorUserName = 0 Then
		FromUser = GBL_CHK_User
	Else
		FromUser = Trim(Left(Request.QueryString("FromUser"),14))
		If FromUser <> "" Then
			FromUser = FromUser
		Else
			FromUser = GBL_CHK_User
		End If
	End If
	Dim Rs,SQL

	SQL = "select TOP "&DEF_MaxListNum&" ID,FromUser,Title,SendTime,Readflag,ToUser from LeadBBS_InfoBox where (FromUser='" & Replace(FromUser,"'","''") & "') order by id DESC"
	Set Rs = Con.ExeCute(SQL)
	GBL_DBNum = GBL_DBNum + 1
	Dim Num
	Dim GetData
	If Not rs.Eof Then
		GetData = Rs.GetRows(-1)
		Num = Ubound(GetData,2)
	Else
		Num = -1
	End If
	Rs.close
	Set Rs = Nothing
	dim I
	%>
	<table cellspacing=0 cellpadding=0 width=100% border=0 height=5>
	<tr> 
		<td colspan="2" height="0"><img src="img/BLANK.GIF" width="1" height="1"></td>
	</tr>
	</table>
	<b title="你发给别人的消息"><%=htmlencode(FromUser)%>的发件箱</b>
	<%If Num>=0 Then
		Response.Write "下面是您最近发送的一些消息"
	End If%>
	<table width="100%" border="0" cellspacing="1" cellpadding="2" bordercolor="#000000" bgcolor=<%=DEF_BBS_LightColor%> class=TBBG1>
	  <tbody> 
	  <tr height="19" bgcolor="<%=DEF_BBS_TableHeadColor%>" class=TBfour>
	    <td width=50><img src=img/blank.gif width=1 height=3><br>&nbsp;<span title=未阅短消息可以进行修改>编号</span>&nbsp;</td>
	    <td><img src=img/blank.gif width=150 height=3><br>&nbsp;主题&nbsp;</td>
	    <td width=85><img src=img/blank.gif width=1 height=3><br>&nbsp;接收者</td>
	    <td width=132><img src=img/blank.gif width=1 height=3><br>&nbsp;发送时间</td>
	  </tr>
	<%
	If Num = -1 Then
		response.write "<tr bgcolor=" & DEF_BBS_LightestColor & " class=TBBG9><td colspan=5 height=30>&nbsp; 没有任何消息!</td></tr>"
	end if
	
	
	Dim TempN,n
	
	if Num <> -1 then
		i=1
		for n= 0 to Num
			Response.Write "<tr height=19 bgcolor=" & DEF_BBS_LightestColor & " class=TBBG9><td>&nbsp;"
			If GetData(4,N) = 0 or GetData(4,N) = False Then
				Response.Write "<a href=SendMessage.asp?ModifyMessageID=" & GetData(0,n) & "><font color=green class=GreenFont>" & GetData(0,n) & "</font></a>"
			Else
				Response.Write GetData(0,n)
			End If
			Response.Write "</td><td>&nbsp;<a href=LookMessage.asp?MessageID=" & GetData(0,n) & ">"
			If GetData(5,N) = "" Then Response.Write "<b>"
			If Len(getData(2,n)&"")>0 Then
				Response.Write Htmlencode(getData(2,n))
			Else
				response.Write "<font color=888888 class=GrayFont>无</font>"
			End if
			If GetData(5,N) = "" Then
				Response.Write "</b>"
			Else
				If GetData(4,N) = 0 Then Response.Write "<img src=" & DEF_BBS_HomeUrl & "images/" & GBL_DefineImage & "new.gif align=absmiddle border=0 height=11>"
			End If
			Response.Write "</a>"
			Response.Write "</td><td valign=top width=85>&nbsp;"
			Response.Write "<a href=LookUserInfo.asp?Name=" & urlencode(GetData(5,n)) & ">" & GetData(5,n) & "</a>" & VbCrLf
			Response.Write "</td><td valign=top width=132>&nbsp;"
			Response.Write RestoreTime(GetData(3,n)) & "</td>"
			Response.Write "</tr>" & VbCrLf
			i=i+1
		next
	End If
	%>
	      </table>
	<br>[注意这是您已经发送给他人的消息，仅供查看，并无删除权限]<br><%

End Function
%>