<?
include_once("../inc/config.php");
include_once("../inc/publicfun.php");
include_once("../inc/ftbbsdbclass.php");
include_once("../pageclass.php");
include_once("../conn.php");
include_once("../admin/check_master.php");

$query = "SELECT * FROM {$tablepre}ftbbsmb";
$ftbbsmb=adminmakecache('../cache/ftbbsmb.html',$query,$expire);
$pagesize=$ftbbsmb[5];

$seachstr=$_POST["seachstr"];
$kind=$_POST["kind"];
if ($seachstr==""){
$seachstr=$_GET["seachstr"];
$kind=$_GET["kind"];
}
$admin_qs=$_SESSION['admin_qs'];

if ($login_sort==""){
	$str_sort="";
	}
else{
	$str_sort="logjs ".$login_sort.",";
}

if ($seachstr!=""){
   $sql="select clubuser_id,clubuser_name,clubuser_nickname,clubuser_password,clubuser_phone,clubuser_fax,clubuser_url,clubuser_email,clubuser_enter_count,clubuser_reg_date,clubuser_lasttime,clubuser_ip,payuser,bbsmanager,bbsadmin,jfmsign,bokeer from {$tablepre}clubuser where ".$kind." like '%".$seachstr."%' order by clubuser_id desc";
}
else{
   $sql="select clubuser_id,clubuser_name,clubuser_nickname,clubuser_password,clubuser_phone,clubuser_fax,clubuser_url,clubuser_email,clubuser_enter_count,clubuser_reg_date,clubuser_lasttime,clubuser_ip,payuser,bbsmanager,bbsadmin,jfmsign,bokeer from {$tablepre}clubuser order by clubuser_id desc";
}

$p = new ft_page;
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);

$p->pvar="page"; 
$p->setvar(array("kind" => $kind, "seachstr" => $seachstr,"str_sort" =>$str_sort));
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($sql." limit ".$p->limit());
?>
<html>
<head>
<title>飞天论坛</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css/main01.css" rel="stylesheet" type="text/css">

</head>
<body leftmargin="0" topmargin="5">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="form1" method="post" action="user_manage.php">
    <tr bgcolor="#d6dff7" class=f12>
      <td width="67%" height="25" align="left" bgcolor="#FFFFFF"> 
        <?
	  $p->output(0);
	  ?>
      </td>
      <td width="33%" height="30" align="right" bgcolor="#FFFFFF"> <div align="right">搜索： 
          <input name="seachstr" type="text" id="seachstr" size="10">
          <select name="kind">
            <option value="clubuser_id" selected>用户ID号</option>
            <option value="clubuser_name" >用户名</option>
            <option value="clubuser_phone">电话</option>
            <option value="clubuser_ip">IP地址</option>
            <option value="clubuser_email">E-mail</option>
            <option value="clubuser_note">备注</option>
          </select>
          <input type="submit" name="Submit" value="搜索">
        </div></td>
    </tr>
  </form>
</table>    
      
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#CCCCCC">
  <tr bgcolor="#f4f4f4" height=22 class=f12> 
            <td width="5%" align="center" height="20"><strong>ID号</strong></td>
            <td width="13%" align="center"><strong>用户名</strong></td>
            <td width="10%" align="center"><strong>博客</strong></td>
            <td  align="center"><strong>email</strong></td>
            <td width="5%" align="center"><strong>次数</strong></td>
            <td width="4%" align="center"><strong>IP</strong></td>
            <td width="12%" align="center"><strong>登记时间</strong></td>
            <td width="5%" align="center"><strong>勋章</strong></td>
            <td width="7%" align="center"><strong>状态</strong></td>
            <td width="3%" align="center"><strong>总版主</strong></td>
			<td width="3%" align="center"><strong>分版主</strong></td>
            <td width="3%" align="center"><strong>认证用户</strong></td>
            <td width="3%" align="center"><strong>封锁</strong></td>
            <td width="3%" align="center"><strong>上传权限</strong></td>
            <td width="5%" align="center"><strong>修改</strong></td>
            <td width="5%" align="center"><strong>删除</strong></td>
          </tr>
