<% Option Explicit %>
<!--#include file="../Inc/Cls_DB.asp" -->
<!--#include file="../Inc/Const.asp" -->
<%
if request("MemName")="" then
      Response.Write("<script>alert(""参数传递错误"");location=""javascript:history.back(1)"";</script>")  
      Response.End
end if
Dim DBC,Conn
Set DBC = New DataBaseClass
Set Conn = DBC.OpenConnection()
Set DBC = Nothing
%>
<!--#include file="../Inc/MemberCheck.asp" -->
<%
dim Password,RsmessageObj,Messages,Rs1,RssendObj,Sqlsend
MemName = Session("MemName")
PassWord = Session("MemPassWord")
MemID = Session("MemID")
if request("action")="del" then
conn.execute("Delete from Message where MeID="&Cint(trim(Request("Meid"))))
      Response.Write("<script>alert(""信息删除成功"");location=""../Users/Message1.asp?MemName="&session("MemName")&""";</script>")  
      Response.End
end if

if request.Form("action")="addto" then
	set Rs1 = Conn.Execute("select * from Members where MemName='"& Replace(Trim(Request.Form("MeRead")),"'","''") &"'")
	if rs1.eof then
      Response.Write("<script>alert(""不存在此用户"");location=""javascript:history.back(1)"";</script>")  
      Response.End
	end if
	set RssendObj = server.CreateObject ("ADODB.RecordSet")
	Sqlsend = "select * from message"
	RssendObj.Open Sqlsend,Conn,1,3
	RssendObj.addnew
	RssendObj("MeRead")=Replace(Trim(Request.Form("MeFrom")),"'","''")
	RssendObj("MeFrom")=Replace(Trim(Request.Form("MeRead")),"'","''")
	RssendObj("MeTiTle")=Replace(Trim(Request.Form("MeTiTle")),"'","''")
	RssendObj("MeContent")=request.Form("MeContent")
	RssendObj("FromDate")=now()
	RssendObj("ReadTF")=false
	RssendObj("IsRecyle")=false
	RssendObj.update
	RssendObj.close
	set RssendObj=nothing
      Response.Write("<script>alert(""信息发送成功"");location=""../Users/Message1.asp?MemName="&session("MemName")&""";</script>")  
      Response.End
end if

set RsMessageObj = Conn.Execute("select * from Message where MeID="&Cint(trim(Request("Meid"))))
conn.execute("update Message set ReadTF=true where MeID="&Cint(trim(Request("Meid"))))
if rsmessageobj.eof then
      Response.Write("<script>alert(""错误参数，错误原因：此消息不存在"");location=""../Users/Message1.asp?MemName="&session("MemName")&""";</script>")  
      Response.End
end if
%>
<html>
<head>
<link href="../CSS/css.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登陆成功_短信中心</title>
</head>

<body>
<table width="700" border="0" align="center" cellpadding="0" cellspacing="0" class="mainmiddle">
  <tr> 
    <td width="26" height="32"> <div align="left"> 
        <p class="maindaohang">&nbsp;</p>
      </div></td>
    <td width="445"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="5"></td>
        </tr>
      </table>
      <b><font color="#000000"><b> <span class="bigNavi">登陆成功！</span>　 </b></font></b></td>
    <td width="96"><div align="center"><a href="Usermain.asp">会员中心首页 </a></div></td>
    <td width="52"><div align="center"><font color="#FF0000"><a href="Help/">帮助</a></font></div></td>
    <td width="72"><div align="center"><a href="Logout.asp"><font color="#FF0000">安全退出</font></a></div></td>
    <td width="9" class="mainrights"></td>
  </tr>
</table>
<table width="700" border="0" align="center" cellpadding="8" cellspacing="1" class="tabbgcolor">
  <tr> 
    <td height="315" valign="top" class="tabbgcolorli"> 
      <form name="form1" method="post" action="">
        <table width="90%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
          <tr bgcolor="#FFFFFF"> 
            <td colspan="2"><div align="left"><a href="?action=del&MeID=<%=RsMessageObj("MeID")%>&MemName=<%=session("MemName")%>"><img src="images/m_delete.gif" width="40" height="40" border="0"></a><font color="#FF0000"><a href="Messagewrite.asp?MemName=<%=session("MemName")%>"><img src="images/m_write.gif" width="40" height="40" border="0"></a><a href="Message1.asp?MemName=<%=Session("MemName")%>"><img src="images/M_recycle.gif" width="40" height="40" border="0"></a><a href="Message.asp?MemName=<%=Session("MemName")%>"><img src="images/o_inbox.gif" width="40" height="40" border="0"></a></font></div></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td width="21%"> <div align="right">收件人:</div></td>
            <td width="79%"> <input name="MeFrom" type="text" id="MeFrom" value="<%=RsMessageObj("MeFrom")%>" size="50"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td> <div align="right">标题：</div></td>
            <td> <input name="MeTitle" type="text" id="MeTitle" value="回复：<%=RsMessageObj("MeTitle")%>" size="50"></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td> <div align="right">内容：</div></td>
            <td> <textarea name="MeContent" cols="60" rows="10" id="MeContent">======在 <%=RsMessageObj("FromDate")%> 您来信中写道：======
<%=RsMessageObj("MeContent")%></textarea></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td>&nbsp;</td>
            <td><input type="submit" name="Submit" value="回复">
              <input type="reset" name="Submit2" value="重置">
              <input name="action" type="hidden" value="addto">
			  <input name="MeRead" type="hidden" id="MeRead" value="<%=RsMessageObj("MeRead")%>">
			 </td>
          </tr>
        </table>
      </form> </td>
  </tr>
  <tr>
    <td><div align="center">
        <p class="tabbgcolorlileft">&copy;2002-2004 Copyrights www.foosun.net,All 
          Rights Reserved </p>
      </div></td>
  </tr>
</table>
</body>
</html>
