<?php
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
$link=db_connect();
$empire=new mysqlquery();

//验证用户
$lur=is_login();
$logininid=(int)$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];

$url='<a href="ListAllBook.php?tbname=bookname">管理书籍</a> > 需审核章节的书籍';

?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>需审核章节的书籍</title>
<link rel="stylesheet" href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" type="text/css">

</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr> 
    <td width="52%">位置： 
      <?=$url?>
    </td>
    <td width="48%">
	</td>
  </tr>
</table>
<br>
<?
$tsql=$empire->query("select * from {$dbtbpre}enewstable where type=1 order by tid desc");
while($tr=$empire->fetch($tsql)){
?>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  <tr class=header> 
    <td>
      表名：<?=$tr[tbname]?>
    </td>
  </tr>
  <tr  bgcolor="#ffffff"> 
    <td>
       <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
	     <tr bgcolor="#ffffff">
		 <?
		 $i=0;
		 $bsql=$empire->query("select distinct(bookid) from {$dbtbpre}ecms_".$tr[tbname]."_index where checked=0");
		 while($br=$empire->fetch($bsql)){
			 $i+=1;
			 $bk=$empire->fetch1("select * from {$dbtbpre}ecms_bookname where id=$br[bookid]");
			 echo '<td><a href="ListBookData.php?bookid='.$br[bookid].'&classid='.$bk[classid].'&ecmscheck=1">'.$bk[title].'</a></td>';
			 if($i%4==0){
				 echo '</tr><tr bgcolor="#ffffff">';
			 }
		 }
		 ?>
		 </tr>
	   </table>
    </td>
  </tr>
</table>
<br>
<?
}
?>
</body>
</html>