<?
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("check_master.php");

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

$searchcontent=trim($_POST["searchcontent"]);
if ($searchcontent==""){
$searchcontent=$_GET["searchcontent"];
}

if ($searchcontent==""){
	$str="select * from {$tablepre}bbs_arrest order by id desc";
}
else{
	$str="select * from {$tablepre}bbs_arrest where Content 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));
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($str." limit ".$p->limit());
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?=$charset?>">
<link href="../css/main01.css" rel="stylesheet" type="text/css">

</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  <TR align=center class="f12">
    <TD width="59%" height="25" align="left">
        <?
	  $p->output(0);
	  ?>
   </TD>
     <FORM METHOD=POST ACTION="" >
      <TD width="41%"> <div align="right">
          <INPUT TYPE="text" NAME="searchcontent" size=20>
          <INPUT TYPE="submit" value="搜索" name="">
          <A HREF="bbs_arrest_ope.php?ope=add">[添加内容]</A> </div></TD>
    </FORM>
  </TR>
</TABLE>
<table width="99%" border="0" bgcolor="#cccccc" cellspacing="1" cellpadding="0" align="center">
  <tr bgcolor="#f1f1f1" align=center class="f12"> 
    <td width="10%" height="25">编号</td>
    <td width="20%">类别</td>
    <td width="20%">内容</td>
    <td>日期</td>
    <td width="10%">修改</td>
    <td width="10%">删除</td>
  </tr>
<?
if ($numrows!=0){
  while ($myrow = mysql_fetch_array($rsx)) {
  $i++;
?>
  <tr bgcolor="#FFFFFF" align=center class="f12"> 
    <td height="25"><?=$i?></td>
    <td><?=$myrow["Kind"]?></td>
    <td><?=$myrow["Content"]?></td>
    <td><?=$myrow["indbdate"]?></td>
    <td><A HREF="bbs_arrest_ope.php?ope=mod&id=<?=$myrow["ID"]?>">[修改]</A></td>
    <td><A HREF="../user/ftbbsdel.php?tb=bbs_arrest&flag=3&id=<?=$myrow["ID"]?>">[删除]</A></td>
  </tr>
<?
}
?>
  <tr align=center bgcolor="#FFFFFF"> 
    <td height="25" colspan="14" 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=14 align=center class="f12"> 记录为空!</td>
  </tr>
<? }?>
</table>
</body>
</html>