<?php
define('EmpireCMSAdmin','1');
$st=microtime(true);
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require LoadLang("pub/fun.php");
require("../data/dbcache/class.php");
require("../class/dpfun.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'];
$classid=(int)$_GET['classid'];
$bk=GetBN($bookid);
//取得栏目名
if(!$bookid)
{
	printerror('ErrorUrl','history.go(-1)');
}
//书籍
$thisbr=$empire->fetch1("select tid,datanum,cknum,checked,ln from {$dbtbpre}ecms_bookname_index where id='$bookid'");
if(!$thisbr[checked]){
	printerror("EmptyCk",'history.go(-1)');
}

//审核表
$ecmscheck=(int)$_GET['ecmscheck'];
if($ecmscheck)
{
	printerror('ErrorUrl','history.go(-1)');
}
//导航
$url='《'.$bk[title].'》</a>&nbsp;>&nbsp; <b>章节和分卷顺序调整</b>';

$v_str='';
$v_sql=$empire->query("select vid,vname from {$dbtbpre}enewsvolume where bookid=$bookid order by myorder,vid");
while($v_r=$empire->fetch($v_sql))
{
	$v_str.="<option value='".$v_r[vid]."'>".$v_r[vname]."</option>";
}

?>
<!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>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
  <tr> 
    <td>位置： 
      <?=$url?>
    </td>
  </tr>
</table>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  <form name="f1" method="post" action="ecmsbookdata.php">
    <tr class="header"> 
      <td height=25>
		章节调整
      </td>
    </tr>
    <tr bgcolor="#ffffff"> 
	  <td height=25>
		将ID为<input type="text" name="id" size=10>的章节移动到ID为<input type="text" name="toid" size=10>的章节 <input type="radio" name="wei" value=1 checked>之后 <input type="radio" value=2 name="wei">之前
	  </td>
    </tr>
    <tr bgcolor="#ffffff"> 
	  <td height=25>
		<input type="hidden" name="enews" value="mvidtoid">
		<input type="hidden" name="bookid" value="<?=$bookid?>">
		<input type="submit" value="提交">
	  </td>
    </tr>
  </form>
</table>
<br>
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class="tableborder">
  <form name="f2" method="post" action="ecmsbookdata.php">
    <tr class="header"> 
      <td height=25>
		分卷调整
      </td>
    </tr>
    <tr bgcolor="#ffffff"> 
	  <td height=25>
		将ID从<input type="text" name="sid" size=10>到<input type="text" name="eid" size=10>的章节移入
		分卷<select name="vid">
			<option value="" selected>请选择</option>
			<?=$v_str?>
		</select>
	  </td>
    </tr>
    <tr bgcolor="#ffffff"> 
	  <td height=25>
	    <input type="hidden" name="enews" value="mvidtov">
		<input type="hidden" name="bookid" value="<?=$bookid?>">
		<input type="submit" value="提交">
	  </td>
    </tr>
  </form>
</table>

</body>
</html>
<?
db_close();
$empire=null;
?>