{?set jieqi_page_rows = "50"?}
<script type="text/javascript">
//隐藏显示
function act_share(url){
	var o = getTarget();
	var param = {
		method: 'POST', 
		onFinish: ''
	}
	if(o.getAttribute('switch') == '0'){
		url = url.replace('act=oneself', 'act=share');
		param.onFinish = function(res){
			if(res.match('成功')){
				o.setAttribute('switch', '1');
				o.innerHTML = '取消共享';
				o.className = 'hot';
			}
		}
	}else{
		url = url.replace('act=share', 'act=oneself');
		param.onFinish = function(res){
			if(res.match('成功')){
				o.setAttribute('switch', '0');
				o.innerHTML = '设为共享';
				o.className = '';
			}
		}
	}
	Ajax.Tip(url, param);
	return false;
}
</script>
<form name="frmsearch" method="get" action="{?$url_article?}">
<table class="grid" width="100%" align="center">
    <tr>
        <td>
		分类：
		<select class="select" size="1" onchange="showtypes(this)" name="sortid" id="sortid">
		<option value="0">不限分类</option>
		{?section name=i loop=$sortrows?}
		<option value="{?$i['key']?}"{?if $_request['sortid'] == $i['key']?} selected="selected"{?/if?}>{?$sortrows[i].caption?}</option>
		{?/section?}
		</select>
		<span id="typeselect" name="typeselect"></span>
        <script type="text/javascript">
        function showtypes(obj){
          var typeselect=document.getElementById('typeselect');
          typeselect.innerHTML='';
          {?section name=i loop=$sortrows?}
	      {?if $sortrows[i].types != ''?}
	      if(obj.options[obj.selectedIndex].value == {?$i['key']?}) typeselect.innerHTML='<select class="select" size="1" name="typeid" id="typeid"><option value="0">不限子类</option>{?section name=j loop=$sortrows[i].types?}<option value="{?$j['key']?}"{?if $_request['typeid'] == $j['key']?} selected="selected"{?/if?}>{?$sortrows[i]['types'][j]?}</option>{?/section?}</select>';
	      {?/if?}
          {?/section?}
         }
		 {?if $_request['sortid'] > 0?}showtypes(document.getElementById('sortid'));{?/if?}
        </script>
		排序：
		<select class="select" size="1" name="order">
		  <option value="postdate"{?if $_request['order'] == 'postdate'?} selected="selected"{?/if?}>入库时间</option>
		  <option value="lastupdate"{?if $_request['order'] == 'lastupdate'?} selected="selected"{?/if?}>最近更新</option>
		  <option value="toptime"{?if $_request['order'] == 'toptime'?} selected="selected"{?/if?}>编辑推荐</option>
		  <option value="goodnum"{?if $_request['order'] == 'goodnum'?} selected="selected"{?/if?}>收藏数</option>
		  <option value="size"{?if $_request['order'] == 'words'?} selected="selected"{?/if?}>小说字数</option>
		  <option value="allvisit"{?if $_request['order'] == 'allvisit'?} selected="selected"{?/if?}>总点击</option>
		  <option value="monthvisit"{?if $_request['order'] == 'monthvisit'?} selected="selected"{?/if?}>月点击</option>
		  <option value="allvote"{?if $_request['order'] == 'allvote'?} selected="selected"{?/if?}>总推荐</option>
		  <option value="monthvote"{?if $_request['order'] == 'monthvote'?} selected="selected"{?/if?}>月推荐</option>
		</select>
		<select class="select" size="1" name="asc">
		  <option value="0"{?if $_request['asc'] == 0?} selected="selected"{?/if?}>倒序</option>
		  <option value="1"{?if $_request['asc'] == 1?} selected="selected"{?/if?}>顺序</option>
		</select>
		 共享状态：
		<label class="radio"><input type="radio" name="share" value="0"{?if $_request['share'] == 0?} checked="checked"{?/if?}">全部</label>
    <label class="radio"><input type="radio" name="share" value="1"{?if $_request['share'] == 1?} checked="checked"{?/if?}>已共享</label> 
		<label class="radio"><input type="radio" name="share" value="2"{?if $_request['share'] == 2?} checked="checked"{?/if?}>未共享</label>
		|
		 搜索条件：
		<label class="radio"><input type="radio" name="keytype" value="0"{?if $_request['keytype'] == 0?} checked="checked"{?/if?}">小说名称</label>
    <label class="radio"><input type="radio" name="keytype" value="1"{?if $_request['keytype'] == 1?} checked="checked"{?/if?}>作者</label> 
		<label class="radio"><input type="radio" name="keytype" value="2"{?if $_request['keytype'] == 2?} checked="checked"{?/if?}>发表者</label> &nbsp;&nbsp;
		<button type="submit" name="btnsearch" class="button">搜 索</button>
		<span class="hot">（下方允许多个关键字，用英文空格分隔）</span>
		<textarea class="textarea" name="keyword" style="width:80%;height:3em;">{?$_request['keyword']?}</textarea>
    </td>
    </tr>
