{?set jieqi_blocks_module = "article"?}
{?set jieqi_blocks_config = "authorblocks"?}
<script type="text/javascript">
var customprice = '{?$customprice?}';
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 name="frmchapteredit" id="frmchapteredit" action="{?$jieqi_modules['article']['url']?}/draftedit.php?do=submit" method="post" onsubmit="return frmchapteredit_validate();" enctype="multipart/form-data">
<table width="100%" class="grid" cellspacing="1" align="center">
<caption>编辑草稿</caption>
<tr valign="middle" align="left">
		<td class="tdl" width="20%">{?if $isvip == 0?}小说名称：{?else?}VIP小说名称：{?/if?}</td>
		<td class="tdr">
		{?if $isvip == 0?}
		<select class='select'  size='1' name='articleid' id='articleid'>
		<option value='0'>--请选择--</option>
		{?section name=i loop=$articlerows?}
		<option value='{?$articlerows[i].articleid?}'{?if $articlerows[i].checked > 0?} selected{?/if?}>{?$articlerows[i].articlename?}</option>
		{?/section?}
		</select>
		{?else?}
		<select class='select'  size='1' name='obookid' id='obookid'>
		<option value='0'>--请选择--</option>
		{?section name=i loop=$obookrows?}
		<option value='{?$obookrows[i].obookid?}'{?if $obookrows[i].checked > 0?} selected{?/if?}>{?$obookrows[i].obookname?}</option>
		{?/section?}
		</select>
		{?/if?}
		</td>
</tr>
<tr valign="middle" align="left">
  <td class="tdl">章节标题：</td>
  <td class="tdr"><input type="text" class="text" name="chaptername" id="chaptername" size="50" maxlength="50" value="{?$chaptername?}" /></td>
</tr>
{?if $isvip > 0 && $customprice > 0?}
	<tr valign="middle" align="left" id="sprice">
		<td class="tdl">本章定价：</td>
		<td class="tdr"><input type='text' class='text' name='saleprice' id='saleprice' size='10' maxlength='10' value='{?$saleprice?}' /><span class="hot">{?$egoldname?}(留空则自动按字数计价)</span></td>
	</tr>
{?/if?}
{?if $uptiming > 0?}
<tr valign="middle" align="left">
		<td class="tdl">是否定时发表：</td>
		<td class="tdr">
		<label class="radio"><input type="radio" name="uptiming" value="0"{?if $pubdate == 0?} checked="checked"{?/if?} onclick="document.getElementById('pubtime').style.display='none';" />否</label> &nbsp; 
		<label class="radio"><input type="radio" name="uptiming" value="1"{?if $pubdate > 0?} checked="checked"{?/if?} onclick="document.getElementById('pubtime').style.display='';" />是</label> &nbsp; 
		</td>
</tr>
<tr valign="middle" align="left" id="pubtime" {?if $pubdate == 0?}style="display:none;"{?/if?}>
		<td class="tdl">定时发表时间：</td>
		<td class="tdr">
		<input type="text" class="text" style="width:3em;" name="pubyear" id="pubyear" maxlength="4" value="{?$pubyear?}" />年<input type="text" class="text" style="width:2em;" name="pubmonth" id="pubmonth" maxlength="2" value="{?$pubmonth?}" />月<input type="text" class="text" style="width:2em;" name="pubday" id="pubday" maxlength="2" value="{?$pubday?}" />日<input type="text" class="text" style="width:2em;" name="pubhour" id="pubhour" maxlength="2" value="{?$pubhour?}" />时<input type="text" class="text" style="width:2em;" name="pubminute" id="pubminute" maxlength="2" value="{?$pubminute?}" />分
		</td>
</tr>
{?/if?}
<tr valign="middle" align="left">
  <td class="tdl">章节内容：<br />已输入 <span class="hot" id="chaptercontent_words">0</span> 字</td>
  <td class="tdr"><textarea class="textarea" name="chaptercontent" id="chaptercontent" rows="25" cols="80" onkeyup="show_inputwords(this);" oninput="show_inputwords(this);" onpropertychange="show_inputwords(this);">{?$chaptercontent?}</textarea></td>
</tr>
{?if $attachnum > 0?}
<tr valign="middle" align="left">
  <td class="tdl">现有附件： <br /><span class="hot">（取消打勾表示删除该附件）</span></td>
  <td class="tdr">
  {?section name=i loop=$attachrows?}
  <input type="checkbox" name="oldattach[]" value="{?$attachrows[i].attachid?}" checked="checked" /><a href="{?$attachrows[i].url?}" target="_blank">{?$attachrows[i].name?}</a> 
  {?/section?}
  </td>
</tr>
{?/if?}
{?if $canupload == true && $maxattachnum > 0?}
<tr valign="middle" align="left">
  <td class="tdl">附件限制：</td>
  <td class="tdr">文件类型：{?$attachtype?}, 图片最大：{?$maximagesize?}K, 文件最大：{?$maxfilesize?}K</td>
</tr>
<tr valign="middle" align="left">
  <td class="tdl">附件上传：</td>
  <td class="tdr">
  <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>
  </td>
</tr>
{?/if?}
<tr valign="middle" align="left">
  <td class="tdl">&nbsp;
  <input type="hidden" name="act" value="update" />{?$jieqi_token_input?}
  <input type="hidden" name="id" value="{?$id?}" />
  <input type="hidden" name="isvip" value="{?$isvip?}" />
  </td>
  <td class="tdr"><button type="submit" class="button" name="submit">提 交</button></td>
</tr>
</table>
</form>