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

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

include_once("homeurl.php");
?>
<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>
<body>
<?
if (get_cookie('ftbbstype')==1){
include_once("pbhead.php");
}
?>
<table width="99%" border="0" cellspacing="0" cellpadding="0" align="center" class="maintbbg">
  <tr> 
    <td> <table width="100%" border=0 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>
      
    </td>
  </tr>
</table>
<table cellspacing=0 cellpadding=0 width="99%" align=center border=0>
  <tr> 
    <td height=5></td>
  </tr>
</table>
<table width="99%" border=0 cellpadding=2 cellspacing=0 class="listborder" align="center">
  <tbody>
    <tr align=middle class=f12> 
      <td width="9%" height="28" class="tdborder"><div align="center">版主网名</div></td>
      <td width="23%" class="tdborder"> <div align="center">最后登陆时间</div></td>
      <td width="12%" class="tdborder"> <div align="center">发表文章数</div></td>
      <td width="10%" class="tdborder"> <div align="center">失踪天数</div></td>
      <td width="17%" class="tdborder"> <div align="center">担任版块</div></td>
      <td width="30%" class="tdborder"> <div align="center">评定结果</div></td>
    </tr>
    <?
$p = new ft_page;
$sqlcount="select count(*) from {$tablepre}bbs_cate where deleted=0 and BBS_Cate_PID<>'0' order by bbs_id desc";
$strsql="select BBS_Cate_Name,BBS_Cate_ID,BBS_Cate_PID,BBS_Cate_Qs,BBS_Cate_Note,BBS_Cate_Topic,BBS_Cate_Reply,BBS_Cate_Manager_Name from {$tablepre}bbs_cate where deleted=0 and BBS_Cate_PID<>'0' order by bbs_id desc";

