<!--{assign var='menuid' value=''}-->
<!--{assign var='usercpmod' value='yes'}-->
<!--{include file="<!--{$tplpath}-->cp/<!--{$tplpre}-->block_head.tpl"}-->
<body>
<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_menu_cp.tpl"}-->

<div id="page-index" class="page">
  <div class="zx">

	<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_search.tpl"}-->
	<!--{include file="<!--{$tplpath}-->cp/<!--{$tplpre}-->block_menu.tpl"}-->

    <div class="zright">
      <div class="topmenu"> 
	    <a href="<!--{$ucfile}-->?c=vip">购买服务</a>
		<a href="<!--{$ucfile}-->?c=payment" class='now'>在线充值</a>
		<a href="<!--{$ucfile}-->?c=buysms">购买短信</a>
	  </div>
      <div class="tb1 hy">

        <div class="htitle">
		  您当前所在会员组：<!--{$u.levelimg}--> <b><!--{$g.groupname}--></b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--{if $g.groupid>1}-->（有效期到 <!--{$u.vipenddate_t}-->）<!--{/if}-->
			&nbsp;&nbsp;剩余可用<!--{$lang.money}-->：<b><font color='green'><!--{$u.money}--></font></b>
		</div>
		  
		  <!--{if $a eq 'run'}-->
		  <form name="pay_form" id="pay_form" action="<!--{$urlpath}-->index.php?c=payment" method="post" onsubmit="" target="_blank">
		  <input type='hidden' name='userid' id='userid' value="<!--{$u.userid}-->" />
		  <table cellpadding='5' cellspacing='5' border='0' class='tab'>
		    <tr>
			  <td class='hback_b' width='25%'>请选择网上支付方 <span class="f_red">*</span></td>
			  <td>
			  <!--{if !empty($payment)}-->
			  <select name='id' id='id' onchange="tab(this.options[this.options.selectedIndex].value);">
			  <!--{else}-->
			  <select name='id' id='id'>
			  <!--{/if}-->
			  <option value=''>请选择</option>
			  <!--{foreach $payment as $volist}-->
			  <option value="<!--{$volist.mentid}-->"><!--{$volist.mentname}--></option>
			  <!--{/foreach}-->
			  </select>

			  <span id="did" class="f_red"></span>
			  </td>
			</tr>
			<tr>
			  <td class='hback_b'>充值金额 <span class="f_red">*</span></td>
			  <td class="hback"><input type="text" name="quantity" id="quantity" class="input-100" maxlength="8" />元 (在线支付金额必须大于0元)
			  
			  <span id="dquantity" class="f_red"></span>
			  </td>
            </tr>
			<tr>
			  <td class="hback" colspan='2'>温馨提示：（支付后如果浏览器没有自动返回，请手动点击“返回商城取货”来完成最后支付步骤）</td>
            </tr>
			<tr>
			  <td class='hback_none'></td>
			  <td class='hback_none'>
			  <a href="###" class="btn_b2 btn" onclick="return checkform();"><span>确认充值</span></a>		  
			  </td>
			</tr>
		  </table>
		  </form>

          <!--{foreach $payment as $volist}-->
		  <table cellpadding='5' cellspacing='5' border='0' class='tab' name="tabtags" id='detail_<!--{$volist.mentid}-->' style="display:none;">
			<tr>
			  <td class='hback_c1' colspan="2" align="center"><b><!--{$volist.mentname}--></b> </td>
			</tr>
			<tr>
			  <td colspan='2'>
			  <img src="<!--{$volist.logo}-->" /><br />
			  <!--{$volist.intro|nl2br}-->
			  </td>
			</tr>
	      </table>
		  <!--{/foreach}-->

		  <!--{/if}-->

      </div>
    </div>
    <div style="clear:both;"></div>
  </div>
  <div style="clear:both;"></div>
</div>
<!--{include file="<!--{$tplpath}--><!--{$tplpre}-->block_footer.tpl"}-->
</body>
</html>
<script language="javascript">

//显示隐藏
function tab(tabid) {
	var taglength = $("table[name='tabtags']").length;;
	for (i=0; i<taglength; i++){
		$("table[name='tabtags']").eq(i).hide();
	}
	if (tabid > 0) {
		$('#detail_'+tabid).show();
	}
}

//提交
function checkform() {
	var t = '';
	var v = '';

	t = 'id';
	v = $('#'+t).val();
	if(v == '') {
		dmsg('请选择支付方式', t);
		$('#'+t).focus();
		return false;
	}
    
	t = 'quantity';
	v = $('#'+t).val();
	if(v == '') {
		dmsg('请填写充值金额', t);
		$('#'+t).focus();
		return false;
	}
    
	$("#pay_form").submit();
	return true;
}
</script>