<?
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");

$pltype=$_GET["pltype"];
$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"];
}

$p = new ft_page;
if ($searchcontent!=""){
$sql="select * from {$tablepre}ftblog_pl where pltype=".$pltype." and ".$searchkind." like '%".$searchcontent."%' order by pldate desc";
}
else{
$sql="select * from {$tablepre}ftblog_pl where pltype=".$pltype." order by pldate desc";
}
$rs=mysql_query($sql);
$myrow = mysql_fetch_array($rs);
$numrows = mysql_num_rows($rs);

$p->pvar="page"; 
$p->setvar(array("searchcontent" => $searchcontent, "searchkind" => $searchkind, "pltype" => $pltype));
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($sql." limit ".$p->limit());
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>评论管理</title>
<link href="../css/main01.css" rel="stylesheet" type="text/css">
</head>
<script language="javascript" src="../js/publicfun.js"></script>
<body>
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr valign="middle"> 
    <td height="20" colspan="5" bgcolor="#FFFFFF" class="f12"> <div align="center">
        <?
		if ($pltype==0){
		   echo "日志";
		   } 
		elseif ($pltype==1){
		   echo "相册";
		   }
		elseif ($pltype==2){
		  echo "专辑";
		}
		?>评论管理</div></td>
  </tr>
  <TR align="center" class="f12"> 
    <FORM METHOD=POST ACTION="" >
	  <TD width="71%" align="left">
      <?
	  $p->output(0);
	  ?>
	  </TD>
      <TD width="40%" height="25"> 
        <div align="right"> 
            <INPUT TYPE="text" NAME="searchcontent" size=20>
            <select name="searchkind" style="width:50px">
              <option value="netname">网名</option>
              <option value="plcontent">内容</option>
            </select>
            <INPUT TYPE="submit" value="搜索" name="">
        </div></TD>
    </FORM>
  </TR>
</TABLE>
<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td height="1" colspan="6" background="../blogimages/dotbg.gif"><spacer height="1" type="block"></td>
  </tr>
  <tr class="f12" bgcolor="#F8F8F8"> 
    <td width="9%" height="25"> <div align="left"><strong>网名</strong></div></td>
    <td width="69%"><strong>内容</strong></td>
    <td width="7%"><div align="center">状态</div></td>
    <td width="8%"><div align="center">编辑</div></td>
  </tr>
  <tr> 
    <td height="1" colspan="6" background="../blogimages/dotbg.gif"><spacer height="1" type="block"></td>
  </tr>
  <form name="selectform" method=post action="delpl.php">
    <input type="hidden" name="op" value="选择转正">
    <input type="hidden" name="returnURL" value="manage_pl.php?<?=phpself?>">
    <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 class="f12"> 
    <td height="25" bgcolor="#FFFFFF"><div class="opt">
        <font color="#336699"><input name="checkbox1[]" type="checkbox" value="<?=$myrow["id"]?>"><?=$myrow["netname"]?></font>
      </div></td>
    <td height="25" bgcolor="#FFFFFF">
      <?=$myrow["plcontent"]?>
    </td>
    <td height="25" bgcolor="#FFFFFF" align="center"><div class="opt"> 
        <?
		if ($myrow["plqs"]==0){
        echo "显示";
        }else{
        echo "<font color=red>隐藏<font>";
        }
		?>
      </div></td>
    <td height="25" bgcolor="#FFFFFF" align="center"><div class="opt">
    <? if (false===strrpos($_SESSION["admin_qs"],"2")){
	   echo "编辑";
	 }else{
	 echo "<a href=admin_blog_editpl.php?id=".$myrow["id"].">编辑</a>";
	 }
	?>
	</div></td>
  </tr>
  <tr> 
    <td height="1" colspan="6" background="../blogimages/dotbg.gif"><spacer height="1" type="block"></td>
  </tr>
  <?
}
?>
    <tr bgcolor="#F8F8F8"> 
      <td colspan="5" height="35"> <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<? }?>> 
        <input name="button" type="button" onclick="select_pl_submit('选择显示')" value="将所选显示" <? if (false===strrpos($_SESSION["admin_qs"],"3")){?>disabled<? }?>>  
        <input name="button" type="button" onclick="select_pl_submit('取消显示')" value="将所选隐藏" <? if (false===strrpos($_SESSION["admin_qs"],"3")){?>disabled<? }?>>  
      </td>
    </tr>
  </form>
  <tr> 
    <td height="1" colspan="6" background="../blogimages/dotbg.gif"><spacer height="1" type="block"></td>
  </tr>
  <tr> 
    <td colspan="6" height="35"> 
      <?
     $p->output(0);
     mysql_free_result($rs);
     mysql_free_result($rsx);
     $db->close(); 
    ?>
    </td>
  </tr>
  <? }else{?>
  <tr> 
    <td height="25" colspan=6 align="center" class="f12"> 记录为空!</td>
  </tr>
  <? }?>
</table>
</body>
</html>