<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/nosql.asp"-->
<!--#include file="../../conn/config.asp"-->
<!--#include file="../../conn/md5.asp"-->
 <%
if session("user")="" then
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
if session("id")="" then 
response.write "<script language='javascript'>"
response.write "alert('您没还有登录，请登录后再访问本页！');"
response.write"this.location.href='/index.asp';</SCRIPT>"
response.end
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>交易助手管理操作平台_<%=webname%></title>
<link rel="stylesheet" href="/css.css" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<body><!--#include file="../../top.asp"-->
<table width="90%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
    <td width="970"><table width="970"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="10"><img src="/img/m_left.gif" width="10" height="20"></td>
          <td width="950" bgcolor="#FFFFFF"></td>
          <td width="10"><img src="/img/m_right.gif" width="10" height="20"></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="188" colspan="3"><table width="950"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="1" bgcolor="efefef"></td>
                <td width="200" height="77" valign="top"><!--#include file="../left.asp"--></td>
                <td width="1" bgcolor="efefef"></td>
                <td valign="top"><p>&nbsp;</p>
                    <BR>
                    <p>
                      <%
user=nosql(request("user"))

sql="select username from snsn_user where username='"&user&"'"
'response.write sql
Set rs= Server.CreateObject("ADODB.Recordset") 
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write"<TABLE width=578 border=0 class=content_border align='center' cellPadding=0 cellSpacing=0>"
response.write"<TR><td Class=C><Br>"
response.write"<ul>"
response.write"<li><FONT color='ff0000'><B> 错误：<b><br>亲爱的会员，您要添加的好友是："&user&"，但交友中心不存在这个会员</font><br>"
response.write"</li>"
response.write"</ul>"
response.write"</TR></td></table>"
else 

if rs("username")=session("user") then
response.write"<TABLE width=578 border=0 class=content_border align='center' cellPadding=0 cellSpacing=0>"
response.write"<TR><td Class=C><Br>"
response.write"<ul>"
response.write"<li><FONT color='ff0000'><B> 错误：<b><br>亲爱的会员，请不要将添加为好友</font><br>"
response.write"</li>"
response.write"</ul>"
response.write"</TR></td></table>"
else

sql2="Select AddTime from snsn_myfriend  where username='"&session("user")&"' and friend_name='"&rs("username")&"'"
set rs2=conn.execute(sql2)
if not (rs2.eof and rs2.bof) then
response.write"<TABLE width=578 border=0 class=content_border align='center' cellPadding=0 cellSpacing=0>"
response.write"<TR><td Class=C><Br>"
response.write"<ul>"
response.write"<li><FONT color='ff0000'><B> 错误：<b><br>亲爱的会员，您已经添加过该好友，请不要重复添加！<br>添加时间："&rs2("addtime")&"</font><br>"
response.write"</li>"
response.write"</ul>"
response.write"</TR></td></table>"
else

relation=nosql(request.form("relation"))
if relation<>"" then
user=session("user")
user1=rs("username")

set rs_waj=Server.CreateObject("ADODB.Recordset")
rs_waj.open "select * from snsn_myfriend",conn,1,3
rs_waj.addnew
	rs_waj("username")=user
	rs_waj("friend_name")=user1
	rs_waj("relation")=relation
	rs_waj("AddTime")=now()
rs_waj.update
%>
                      <%
end if

rs2.close
set rs2=nothing
end if
end if
end if
%>
                    </p>
                    <TABLE width="578" border=0 align="center" cellPadding=0 cellSpacing=0>
                      <TBODY>
                        <TR>
                          <TD vAlign=top align=middle>
                            <TABLE class=fbg1 width="100%" board="0">
                              <TBODY>
                                <TR>
                                  <TD>
                                    <DIV id=nav><strong></strong></DIV></TD>
                                </TR>
                              </TBODY>
                            </TABLE>
                            <TABLE width="100%" 
                  border=0 align=center cellPadding=0 cellSpacing=1 bgcolor="#BBD7FF">
                              <TBODY>
                                <TR>
                                  <TD height="30" bgcolor="#e8f4ff"><B><font color="#Ff6600">&nbsp;<A 
                          href="haoyou.asp">回到“我的好友”</A></font></B></TD>
                                </TR>
                                <TR>
                                  <TD height="30" bgcolor="#e8f4ff"><B><font color="#Ff6600">&nbsp;<A 
                          href="addfriend_new.asp">再增加一个好友</A></font></B></TD>
                                </TR>
                                <TR bgColor=#FFFFFF>
                                  <TD height="30" class=C style="LINE-HEIGHT: 150%"><strong><span class="M"><B><font color="#Ff6600"></font></B><B><font color="#Ff6600">&nbsp;</font></B> 恭喜您！添加我的好友成功！</span></strong> </TD>
                                </TR>
                                <TR bgColor=#FFFFFF>
                                  <TD height="30" class=C style="LINE-HEIGHT: 150%"><B><font color="#Ff6600">&nbsp;</font></B> <IMG src="../images/icon_3.gif"
      align=absMiddle> <A 
            href="../../index.asp">返回<%=webname%>首页</A> </TD>
                                </TR>
                              </TBODY>
                          </TABLE></TD>
                        </TR>
                      </TBODY>
                    </TABLE>
                </td>
              </tr>
          </table></td>
        </tr>
    </table></td>
    <td valign="top"><img src="/img/index_img.jpg" width="10"></td>
  </tr>
</table>
<!--#include file="../../end.asp"-->
</body>
</html>
