{template 'header', $module}
<div class="menu">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tab" id="action_renew"><a href="?action=renew"><span>{VIP}续费</span></a></td>
<td class="tab" id="action"><a href="?action=index"><span>{VIP}信息</span></a></td>
</tr>
</table>
</div>
{if $action == 'renew'}
<form method="post" action="?" onsubmit="return check();">
<input type="hidden" name="action" value="{$action}"/>
<table cellspacing="1" cellpadding="10" class="tb">
<tr>
<td class="tl">到期时间</td>
<td class="tr">{$todate}</td>
</tr>
<tr>
<td class="tl">剩余时间</td>
<td class="tr">{$havedays} 天</td>
</tr>
<tr>
<td class="tl">服务费用</td>
<td class="tr"><span class="f_red">{$MG[fee]}</span> {$DT[money_unit]}/年</td>
</tr>
<tr>
<td class="tl"><span class="f_red">*</span> 续费年限</td>
<td class="tr">
<select name="year" id="year" onchange="$('#payment').html(this.value*{$MG[fee]});">
<option value="1"<?php if($year == 1) echo ' selected';?>>1年</option>
<option value="2"<?php if($year == 2) echo ' selected';?>>2年</option>
<option value="3"<?php if($year == 3) echo ' selected';?>>3年</option>
</select>
</td>
</tr>
<tr>
<td class="tl">账户余额</td>
<td class="tr"><span class="f_blue">{$_money}</span> {$DT[money_unit]}</td>
</tr>
<tr>
<td class="tl">应付总额</td>
<td class="tr"><span class="f_red f_b" id="payment">{$fee}</span> {$DT[money_unit]}</td>
</tr>
<tr id="payword" style="display:none;">
<td class="tl"><span class="f_red">*</span> 支付密码</td>
<td class="tr">{template 'password', 'chip'} <span id="dpassword" class="f_red"></span></td>
</tr>
<tr>
<td class="tl"> </td>
<td class="tr" height="50"><input type="submit" name="submit" value=" 续 费 " class="btn_g"/></td>
</tr>
</table>
</form>
<script type="text/javascript">
function check() {
	if($('#year').val()*{$MG[fee]} > {$_money}) {
		Go('charge.php?action=pay&reason=vip|'+$('#year').val()+'&amount='+($('#payment').html() - {$_money}));
		return false;
	}
	var f,l;
	f = 'password';
	l = Dd(f).value.length;
	if(l < 6) {
		Dmsg('请填写支付密码', f);
		return false;
	}
	return true;
}
window.setInterval(
	function() {
		$('#year').val()*{$MG[fee]} > {$_money} ? Dh('payword') : Ds('payword');
	}, 
500);
</script>
<script type="text/javascript">m('action_renew');</script>
{else}
<script type="text/javascript">m('action');</script>
<table cellspacing="1" cellpadding="10" class="tb">
<tr>
<td class="tl">会员级别</td>
<td class="tr">{$MG[groupname]}</td>
</tr>
<tr>
<td class="tl">{VIP}级别</td>
<td class="tr"><img src="{DT_SKIN}image/vip_{$MG[vip]}.gif" alt="{VIP}" title="{VIP}:{$vip}级"/></td>
</tr>
<tr>
<td class="tl">服务开始</td>
<td class="tr">{$fromdate}</td>
</tr>
<tr>
<td class="tl">服务结束</td>
<td class="tr">{$todate}</td>
</tr>
<tr>
<td class="tl">剩余天数</td>
<td class="tr">{$havedays}</td>
</tr>
</table>
{/if}
{template 'footer', $module}