<!--{include(pe_tpl('header.html'));}-->
<div class="right">
<div class="title"><h1>在线充值</h1></div>
	<div class="con">
	<div class="h3"></div>
	<table cellspacing="0" cellpadding="0" class="table_form">
	<tr>
		<th width="80">　会 员 名：</th>
		<td>{$user['user_name']}</td>
	</tr>
	<tr>
		<th height="60">充值方式：</th>
		<td><b style="font-size:14px;color:#FF0000;display:block;">支付宝</b>支付宝是国内领先的独立第三方支付平台，由阿里巴巴集团创办。致力于为中国电子商务提供“简单、安全、快速”的在线支付解决方案。立即在线申请</td>
	</tr>
	<form method="post" action="{$action}" id="form">
	<tr>
		<th><font color="#FF0000">*</font>支付账号：</th>
		<td><input type="text" name="email" class="text_200" id="email"/>注：填写支付宝账号</td>
	</tr>
	<tr>
		<th><font color="#FF0000">*</font>充值金额：</th>
		<td><input type="text" id="cash" name="cash" class="text_50" onKeyUp="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')"/>元　最低充值金额<i>{$mincash}</i>元</td>
	</tr>
	<tr>
		<th>充值积分：</th>
		<td><i id="show_point">0</i> 积分；<i>{$mincash}</i>元等于1积分，比如：充值1积分，即需要充值<i>{$mincash}</i>元。</td>
	</tr>
	<tr>
		<th>&nbsp;</th>
		<td><input type="submit" value="提交" class="btn" id="submit"></td>
	</tr>
	</form>
	</table>
	</div>
</div>
<script>
var pa=<?php echo $i['pa'];?>;
var pb=<?php echo $i['pb'];?>;
var mincash=<?php echo $mincash;?>;
$(function(){
	
	$('#submit').click(function(){
		var obj=$('#email');
		if(obj.val()==''){
			alert('支付宝账号不能留空');
			obj.focus();
			return false;
		}
		var obj=$('#cash');
		if(obj.val()<=0){
			alert('请输入一个正确的金额');
			obj.focus();
			return false;
		}
		else if(obj.val()<mincash){
			alert('最低充值金额不小于'+mincash+'元');	
			obj.focus();
			return false;
		}
	});
	$('#cash').blur(function(){
		var v=$(this).val();
		if(v<mincash)alert('最低充值金额不小于'+mincash+'元');
		else{
			var cash=Math.ceil(v*pb/pa);
			$('#show_point').html(cash);
		}
	});
});
</script>
<!--{include(pe_tpl('footer.html'));}-->