{?set jieqi_blocks_module = "system"?}
{?set jieqi_blocks_config = "userblocks"?}
{?set jieqi_page_rows = "30"?}
{?set $jieqi_pagetitle = "我的订阅-{$jieqi_sitename}"?}

{?block bid="0" blockname="会员工具" module="system" filename="" classname="BlockSystemCustom" side="-1" title="" vars="" template="block_userbox_tab.html" contenttype="4" custom="1" publish="3" hasvars="0"?}

<script type="text/javascript">
//自动订阅
function act_autobuy(url){
	var o = getTarget();
	var param = {
		method: 'POST', 
		onFinish: ''
	}
	if(o.getAttribute('switch') == '0'){
		url = url.replace('act=unsetautobuy', 'act=setautobuy');
		param.onFinish = function(res){
			if(res.match('成功')){
				o.setAttribute('switch', '1');
				o.innerHTML = '取消自动订阅';
			}
		}
	}else{
		url = url.replace('act=setautobuy', 'act=unsetautobuy');
		param.onFinish = function(res){
			if(res.match('成功')){
				o.setAttribute('switch', '0');
				o.innerHTML = '设为自动订阅';
			}
		}
	}
	Ajax.Tip(url, param);
	return false;
}
</script>
<table class="grid" width="100%" align="center">
<caption>我的订阅</caption>
  <tr align="center">
    <th width="20%">书名</th>
	<th width="18%">最近更新</th>
	<th width="18%">最后购买</th>
    <th width="18%">已订阅/总章节</th>
	<th width="26%">操作</th>
  </tr>
  <tbody id="jieqi_page_contents">
  {?section name=i loop=$obuyrows?}
  <tr>
    <td><a href="{?function jieqi_geturl:'article':'article':$obuyrows[i].articleid:'index'?}" target="_blank">{?$obuyrows[i].obookname?}</a></td>
	<td align="center">{?if $obuyrows[i].lastupdate > $obuyrows[i].buytime?}<span class="hot">{?$obuyrows[i].lastupdate|date:"Y-m-d H:i"?}</span>{?else?}{?$obuyrows[i].lastupdate|date:"Y-m-d H:i"?}{?/if?}</td>
	<td align="center">{?$obuyrows[i].buytime|date:"Y-m-d H:i"?}</td>
    <td align="center">{?if $obuyrows[i].isfull > 0?}<span class="hot">整本订阅</span>{?else?}{?$obuyrows[i].chapternum?}/{?$obuyrows[i].chapters?}{?/if?}</td>
	<td align="center">
	<a href="{?$obook_dynamic_url?}/buylog.php?oid={?$obuyrows[i].obookid?}">订阅记录</a>
	{?if $obuyrows[i].isfull == 0?}
	{?if $obuyrows[i].autobuy > 0?}
	| <a id="act_unsetautobuy_{?$obuyrows[i].obuyid?}" href="javascript:;" onclick="act_autobuy('{?$obook_dynamic_url?}/buylist.php?obuyid={?$obuyrows[i].obuyid?}&page={?$jieqi_page_nowpage?}&act=unsetautobuy{?$jieqi_token_url?}');" switch="1" title="自动订阅表示点击一个未订阅VIP章节阅读时，系统不提示购买，自动订阅并显示阅读页面">取消自动订阅</a>
	{?else?}
	| <a id="act_setautobuy_{?$obuyrows[i].obuyid?}" href="javascript:;" onclick="act_autobuy('{?$obook_dynamic_url?}/buylist.php?obuyid={?$obuyrows[i].obuyid?}&page={?$jieqi_page_nowpage?}&act=setautobuy{?$jieqi_token_url?}');" switch="0" title="自动订阅表示点击一个未订阅VIP章节阅读时，系统不提示购买，自动订阅并显示阅读页面">设为自动订阅</a>
	{?/if?}
	{?/if?}
	</td>
  </tr>
  {?/section?}
  </tbody>
</table>
<div class="pages">{?$url_jumppage?}</div>

