{?set $jieqi_pagetitle = "编辑章节/分卷-{$jieqi_sitename}"?}
{?set $jieqi_contenttitle = "编辑章节/分卷"?}
<script type="text/javascript">
function frmchapteredit_validate(){
  if(document.frmchapteredit.chaptername.value == ""){
    alert("请输入章节章节或分卷标题");
    document.frmchapteredit.chaptername.focus();
    return false;
  }
}
//统计输入字数
function show_inputwords(txt){
	txt = $_(txt);
	var words = (arguments.length > 1) ? $_(arguments[1]) : $_(txt.id + '_words');
	words.innerHTML = txt.value.replace(/[\x00-\x08\x0e-\x1f\x21-\xff]+/gi, 'w').replace(/\s/g, '').length;
}
//显示默认字数
addEvent(window, 'load', function(){show_inputwords('chaptercontent');});
</script>
<script type="text/javascript" src="{?$jieqi_url?}/scripts/attaches.js"></script>
<form class="form" name="frmchapteredit" id="frmchapteredit" action="{?$url_chapteredit?}" method="post" onsubmit="return frmchapteredit_validate();" enctype="multipart/form-data">
<fieldset>
	<div class="frow">
		<label class="col4 flabel">小说名称：</label>
		<div class="col8 last">
			<a href="{?$article_static_url?}/articlemanage.php?id={?$articleid?}">{?$articlename?}</a>
		</div>
	</div>
	<div class="frow">
		<label class="col4 flabel">{?if $chaptertype == 1?}分卷标题：{?else?}章节标题：{?/if?}</label>
		<div class="col8 last">
			<input type="text" class="text" name="chaptername" id="chaptername" maxlength="50" value="{?$chaptername?}" />
		</div>
	</div>
	{?if $chaptertype != 1?}
	<div class="frow">
		<div class="row">
		<label class="col4 flabel">章节内容：</label>
		<div class="col8 last">
			已输入 <span class="hot" id="chaptercontent_words">0</span> 字
		</div>
		</div>
		<div class="row">
		<textarea class="textarea" name="chaptercontent" id="chaptercontent" rows="15" onkeyup="show_inputwords(this);" oninput="show_inputwords(this);" onpropertychange="show_inputwords(this);">{?$chaptercontent?}</textarea>
		</div>
	</div>
	{?if $isvip_n > 0?}
	<div class="frow">
		<label class="col4 flabel">销售价格：</label>
		<div class="col8 last">
			{?$saleprice?} {?$egoldname?}<br /><span class="hot">(为保证价格统一，章节字数请控制在 {?$minvipwords?} 到 {?$maxvipwords?} 之间)</span>
		</div>
	</div>
	{?/if?}
	{?if $authtypeset == 1?}
	<div class="frow">
		<label class="col4 flabel">小说排版：</label>
		<div class="col8 last">
			<label class="radio"><input type="radio" name="typeset" value="1" checked="checked" />自动排版</label>
  			<label class="radio"><input type="radio" name="typeset" value="0" />无需排版</label>
		</div>
	</div>
	{?/if?}
	{?if $attachnum > 0?}
	<div class="frow">
		<label class="col4 flabel">现有附件：</label>
		<div class="col8 last">
			{?section name=i loop=$attachrows?}
  			<label class="checkbox"><input type="checkbox" name="oldattach[]" value="{?$attachrows[i].attachid?}" checked="checked" />{?$attachrows[i].name?}</label>
  			{?/section?}
  			<p class="hot">（取消打勾表示删除该附件）</p>
		</div>
	</div>
	{?/if?}
	{?if $canupload == true && $maxattachnum > 0?}
	<div class="frow">
		<label class="col4 flabel">附件限制：</label>
		<div class="col8 last">
			<span class="hot">文件类型：{?$attachtype?}, 图片最大：{?$maximagesize?}K, 文件最大：{?$maxfilesize?}K</span>
		</div>
	</div>
	<div class="frow">
		<label class="col4 flabel">附件上传：</label>
		<div class="col8 last">
			<input type="file" class="file" name="attachfile[]" id="attachfile" onchange="Attaches.addFile('attachfile', 'attachdiv', true);" /><button type="button" class="filebutton" onclick="if(document.all){document.getElementById('attachfile').outerHTML += '';}else{document.getElementById('attachfile').value = '';}">清空</button>
  			<div id="attachdiv"></div>
		</div>
	</div>
	{?/if?}
	{?/if?}
	<div class="frow">
		<label class="col4 flabel">&nbsp;</label>
		<div class="col8 last">
			<button type="submit" class="button" name="submit">提 交</button>
			<input type="hidden" name="act" value="update" />{?$jieqi_token_input?}
  			<input type="hidden" name="id" value="{?$chapterid?}" />
  			<input type="hidden" name="chaptertype" value="{?$chaptertype?}" />
		</div>
	</div>

</fieldset>
</form>