<header class="uc_head">
	<h3 class="current">个人积分</h3>
	<form action='{url:/ucenter/integral}' method='post' name='point_history'>
		<div class="select">
			<select name='history_time'>
				<option value="3">3个月之外积分记录</option>
				<option value="default" selected=selected>近3个月之内积分记录</option>
			</select>
			<input class="input_sbtn" type="submit" value="查询" />
		</div>
	</form>
	<span class="money">您当前的积分：<em>{$this->memberRow['point']}</em> 分</span>
</header>
{set:$queryPointLog = Api::run('getUcenterPointLog',$this->user['user_id'],$this->c_datetime)}
{set:$queryPoint = $queryPointLog->find()}
{if:$queryPoint}
<section class="uc_table">
	<table>
		<thead>
			<tr>
				<th>积分日期</th>
				<th>积分</th>
				<th>说明</th>
			</tr>
		</thead>
		<tbody>
			{foreach:items = $queryPoint}
			<tr>
				<td>{$item['datetime']}</td>
				<td>{$item['value']}分</td>
				<td><span class="blue">{$item['intro']}</span></td>
			</tr>
			{/foreach}
		</tbody>
	</table>
</section>
{else:}
<section class="nodata">暂无数据</section>
{/if}
{$queryPointLog->getPageBar()}
<header class="uc_head">
	<h3 class="current">积分兑换</h3>
</header>
<section class="user_form">
	<form action='{url:/ucenter/trade_ticket}' method='post'>
		{set:$nowtime = ITime::getDateTime();$isHasTicket = false;}
		{foreach:items=Api::run('getTicketList',array('#nowtime#',$nowtime),20)}
		{set:$isHasTicket = true;}
		<dl>
			<dt></dt>
			<dd><b class="gray"><label class='attr'><input class="radio" type="radio" name='ticket_id' value="{$item['id']}" />{$item['name']}：{$item['value']}元（需要{$item['point']}积分）</b>
				<span>有效日期：{$item['start_time']}至{$item['end_time']}</span>
				</label>
			</dd>
		</dl>
		{/foreach}
		{if:$isHasTicket == false}
		<dl>
			<dt></dt>
			<dd>
				<label>暂无代金券</label>
			</dd>
		</dl>
		{/if}
		<dl>
			<dt></dt>
			<dd>
				<input class="input_submit" type="submit" value="兑换代金券" />
			</dd>
		</dl>
	</form>
</section>
<div class="prompt">
	<p><strong>提示：</strong></p>
	<p class="indent">1、您兑换的代金券为电子券，根据代金券的不同，会具有不同的有效期</p>
	<p class="indent">2、电子代金券仅限本ID使用，不能折算为现金、也不能再次兑换为积分</p>
</div>
<script>
var FromObj = new Form('point_history');
FromObj.init({
	'history_time': '{$this->historyTime}'
});
</script>