<?
if ($numrows!=0){
  while ($myrow = mysql_fetch_array($rsx)) {
     $i++;
	 $clubuser_id=$myrow["clubuser_id"];
	 $clubuser_reg_date=dateFormat($myrow["clubuser_reg_date"],'y-m-d');
	 $clubuser_lasttime=dateFormat($myrow["clubuser_lasttime"],'y-m-d');
?>
          <tr bgcolor="#FFFFFF" class=f12> 
            <td  height=22 align="center"><FONT COLOR="blue"><?=$clubuser_id?></FONT></td>
            <td align="center"><?=$myrow["clubuser_name"]?></td>
            <td align="center">
                <? if ($myrow["bokeer"]==1){?>
                <a href="user_delete.php?id=<?=$clubuser_id?>&m=3&bbsmanager=0"><font color=red>是</font></a> 
                <? }else{?>
                <a href="user_delete.php?id=<?=$clubuser_id?>&m=3&bbsmanager=1">否</a> 
                <? }?>
            </td>
            <td align="center"><?=$myrow["clubuser_email"]?></td>
            <td align="center"><?=$myrow["clubuser_enter_count"]?></td>
            <td align="center"><?=$myrow["clubuser_ip"]?></td >
            <td align="center"><?=$clubuser_reg_date?></td>
            <td align="center"><a href="userxz.php?clubuser_id=<?=$myrow["clubuser_id"]?>">勋章</a></td>
            <td align="center">
                <? if ($myrow["jfmsign"]==1){?>
                <a href="jfuser.php?id=<?=$clubuser_id?>&jfm=0"><font color=red>未激活</font></a> 
                <? }else{?>
                <a href="jfuser.php?id=<?=$clubuser_id?>&jfm=1">已激活</a> 
                <? }?>
            </td>
            <td align="center">
                <? if ($myrow["bbsmanager"]==1){?>
                <a href="user_delete.php?id=<?=$clubuser_id?>&m=1&bbsmanager=0"><font color=red>是</font></a> 
                <? }else{?>
                <a href="user_delete.php?id=<?=$clubuser_id?>&m=1&bbsmanager=1">否</a> 
                <? }?>
            </td>
            <td align="center">
                <? if ($myrow["bbsadmin"]==1){?>
                <a href="user_delete.php?id=<?=$clubuser_id?>&m=4&bbsmanager=0"><font color=red>是</font></a> 
                <? }else{?>
                <a href="user_delete.php?id=<?=$clubuser_id?>&m=4&bbsmanager=1" onclick="return confirm('1.分论坛版主请到论坛类别管理里设置,版主用户名要存在且有大小写区分\n\n2.若分论坛类别中没有设该用户为某分论坛版主而只在这设的版主不生效\n\n你确定继续吗？');">否</a> 
                <? }?>
            </td>
            <td align="center">
                <? if ($myrow["payuser"]==1){?>
                <a href="payusersign.php?id=<?=$clubuser_id?>&a=1&payuser=0"><font color=red>是</font></a> 
                <? }else{?>
                <a href="payusersign.php?id=<?=$clubuser_id?>&a=1&payuser=1">否</a> 
                <? }?>
            </td>
            <td align="center">
                <? if ($myrow["payuser"]==3){?>
                <a href="payusersign.php?id=<?=$clubuser_id?>&a=3&payuser=0"><font color=red>是</font></a> 
                <? }else{?>
                <a href="payusersign.php?id=<?=$clubuser_id?>&a=3&payuser=3">否</a> 
                <? }?>
            </td>
            <td align="center">
                <? if ($myrow["payuser"]==2){?>
                <a href="payusersign.php?id=<?=$clubuser_id?>&a=2&payuser=0"><font color=red>关</font></a> 
                <? }else{?>
                <a href="payusersign.php?id=<?=$clubuser_id?>&a=2&payuser=2">开</a> 
                <? }?>
            </td>
            <td align="center">
                <? if (strrpos($admin_qs,"2")){?>
                <a href="user_edit.php?id=<?=$clubuser_id?>">修改</a> 
                <? }?>
            </td>
            <td align="center">
                <? if (strrpos($admin_qs,"3")){?>
                <a href="user_delete.php?id=<?=$clubuser_id?>&m=2">删除</a> 
                <? }?>
             </td>
          </tr>
<?
}
?>       
  <tr bgcolor="#FFFFFF" height=25> 
    <td height="25" colspan="16" align="left"> 
      <?
     $p->output(0);
     mysql_free_result($rs);
     mysql_free_result($rsx);
     $db->close(); 
    ?>
    </td>
        </tr>
<? }else{?>
  <tr bgcolor="#F2F9F9"> 
    <td height="25" colspan=16 align=center class="f12"> 记录为空!</td>
  </tr>
<? }?>
</table>
</td>
  </tr>
</table>
</body>
</html>
