<?php
include_once("inc/config.php");
include_once("inc/ftbbsdbclass.php");
include_once("inc/publicfun.php");
include_once("inc/pageclass.php");
include_once("conn.php");
include_once("checkuser.php");
include_once("ftbbs_nav.php");
include_once("bbsuser.php");

$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=makecache('ftbbsmb.html',$query,$expire);
$pagesize=$ftbbsmb[5];
$defaulthome=$ftbbsmb[31];

include_once("homeurl.php");
$strsql="select {$tablepre}haoyou.*,{$tablepre}clubuser.* from {$tablepre}haoyou,{$tablepre}clubuser where {$tablepre}haoyou.userid = {$tablepre}clubuser.clubuser_id and {$tablepre}haoyou.userid='".get_cookie('clubuser_id')."' order by {$tablepre}haoyou.id desc";
$p = new ft_page;
$pagesize=$ftbbsmb[5];
$rs=mysql_query($strsql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs); 

$p->pvar="page"; 
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($strsql." limit ".$p->limit());
?>
<HTML><HEAD>
<META http-equiv=Content-Type content=text/html;charset=utf-8>
<title>我的好友</title>
<script language=javascript src="inc/cookies.js"></script>
<script>
var stylecook = getCookie("STYLESHOW");
var style;
var strstyle;
if(stylecook=="")
{
 stylecook=1;
}
else
{
 stylecook++;
}
style="main0"+stylecook+".css";
strstyle="<link href=\"css/"+style+"\"  rel=\"stylesheet\" type=\"text/css\"> ";
document.write(strstyle);
</script>
</HEAD>
</head>
<script language="JavaScript" src="inc/Main.js"></script>
<script src="js/publicfun.js" type="text/javascript"></script>
<body>
<?
if (get_cookie('ftbbstype')==1){
include_once("pbhead.php");
}
?>
<table width="99%" border=0 align="center" cellpadding=2 cellspacing=1 class="maintbbg">
  <tbody>
      <tr> 
       <td height="25" colspan="3" class="f12bg">&nbsp;<?=$userinfo?></td>
      </tr>
      <tr> 
      <td height="25" colspan="3" class="maintbtr3">&nbsp;<a href="<?=$homepage?>">论坛首页</a> >> 我的好友：</td>
     </tr>
   </tbody>
</table>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
   <tr> 
    <td height=5 bgcolor="#FFFFFF"><spacer height="5" type="block"></td>
   </tr>
</table>
<table width="99%" border=0 cellpadding=2 cellspacing=1 class="listborder" align="center">
  <tbody>
    <tr align=middle class=f12> 
      <td width="5%" height="25" class="f12bg">选择</td>
      <td width="18%" class="f12bg" >好友名</td>
      <td width="12%" class="f12bg" >性别</td>
      <td width="25%" class="f12bg" >Email</td>
      <td width="18%" class="f12bg" >加入时间</td>
      <td width="11%" class="f12bg" >发短信</td>
    </tr>
  <form name="selectform" method="post" action="delmyfriend.php" style="MARGIN-TOP: 0px;margin-bottom:0px">
    <input type="hidden" name="op" value="选择删除">
    <input type="hidden" name="returnURL" value="myfriend.php">
    <script language="JavaScript">
  <!--
  function select_pl_submit(optype){
	var f=document.forms["selectform"]
	f.op.value=optype
	f.submit()
  }
  //-->
  </script>
    <?
if ($myrow = mysql_fetch_array($rsx)){
if ($numrows>0){
    do {
	$id=$myrow["id"];
	$haoyouname=$myrow["haoyouname"];
	$email=$myrow["clubuser_email"];
	$clubuser_sex=$myrow["clubuser_sex"];
	$addtime=$myrow["addtime"];
?>
    <tr align=middle> 
      <td width="5%" height="28" class="maintbtr1"> <input type="checkbox" name="checkbox1[]" value="<?=$id?>"> 
      </td>
      <td width="18%"  align=left valign="middle" class="maintbtr2">
        <?=$haoyouname?>
      </td>
      <td width="12%"  align=left valign="middle" class="maintbtr2">
        <?=$clubuser_sex?>
      </td>
      <td width="25%" class="maintbtr1"> 
        <?=$email?>
      </td>
      <td width="18%" class="maintbtr3">
        <?=$addtime?>
      </td>
      <td width="11%" class="maintbtr3"><a href="smsbbs.php?postuser=<?=$haoyouname?>">给他发信</a></td>
    </tr>
    <?
}
while ($myrow = mysql_fetch_array($rsx));
}
?>
    <tr valign="top"> 
      <td colspan="8" class="maintbtr3"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <td align="left" class="f12"> <input type="checkbox" name="chkall" onclick="checkall(this.form)"> 
              <input name="button" type="button" onclick="select_pl_submit('选择删除')" value="将所选删除"> 
            </td>
            <td height="24" align="right" class="f12"> 
              <?
                $p->output(0);
				mysql_free_result($rs);
                $db->close(); 
                ?>
            </td>
          </tr>
        </table></td>
    </tr>
  </form>
  <?
}
else
{
?>
  <tr class="maintbtr3"> 
    <td colspan=8 align=center height=25 class="f12"> 你目前没有好友！ </td>
  </tr>
  <?
}
?>
</table>
<?
include_once("inc/bbstail.php");
?>