<?
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];

$searchcontent=trim($_POST["searchcontent"]);
$searchkind=$_POST["searchkind"];
if ($searchcontent==""){
$searchcontent=$_GET["searchcontent"];
$searchkind=$_GET["searchkind"];
}
if ($searchkind==""){
	$str="select * from {$tablepre}ftbbs_bmtb order by id desc";
}
else{
	$str="select * from {$tablepre}ftbbs_bmtb where ".$searchkind." like '%".$searchcontent."%' order by id desc";
}

$rs=mysql_query($str);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);
$p = new ft_page;
$p->pvar="page"; 
$p->setvar(array("searchcontent" => $searchcontent, "searchkind" => $searchkind));
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($str." limit ".$p->limit());
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/main01.css">
<script src="../js/publicfun.js" type="text/javascript"></script>
<body leftmargin="0" topmargin="5">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="form1" method="post" action="">
    <tr bgcolor="#d6dff7" class="f12">
      <td width="58%" align="right" bgcolor="#FFFFFF">
<div align="left"> 
          <?
	  $p->output(0);
	  ?>
        </div></td>
      <td width="42%" height="30" align="right" bgcolor="#FFFFFF">
<div align="right">搜索： 
          <input name="searchcontent" type="text" id="searchcontent" size="20">
          <select name="searchkind" id="searchkind">
            <option value="username" >用户名</option>
            <option value="tel">电话</option>
          </select>
          <input type="submit" name="Submit" value=" 搜 索 ">
        </div></td>
    </tr>
  </form>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
      <td width="100%">  
      <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#cccccc">
        <tr bgcolor="#f4f4f4" height=22 class="f12"> 
          <td width="5%" height="25" align="center"><strong>ID号</strong></td>
          <td width="8%" align="center"><strong>用户名</strong></td>
          <td width="8%" align="center"><strong>电话</strong></td>
          <td width="5%" align="center"><strong>性别</strong></td>
          <td width="5%" align="center"><strong>年龄</strong></td>
          <td width="8%" align="center"><strong>职业</strong></td>
          <td width="7%" align="center"><strong>学历</strong></td>
          <td width="10%" align="center"><strong>来自</strong></td>
          <td width="9%" align="center"><strong>备注</strong></td>
          <td width="9%" align="center"><strong>报名时间</strong></td>
          <td width="5%" align="center"><strong>标志</strong></td>
          <td width="5%" align="center"><strong>修改</strong></td>
        </tr>
  <form name="selectform" method=post action="pldelbmuser.php">
    <input type="hidden" name="op" value="选择转正">
    <input type="hidden" name="returnURL" value="bmuser_manage.php">
    <script language="JavaScript">
  <!--
  function select_pl_submit(optype){
	var f=document.forms["selectform"]
	f.op.value=optype
	f.submit()
  }
  //-->
  </script>
<?
if ($numrows!=0){
  while ($myrow = mysql_fetch_array($rsx)) {
  $i++;
?>
        <tr bgcolor="#FFFFFF" class="f12">
          <td  height=22 align="center"><input name="checkbox1[]" type="checkbox" id="checkbox1" value="<?=$myrow["id"]?>"></td>
          <td align="center"><?=$myrow["username"]?></td>
          <td align="center"><?=$myrow["tel"]?></td>
          <td align="center"><?=$myrow["sex"]?></td>
          <td align="center"><?=$myrow["age"]?></td>
          <td align="center"><?=$myrow["job"]?></td>
          <td align="center"><?=$myrow["edu"]?></td >
          <td align="center"><?=$myrow["address"]?></td>
          <td align="center"><?=$myrow["note"]?></td>
          <td align="center"><?=$myrow["indate"]?></td>
          <td align="center"> 
            <? if ($myrow["flag"]==1){?>
            <a href="ftbbsdel.php?id=<?=$myrow["id"]?>&tb=ftbbs_bmtb&flag=0"><font color=red>隐</font></a> 
            <? }else{?>
            <a href="ftbbsdel.php?id=<?=$myrow["id"]?>&tb=ftbbs_bmtb&flag=1">显</a> 
            <? }?>
          </td>
          <td align="center"> 
            <? if (false!==strrpos($_SESSION["admin_qs"],"2")){?>
            <a href="bmuser_edit.php?id=<?=$myrow["id"]?>">修改</a> 
            <? }?>
          </td>
        </tr>
<?
}
?>
    <tr bgcolor="#FFFFFF"> 
      <td height="25" colspan="17"> 
        <input type="checkbox" name="chkall" onclick="checkall(this.form)">
		<input name="button" type="button" onclick="select_pl_submit('选择删除')" value="将所选删除" <? if (false===strrpos($_SESSION["admin_qs"],"3")){?>disabled<? }?>>
      </td>
    </tr>
        <tr bgcolor="#FFFFFF" height=22> 
          <td height="25" colspan="17" align="left"> 
            <?
     $p->output(0);
     mysql_free_result($rs);
     mysql_free_result($rsx);
     $db->close(); 
    ?>
          </td>
        </tr>
</form>
<? }else{?>
  <tr bgcolor="#F2F9F9"> 
    <td height="25" colspan=17 align=center class="f12"> 记录为空!</td>
  </tr>
<? }?>
      </table>
</td>
  </tr>
</table>
</body>
</html>