<?php
if(!defined('InEmpireCMS'))
{
	exit();
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title><?=$title?> -  <?=$public_r[sitename]?></title>
<link href="<?=$public_r[newsurl]?>skin/v3/t.css" rel="stylesheet" />
</head>

<body>
<?php 
include(ECMS_PATH.'inpage/topnav.html');
include(ECMS_PATH.'inpage/head.html');
include(ECMS_PATH.'inpage/menu.html');
?>
<!-- main start -->
<div class="w990">

  <div class="weizhi">
    <div class="wznav black">
      <h5>当前位置：<a href="<?=$public_r[newsurl]?>"><?=$public_r[sitename]?></a> > <a href="allbook.php">书库</a> > <?=$title?></h5>
    </div>
<?php 
include(ECMS_PATH.'inpage/search.html');
?>
    <div class="clear"></div>
  </div>

  <div class="wintro">
    <div class="sxqc"><?=$sx?></div>
    <div class="sxdiv">
	  <div>分类：<?=$xsort?></div>
	  <div>状态：<?=$wanben?></div>
	  <div>时间：<?=$time?></div>
	  <div>排序：<?=$paixu?></div>	  
	  <div class="sxzm">字母：<?=$word?></div> 	  
    </div>
  </div>


  <div class="blank10"></div>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="ttop">
	<tr>
	  <th width="8%" class="tc">类别</th>
	  <th width="15%">书名</th>
	  <th width="21%">最新章节</th>
	  <th width="14%" class="tc">更新时间</th>
	  <th width="12%" class="tc">作者</th>
	  <th width="5%" class="tc">状态</th>
	  <th width="10%" class="tc">字数</th>	  
	  <th width="5%" class="tc">点击数</th>
	  <th width="5%" class="tc">下载数</th>
	  <th width="5%" class="tc">推荐数</th>	  
	</tr>
<?php
$sql=$empire->query($query);
$i=1;
  while($r=$empire->fetch($sql))
  {
	  $hdline='';
	  $bintro='';
	  $wn='';
	  $kse='hui';
	  $bi=$empire->fetch1("select id,classid,wid,checked from {$dbtbpre}ecms_bookname_index where id=$r[id] limit 1");
	  $bookname='<a href="'.$r[titleurl].'" title="'.$r[title].'" target="_blank">'.$r[title].'</a>';
	  if($bi[wid]){
		$wn='<a href="'.$public_r[newsurl].'writer/'.$bi[wid].'/" title="'.GetWname($bi[wid]).'作品集" target="_blank">'.GetWname($bi[wid]).'</a>';
	  }
	  if($r[titlepic]){
		  $fengm=$r[titlepic];
	  }else{
		  $fengm=$public_r[newsurl].'e/data/images/notimg.gif';
	  }
	  $ttt=$i++;	  
	  if($ttt<4){
		  $hdline=' class="hideline"';
		  $kse='red';
		  $bintro='
		  <tr class="item-tr">
		    <td colspan="10">
			  <div class="item-info clearfix">
				<a target="_blank" class="item-img" href="'.$r[titleurl].'"><img src="'.$fengm.'"></a>
				<p class="item-text"><a target="_blank" href="'.$r[titleurl].'">'.$r[smalltext].'</a></p>
            </div>
		  </td>
	    </tr>
		  ';
	  }
	  if($r[full]==1){
		  $fw='连载';
	  }else{
		  $fw='完本';
	  }
	  $tb=GetBdTbname($r[id]);
	  $x=$empire->fetch1("select title,titleurl from {$dbtbpre}ecms_".$tb[tbname]." where bookid=$r[id] order by id desc limit 1");
	  $zx='';
	  if($x[title]){
	  $zx='<a href="'.$x[titleurl].'" target="_blank">'.$x[title].'</a>';
}
?>
      <tr<?=$hdline?>>
		<td class="tc"><a href="<?=ClassUrl($r[classid])?>"><?=$class_r[$r[classid]][classname]?></a></td>
		<td><?=$bookname?></td>
		<td><?=$zx?></td>
		<td class="tc zitia"><?=date('Y-m-d H:i:s',$r[newstime])?></td>
		<td class="tc"><?=$wn?></td>
		<td class="tc"><?=$fw?></td>
		<td class="tc zitia"><?=Zishu($r[id])?></td>
		<td class="tc zitia"><?=$r[onclick]?></td>
		<td class="tc zitia"><?=$r[totaldown]?></td>
		<td class="tc zitia"><?=$r[diggtop]?></td>
      </tr>
	  <?=$bintro?>
<?
}
?>


<tr>
  <td colspan=10 align=center><div class="pages"><?=$listpage?></div></th>
</tr>
</table>

<!-- main end -->

<!-- foot start -->
<?php 
include(ECMS_PATH.'inpage/foot.html');
?>
<!-- foot end -->
</body>
</html>