<?php
require("../class/connect.php");
require("../class/db_sql.php");
require("../data/dbcache/class.php");
require("../class/q_functions.php");
require("../member/class/user.php");
require("../data/dbcache/MemberLevel.php");
$link=db_connect();
$empire=new mysqlquery();
//关闭投稿
if($public_r['addnews_ok'])
{
	printerror("CloseQAdd","",1);
}
//验证本时间允许操作
eCheckTimeCloseDo('info');
//验证IP
eCheckAccessDoIp('postinfo');
$muserid=(int)getcvar('mluserid');
$musername=RepPostVar(getcvar('mlusername'));
if(empty($musername))
{
	printerror('未登录','',8,1,1);
}
if($musername){
	$user=islogin();
}
$classjs=$public_r['newsurl']."d/js/js/addinfo".$mid.".js";
$blist='';
$lsql=$empire->query("select title,id,classid from {$dbtbpre}ecms_bookname where username='$musername' and ismember=1 order by id desc");
while($lr=$empire->fetch($lsql)){
	$blist.='<option value="'.$lr[id].'">|-- '.$lr[title].' ('.$class_r[$lr[classid]][classname].')</option>';
}

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

?>


<script>
function CheckChangeClass()
{
	if(document.changeclass.classid.value==0||document.changeclass.classid.value=='')
	{
		alert("请选择书籍");
		return false;
	}
	return true;
}
</script>

<script language="javascript">
function newwin()
{win = window.open("","xxx")}
</script>
      <table width="100%" border="0" align="center">
        <tr> 
          <td>你好，<b><?=$musername?></b></td>
        </tr>
      </table>
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableborder">
        <form action="AddBookData.php" method="get" name="changeclass" id="changeclass" target="xxx" onsubmit="return newwin()">
          <tr class="header"> 
            <td height="23"><strong>请选择要增加章节的书籍 
                <input name="mid" type="hidden" id="mid" value="<?=$mid?>">
              <input name="enews" type="hidden" id="enews" value="AddBd">
              </strong></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="32"> <select name=bookid size="22" style="width:300px; border:0 none;">
                <?=$blist?>
              </select> </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td><input type="submit" name="Submit" value="增加章节"></td>
          </tr>
        </form>
      </table>

<?php
require(ECMS_PATH.'e/template/incfile/footer.php');

db_close();
$empire=null;
?>