$rs=mysql_query($sqlcount);
$myrow = mysql_fetch_array($rs);
$numrows=$myrow[0];
$p->pvar="page";
//$p->setvar(array("id" => $pid)); 
$p->set($pagesize,$numrows,$psize); 
$rsx=mysql_query($strsql." limit ".$p->limit());
if ($numrows!=0){
   while ($myrow = mysql_fetch_array($rsx)){
   $bzname=$myrow["BBS_Cate_Manager_Name"];
   $BBS_Cate_Name=$myrow["BBS_Cate_Name"];
   $BBS_Cate_ID=$myrow["BBS_Cate_ID"];
   $BBS_Cate_PID=$myrow["BBS_Cate_PID"];
   $BBS_Cate_Qs=$myrow["BBS_Cate_Qs"];
       if (strrpos($bzname,"|")){
	      $arr=explode("|",$bzname);
		  for($i=0; $i<count($arr); $i++){
			  $clubuser_id="";
			  $clubuser_name="";
			  $postnum="";
			  $clubuser_lasttime="";
		      $sql2="select clubuser_id,clubuser_name,postnum,clubuser_lasttime from {$tablepre}clubuser where clubuser_name='".$arr[$i]."'";
			  $rs2=mysql_query($sql2);
              $row2 = mysql_fetch_array($rs2);
              $rsnum2= mysql_num_rows($rs2);
              if ($rsnum2!=0){
			  $clubuser_id=$row2["clubuser_id"];
			  $clubuser_name=$row2["clubuser_name"];//$arr[$i];
			  $postnum=$row2["postnum"];
			  $clubuser_lasttime=$row2["clubuser_lasttime"];
			  $daynum=dateDiff("DAY", $getnow, $clubuser_lasttime);
			  if ($daynum<0){
			     $daynum=$daynum*(-1);
				 }
			  else{
			     $daynum=0;
			  }
			  if ($daynum>7){
			     $ruslt="此斑竹已<font color=red>严重失职</font>,将取消资格!";
				 }
			  elseif ($daynum>0 && $daynum<=7){
			    $ruslt="此斑竹<font color=red>7</font>天之内有登录!";
				}
			  else{
			    $ruslt="此斑竹比较勤快，加油哦!";
			  }
           ?>
    <tr align=middle> 
      <td width="9%" height="28" class="loopborder1" align="center"><a href="../ftbbsmyinfo.php?ftbbsuser=<?=$clubuser_name?>">
        <?=$clubuser_name?>
        </a></td>
      <td width="22%"  align=left valign="middle" class="loopborder3">
        <?=$clubuser_lasttime?>
      </td>
      <td width="12%" class="loopborder1" align="center"><font color="#FF0000">
        <?=$postnum?>
        </font>篇</td>
      <td width="10%" class="loopborder3" align="center">
        <?=$daynum?>
      </td>
      <td width="17%" class="loopborder1" align="center"><a href="main.php?layer_1=<?=$BBS_Cate_PID?>&layer_2=<?=$BBS_Cate_ID?>&qs=<?=$BBS_Cate_Qs?>">
        <?=$BBS_Cate_Name?>
        </a></td>
      <td width="30%" class="loopborder3" align="center">
        <?=$ruslt?>
      </td>
    </tr>
    <?
		     }
		   }
         }
	   else
	   {
	          $sql3="select clubuser_id,clubuser_name,postnum,clubuser_lasttime from {$tablepre}clubuser where clubuser_name='".$bzname."'";
			  $rs2=mysql_query($sql3);
              $row2 = mysql_fetch_array($rs2);
              $rsnum2= mysql_num_rows($rs2);
			  if ($rsnum2!=0){
			  $clubuser_id2=$row2["clubuser_id"];
			  $clubuser_name2=$row2["clubuser_name"];
			  $postnum2=$row2["postnum"];
			  $clubuser_lasttime2=$row2["clubuser_lasttime"];
			  $daynum2=dateDiff("DAY", $getnow, $clubuser_lasttime2);
			  if ($daynum2<0){
			     $daynum2=$daynum2*(-1);
				 }
			  else{
			     $daynum2=0;
			  }
			  if ($daynum2>7){
			     $ruslt2="此斑竹已<font color=red>严重失职</font>,将取消资格!";
				 }
			  elseif ($daynum2>0 && $daynum2<=7){
			    $ruslt2="此斑竹<font color=red>7</font>天之内有登录!";
				}
			  else{
			    $ruslt2="此斑竹比较勤快，加油哦!";
			  }
		  ?>
    <tr align=middle> 
      <td width="9%" height="28" class="loopborder1" align="center"><a href="../home.php?userid=<?=$clubuser_id2?>" target="_blank">
        <?=$clubuser_name2?>
        </a></td>
      <td width="22%"  align=left valign="middle" class="loopborder3">
        <?=$clubuser_lasttime2?>
      </td>
      <td width="12%" class="loopborder1" align="center"><font color="#FF0000">
        <?=$postnum2?>
        </font>篇</td>
      <td width="10%" class="loopborder3" align="center">
        <?=$daynum2?>
      </td>
      <td width="17%" class="loopborder1" align="center"><a href="main.php?layer_1=<?=$BBS_Cate_PID?>&layer_2=<?=$BBS_Cate_ID?>&qs=<?=$BBS_Cate_Qs?>">
        <?=$BBS_Cate_Name?>
        </a></td>
      <td width="30%" class="loopborder3" align="center">
        <?=$ruslt2?>
      </td>
    </tr>
    <?
	       }
	     }
	   }
	   ?>
    <tr valign="top"> 
      <td colspan="7" class="loopborder1"><table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <td height="20" align="left" class="f12"> 
              <?
                  $p->output(0);
				  mysql_free_result($rs2);
				  mysql_free_result($rsx);
                  $db->close(); 
                 ?>
            </td>
          </tr>
        </table></td>
    </tr>
    <?}else{?>
    <tr class="maintbtr3"> 
      <td colspan=7 align=center height=25> 没有数据</td>
    </tr>
    <?}?>
  </tbody>
</table>
<?
include_once("inc/bbstail.php");
?>