<?php
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require("../class/dpfun.php");
require LoadLang("pub/fun.php");
require("../data/dbcache/class.php");
$link=db_connect();
$empire=new mysqlquery();
//验证用户
$lur=is_login();
$logininid=$lur['userid'];
$loginin=$lur['username'];
$loginrnd=$lur['rnd'];
$loginlevel=$lur['groupid'];
$loginadminstyleid=$lur['adminstyleid'];

//翻页
$start=0;
$page=(int)$_GET['page'];
$page=RepPIntvar($page);
$line=10;//每页显示
$page_line=12;
$offset=$page*$line;
$search='';
$num=$empire->gettotal("select count(*) as total from {$dbtbpre}enewsvolume");//总数
$search.="&totalnum=$num";
$returnpage=page2($num,$line,$page_line,$start,$page,$search);

//导航
$url='<a href="ListVolumeAll.php">全部分卷管理</a>';

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="adminstyle/<?=$loginadminstyleid?>/adminstyle.css" type="text/css">
<title>全部分卷管理</title>
<script>
function CheckAll(form)
  {
  for (var i=0;i<form.elements.length;i++)
    {
    var e = form.elements[i];
    if (e.name != 'chkall')
       e.checked = form.chkall.checked;
    }
  }
</script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr> 
    <td width="52%">位置： 
      <?=$url?>
    </td>
    <td width="48%">
	<div align="right" class="emenubutton">
      </div>
	</td>
  </tr>
</table>
<form name="add" method="post" action="ecmsbookdata.php">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  	<tr class="header"> 
      <td width="10%" height="25"><div align="center">VID</div></td>
      <td width="10%" height="25"> <div align="center">排序</div></td>
	  <td width="25%" height="25"> <div align="center">所属书名</div></td>
	  <td width="35%" height="25"> <div align="center">分卷名称</div></td>
      <td width="20%" height="25"> <div align="center">操作</div></td>
    </tr>

<?
$sql=$empire->query("select * from {$dbtbpre}enewsvolume order by vid desc limit $offset,$line");
while($r=$empire->fetch($sql)){
$b=$empire->fetch1("select title,titleurl from {$dbtbpre}ecms_bookname where id=$r[bookid] limit 1");
if(empty($b[title])){
	$bn='未审核的书';
}else{
	$bn='<a href="'.$b[titleurl].'" target="_blank">《'.$b[title].'》</a>';
}
?>  <tr  bgcolor="#FFFFFF" onmouseout="this.style.backgroundColor='#ffffff'" onmouseover="this.style.backgroundColor='#E2E9EA'">
      <td height="25"><div align="center"><?=$r[vid]?><input type=hidden name=vid[] value="<?=$r[vid]?>"></div></td>
      <td height="25"> <div align="center"><input type=text name=myorder[] value="<?=$r[myorder]?>" size=2></div></td>
	  <td height="25"> <div align="center"><?=$bn?></div></td>
	  <td height="25"> <div align="center"><?=$r[vname]?></div></td>
      <td height="25"> <div align="center"><a href="AddVolume.php?enews=EV&vid=<?=$r[vid]?>&bookid=<?=$r[bookid]?>">修改</a> | <a href="ecmsbookdata.php?enews=DelVolume&bookid=<?=$r[bookid]?>&vid=<?=$r[vid]?>">删除</a></div></td>
	</tr>
<?
}
?>
    <tr bgcolor="#FFFFFF"> 
      <td colspan=5 height="30"> 
      <?=$returnpage?>
      </td>
    </tr>

</table>
</form>
<?
db_close();
$empire=null;
?>