<!--#include file="../Include/Conn.jsp" -->
<!--#include file="../Include/char.jsp" -->
<!--#include file="../Include/const.jsp" -->
<!--#include file="IsLogin.jsp" -->
<%

m_username=CheckStr(request("username"))
m_flag=CheckStr(request("flag"))

if IsNumeric(m_flag)=false then
  m_flag="1"
end if
m_UserID = Request.Cookies("aspxnet")("CurUserID")
m_username_a=request.cookies("aspxnet")("CurUserName")
 m_Sql = "SELECT f_realname,f_sex,f_birthday,f_edu,f_area,f_grade,f_email FROM T_Member WHERE F_username='" &m_username&"'" 
set rs=server.createobject("adodb.recordset")
rs.open m_sql,conn,1,1
' Set rs = conn.Execute(m_Sql)
 if rs.Eof then
   Call Msgbox("对不起，无此会员！",1)
   Response.end
 end if
 m_Name=rs("F_Realname")
 if rs("F_Sex")=1 then
 m_Sex="男"
 else
 m_Sex="女"
 end if
 m_age=cint(year(date())-year(rs("F_birthday"))+1)
 m_edu=rs("F_edu")
 m_area=rs("F_area")
 m_Email=rs("F_Email")
 m_grade=rs("F_grade")
 'm_Memo=rs("F_Memo")
 'response.write rs("F_Realname") 
' response.write m_Tel
 'response.end
 rs.close
 set rs=nothing
 m_sql="select f_flag from my_friend where f_userid="&m_UserID&" and f_username='"&m_username&"'"
  Set rs = conn.Execute(m_Sql)
 
 if rs.Eof then  '0574--------------------------------------------
  mc_Sql = "Insert Into my_friend(F_UserID,f_username_a,F_Name,F_Sex,F_age,F_edu,F_Email,F_area,F_grade,F_flag,f_username)"
  mc_Sql =  mc_Sql + " Values("&m_UserID&",'"&m_username_a&"','"&m_Name&"','"&m_Sex&"','"&m_age&"','"&m_edu&"','"&m_Email&"','"&m_area&"',"&m_grade&","&m_flag&",'"&m_username&"')"
  conn.Execute(mc_Sql)
  
  '系统日志

if m_flag="0" then
  m_logcontent1="您已经将[<a href=club_member.jsp?username="&m_username&" target=_blank>"&m_username&"</a>]加入了[黑名单]"
  m_logcontent2="您已经被[<a href=club_member.jsp?username="&m_username_a&" target=_blank>"&m_username_a&"</a>]加入了[黑名单]"
   
   if syslog_function(m_username_a,m_logcontent1) <> "OK" then
      response.write "系统有错误！"	
   end if
  if syslog_function(m_username,m_logcontent2) <> "OK" then
    response.write "系统有错误！"	
   end if

end if
'/////////////////////

if m_flag="1" then
  m_logcontent1="您已经将[<a href=club_member.jsp?username="&m_username&" target=_blank>"&m_username&"</a>]加入了[我的好友]"
  m_logcontent2="您已经被[<a href=club_member.jsp?username="&m_username_a&" target=_blank>"&m_username_a&"</a>]加入了[我的好友]"
   if syslog_function(m_username_a,m_logcontent1) <> "OK" then
      response.write "系统有错误！"	
   end if
  if syslog_function(m_username,m_logcontent2) <> "OK" then
      response.write "系统有错误！"	
   end if
end if
  
  
  Call CloseDatabase()
  Call Msgbox("操作添加成功！",1)
  response.end 
  
  else   '0574--------------------------------------------
  
   if  cint(rs("f_flag"))=cint(m_flag)  then
       Call CloseDatabase()
	  	Call Msgbox("注：请不要重复操作！",1)		
		response.end 
	else
	m_sql="update my_friend set f_flag="&m_flag&" where f_userid="&m_UserID&" and f_username='"&m_username&"'"
	conn.Execute(m_Sql)
	
	  '系统日志
  if m_flag="0" then
    m_logcontent1="您已经将[<a href=club_member.jsp?username="&m_username&" target=_blank>"&m_username&"</a>]加入了[黑名单]"
    m_logcontent2="您已经被[<a href=club_member.jsp?username="&m_username_a&" target=_blank>"&m_username_a&"</a>]加入了[黑名单]"
    if syslog_function(m_username_a,m_logcontent1) <> "OK" then
      response.write "系统有错误！"	
    end if
    if syslog_function(m_username,m_logcontent2) <> "OK" then
      response.write "系统有错误！"	
   end if
   
  end if
  if m_flag="1" then
       m_logcontent1="您已经将[<a href=club_member.jsp?username="&m_username&" target=_blank>"&m_username&"</a>]加入了[我的好友]"
      m_logcontent2="您已经被[<a href=club_member.jsp?username="&m_username_a&" target=_blank>"&m_username_a&"</a>]加入了[我的好友]"
     if syslog_function(m_username_a,m_logcontent1) <> "OK" then
      response.write "系统有错误！"	
      end if
     if syslog_function(m_username,m_logcontent2) <> "OK" then
      response.write "系统有错误！"	
     end if
  end if
     Call CloseDatabase()
  
	Call Msgbox("您的操作成功！",1)
	
	response.end
  end if 
	
	
  end if   '0574--------------------------------------------
  
	




%>

