<?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'];

$bookid=(int)$_GET['bookid'];
$fun_r['AdminBook']='管理书籍';
$bk=GetBN($bookid);

$cc=$empire->fetch1("select classid from {$dbtbpre}ecms_bookname_index where id=$bookid limit 1");
$classid=$cc[classid];
//导航
$url=AdminReturnBookClass($classid).'&nbsp;>&nbsp;<a href="ListBookData.php?bookid='.$bookid.'&classid='.$classid.$addecmscheck.'">《'.$bk[title].'》</a>&nbsp;>&nbsp;管理分卷&nbsp;&nbsp;<a href="ListVolumeAll.php">(全部分卷)</a>';
//取得栏目名
if(!$class_r[$classid][classid])
{
	printerror('ErrorUrl','history.go(-1)');
}
$thisbr=$empire->fetch1("select checked,ln from {$dbtbpre}ecms_bookname_index where id='$bookid'");
if(!$thisbr[checked]){
	printerror("EmptyCk",'history.go(-1)');
}
?>
<!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">
        <input type="button" name="Submit6" value="增加分卷" onclick="self.location.href='AddVolume.php?enews=AddVolume&bookid=<?=$bookid?>&classid=<?=$classid?>'">
      </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="60%" 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 where bookid=$bookid order by myorder,vid");
while($r=$empire->fetch($sql)){

?>  <tr bgcolor='#ffffff'>
      <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"><?=$r[vname]?></div></td>
      <td height="25"> <div align="center"><a href="AddVolume.php?enews=EV&vid=<?=$r[vid]?>&bookid=<?=$bookid?>&classid=<?=$classid?>">修改</a> | <a href="ecmsbookdata.php?enews=DelVolume&bookid=<?=$bookid?>&vid=<?=$r[vid]?>">删除</a></div></td>
	</tr>
<?
}
?>
    <tr class="header"> 
      <td height="25" colspan="4"> <div align="left"> &nbsp;&nbsp;
          <input type="submit" name="Submit5" value="修改分卷顺序" onClick="document.editorder.enews.value='EditVOrder';document.editorder.action='ecmsbookdata.php';">&nbsp;&nbsp;
          <input name="enews" type="hidden" id="enews" value="EditVOrder">
		  <input name="bookid" type="hidden" id="bookid" value="<?=$bookid?>">
		  <input name="classid" type="hidden" id="classid" value="<?=$classid?>">
        </div></td>
    </tr>

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