<?php
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/q_functions.php");
require("../class/qinfofun.php");
require("../member/class/user.php");
require("../data/dbcache/class.php");
require("../class/dpfun.php");
require("../data/dbcache/MemberLevel.php");
$link=db_connect();
$empire=new mysqlquery();
//验证是否登陆
$user=islogin();
$userid=$user['userid'];
$username=$user['username'];

//取得模型id
$bookid=(int)$_GET['bookid'];
//验证书审核状态
$bck=$empire->fetch1("select * from {$dbtbpre}ecms_bookname_index where id=$bookid limit 1");
if(!$bck[checked])
{
	printerror("ErrorUrl","history.go(-1)",1);
}
//验证是否当前用户
$bookname=$empire->fetch1("select * from {$dbtbpre}ecms_bookname where id=$bookid limit 1");
if(!$bookname[ismember] || $bookname[userid]!=$userid || $bookname[username]!=$username)
{
	printerror("ErrorUrl","history.go(-1)",1);
}

$enews=$_GET['enews'];
if(empty($enews)){
	$enews='AddV';
}

$word='增加分卷';
$k[myorder]=0;

if($enews=='EV'){
	$word="修改分卷";
	$vid=(int)$_GET[vid];
	$k=$empire->fetch1("select * from {$dbtbpre}enewsvolume where vid=$vid");
}

$public_diyr['pagetitle']=$word;
$url="<a href='../../'>首页</a>&nbsp;>&nbsp;<a href='../member/cp/'>会员中心</a>&nbsp;>&nbsp;<a href='ListInfo.php?mid=".$mid."'>管理信息</a>&nbsp;>&nbsp;".$word."&nbsp;(".$mr[qmname].")";
require(ECMS_PATH.'e/template/incfile/header.php');

?>
<script src="../data/html/setday.js"></script>
<script>
function bs(){
	var f=document.add
	if(f.title.value.length==0){alert("标题还没写");f.title.focus();return false;}
	if(f.classid.value==0){alert("请选择栏目");f.classid.focus();return false;}
}
function foreColor(){
  if(!Error())	return;
  var arr = showModalDialog("../data/html/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
  if (arr != null) document.add.titlecolor.value=arr;
  else document.add.titlecolor.focus();
}
function FieldChangeColor(obj){
  if(!Error())	return;
  var arr = showModalDialog("../data/html/selcolor.html", "", "dialogWidth:18.5em; dialogHeight:17.5em; status:0");
  if (arr != null) obj.value=arr;
  else obj.focus();
}
</script>
<script src="../data/html/postinfo.js"></script>
<form name="add" method="post" action="ecms.php">
    <input name="classid" type="hidden" value="<?=$classid?>">
    <input name="bookid" type="hidden" value="<?=$bookid?>">
	<input name="enews" type="hidden" value="<?=$enews?>">
	<input name="vid" type="hidden" value="<?=$k[vid]?>">
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder">
	  <tr>
	    <td width='16%' height=25 bgcolor='ffffff'>书名</td>
	    <td height="25" bgcolor="#FFFFFF"> &nbsp;<?=$bookname[title]?>
	    </td>
	  </tr>
	  <tr>
	    <td width='16%' height=25 bgcolor='ffffff'>卷名</td>
	    <td height="25" bgcolor="#FFFFFF">	&nbsp;
		<input type=text name=vname value="<?=ehtmlspecialchars(stripSlashes($k[vname]))?>" size="45"> 
	    </td>
	  </tr>
	  <tr>
	    <td width='16%' height=25 bgcolor='ffffff'>排序</td>
	    <td height="25" bgcolor="#FFFFFF">	&nbsp;
		<input type=text name=myorder value="<?=$k[myorder]?>" size="10"> 
	    </td>
	  </tr>
	</table>

  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="16%">&nbsp;</td>
      <td><input type="submit" name="submit" value=" 提 交 "></td>
    </tr>
  </table>
</form>

<?php
require(ECMS_PATH.'e/template/incfile/footer.php');
db_close();
$empire=null;
?>