<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="java.sql.*"%> 
<%@ page import="java.util.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.*"%>
<%@ include file="checkbbsuser.jsp"%>
<%@ include file="../inc/conn.jsp"%>
<%!String sql,username,smscontent,msg,str;%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css/xmwuye.css" rel=stylesheet type=text/css>
<title><%=session.getAttribute("name")%>的好友</title>
</head>

<body topmargin="5">
<div align="center"> 
  <TABLE align=center bgColor=#a4b6d7 border=0 cellPadding=0 cellSpacing=0 width="99%">
    <TR> 
      <TD height=25> <div align="center"><font color="#FFFFFF"><strong>欢迎<font color="#CC3300"><%=session.getAttribute("name")%></font>网友,以下是你的好友列表</strong></font></div></TD>
    </TR>
  </TABLE>
<%int i,k=0;
  sql="select * from clubuser where clubuser_name='"+session.getAttribute("name")+"'";
  ResultSet rs=stmt.executeQuery(sql);
  rs.next();
  String strdb=rs.getString("friend"); 
  if(strdb!=null){
%>
  <TABLE width="99%" border=0 align="center" cellPadding=0 cellSpacing=1 bgColor="#0099CC">
    <TBODY>
      <TR bgColor=#f2f8ff> 
        <TD width="10%" height="23" vAlign=middle bgColor=#b1d6fa class=font10_5> 
          <div align="center">编号</div></TD>
        <TD width="30%" vAlign=middle bgColor=#b1d6fa class=font10_5> <div align="center">用户名</div>
          <div align="center"></div>
          <div align="center"></div>
          <div align="center"></div></TD>
        <TD width="50%" vAlign=middle bgColor=#b1d6fa class=font10_5> <div align="center">短信</div></TD>
        <TD width="10%" vAlign=middle bgColor=#b1d6fa class=font10_5> <div align="center">删除</div></TD>
      </TR>
      <%
     
     while(strdb.indexOf("|")!=-1){
     int b = strdb.lastIndexOf("|");
     int len = strdb.length();
     username=strdb.substring(b+1,len); 
	 //str="select clubuser_name,clubuser_nickname,clubuser_phone,clubuser_email from clubuser where clubuser_name='"+username+"'";
	 strdb=strdb.substring(0,b);
	 //out.print(str+"<br>");
	 //Statement stmt1=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
	 //ResultSet rs1=stmt1.executeQuery(str);
	 //if(rs1.next()){
	  %>
      <TR bgColor=#f2f8ff> 
        <TD width="10%" height="25" vAlign=middle bgColor=#f6f6f6 class=font10_5> 
          <div align="center"><%=k+1%></div></TD>
        <TD vAlign=middle bgColor=#f6f6f6 class=font10_5> <div align="center"><%=username%></div>
          <div align="center"></div>
          <div align="center"></div>
          <div align="center"></div></TD>
        <TD width="50%" vAlign=middle bgColor=#f6f6f6 class=font10_5> <div align="center"><a href="smsbbs.jsp?postuser=<%=username%>">给他发信</a></div></TD>
        <TD width="10%" vAlign=middle bgColor=#f6f6f6 class=font10_5> <div align="center"><a href="delfriend.jsp?postuser=<%=username%>">删除</a></div></TD>
      </TR>
      <%
	   // }	
	 k=k+1;
	 //out.print(str+"<br>");
	 //out.close();
	  }
	  %>
    </TBODY>
  </TABLE>
<%
}
else{
%>
<TABLE align="center" bgColor="#a4b6d7" border=0 cellPadding=0 cellSpacing=0 width="99%">
  <TBODY>
    <TR bgColor=#f2f8ff> 
      <TD height="23" vAlign=middle bgColor=#b1d6fa class=font10_5> <div align="center"></div>
        </TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="99%" border=0 align="center" cellPadding=0 cellSpacing=0 bgColor="#FFFFFF">
  <TBODY>
    <TR bgColor=#f2f8ff> 
        <TD height="300" vAlign=middle bgColor=#f6f6f6 class=font10_5>
<div align="center">你现在还没有好友.</div></TD>
    </TR>
  </TBODY>
</TABLE>
<%}%>
<script language="JavaScript" src="../inc/bbstail.js"></script>
</div>
</body>
</html>