</table>
</form>
<form action="{?$url_batchaction?}" method="post" name="checkform" id="checkform">
<table class="grid" width="100%" align="center">
<caption>小说共享</caption>
  <tr align="center">
    <th width="4%">&nbsp;</th>
    <th width="18%">小说名称</th>
    <th width="24%">最新章节</th>
    <th width="8%">作者</th>
    <th width="6%">字数</th>
    <th width="16%">入库=&gt;更新</th>
	<th width="8%">状态</th>
    <th width="16%">操作</th>
  </tr>
  <tbody id="jieqi_page_contents">
  {?section name=i loop=$articlerows?}
  <tr>
    <td align="center"><input type="checkbox" id="checkid[]" name="checkid[]" value="{?$articlerows[i].articleid?}"></td>
    <td><a href="{?function jieqi_geturl:'article':'article':$articlerows[i].articleid:'info':$articlerows[i].articlecode?}" target="_blank">{?$articlerows[i].articlename?}</a>{?if $articlerows[i].isvip_n > 0?}<span class="hot">vip</span>{?/if?}</td>
    <td>{?if $articlerows[i].vipchapterid > 0?}<a href="{?$articlerows[i].url_vipchapter?}" target="_blank">{?$articlerows[i].vipvolume?} {?$articlerows[i].vipchapter?}</a><span class="hot">vip</span>{?else?}<a href="{?$articlerows[i].url_lastchapter?}" target="_blank">{?$articlerows[i].lastvolume?} {?$articlerows[i].lastchapter?}</a>{?/if?}</td>
    <td>{?if $articlerows[i].authorid == 0?}{?$articlerows[i].author?}{?else?}<a href="{?$jieqi_modules['article']['url']?}/authorpage.php?id={?$articlerows[i].authorid?}" target="_blank">{?$articlerows[i].author?}</a>{?/if?}</td>
    <td>{?$articlerows[i].words?}</td>
    <td align="center">{?$articlerows[i].postdate|date:'Y-m-d'?}=&gt;{?$articlerows[i].lastupdate|date:'Y-m-d'?}</td>
	<td align="center">{?if $articlerows[i].isvip_n == 0?}免费{?else?}VIP{?/if?}</td>
    <td align="center">
	{?if $articlerows[i].isshare_n == 0?}
	<a id="act_share_{?$articlerows[i].articleid?}" href="javascript:;" onclick="act_share('{?$article_dynamic_url?}/admin/articleshare.php?id={?$articlerows[i].articleid?}&act=share{?$jieqi_token_url?}');" switch="0">设为共享</a> 
	{?else?}
	<a class="hot" id="act_oneself_{?$articlerows[i].articleid?}" href="javascript:;" onclick="act_share('{?$article_dynamic_url?}/admin/articleshare.php?id={?$articlerows[i].articleid?}&act=oneself{?$jieqi_token_url?}');" switch="1">取消共享</a> 
	{?/if?}
	</td>
  </tr>
  {?/section?}
  </tbody>
  <tr>
    <td align="center"><input type="checkbox" id="checkall" name="checkall" value="checkall" onclick="for (var i=0;i<this.form.elements.length;i++){ if (this.form.elements[i].name != 'checkkall') this.form.elements[i].checked = this.form.checkall.checked; }"></td>
    <td colspan="6" align="left">
	<input name="act" type="hidden" value="share">{?$jieqi_token_input?}
	<input name="url_jump" type="hidden" value="{?$url_jump?}">
	<button type="button" name="batchshare" class="button" onclick="if(confirm('确实要共享选中记录么？')){ this.form.act.value='share'; this.form.submit();}">批量设为共享</button> &nbsp;
	<button type="button" name="batchoneself" class="button" onclick="if(confirm('确实要将选中记录取消共享么？')){ this.form.act.value='oneself'; this.form.submit();}">批量取消共享</button> &nbsp;
	</td>
  </tr>
</table>
</form>
<div class="pages">{?$url_jumppage?}</div>