<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<title>{$seo['title']}</title>
<meta name="Keywords" content="{$seo['keywords']}">
<meta name="Description" content="{$seo['description']}">
<link href="templates/{$CFG[tplname]}/style/user.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/validator/validator.min.js"></script>
<link href="js/validator/validator.css" type="text/css" rel="stylesheet" />
</head>
<body>
<!--{template header}-->
<div class="wrapper">
	<!-- 主体 -->
    <!--{template member_left_com}-->
    <div class="col_main">
<form action="member.php?act=buysend" method="post" name=form>
	   <!--{template member_topmenu}-->
		<div class="post_li">
          <ul>
            <li><h3>增值项目</h3>
              <label for="shoptype"></label>
              <select name="shoptype" id="shoptype" class="inputs" onchange="changeValue()">
                <option value="1">积分</option>
              </select>
            </li>
            <li><h3>数量</h3><input name="amount" id="amount" type="text" size="10" class="inputs" value="{$amount}" onKeyUp="changeValue()" /></li>
            <li><h3>支付方式</h3><select name="paycenter" class="inputs" />
			{loop $payonline_setting $paycenter $pay}
             <option value="{$pay[paycenter]}" {$selected[$paycenter]}>{$pay[name]}</option>
            {/loop}
			</select>
			</li>
            <li><h3>价格</h3><strong class="f14 fe43" id="siso"></strong></li>
		    <li><h3>&nbsp;</h3><input type="submit" name="submit" class="btn_1" value="购买" id="submit" />
		    </li>
          </ul>
        </div>　
	</form>
    <!--{template member_right}-->
    </div>
	<!-- 主体 结束 -->
    </div>
<!--{template footer}-->
<script>
         var input1pre;
         function changeValue() {
             var val1 = document.getElementById('amount').value;
			 var val2 = document.getElementById('siso').innerText;
			 var val3 = document.getElementById('shoptype').options[document.getElementById('shoptype').selectedIndex].value
             if(typeof input1pre != 'undefined') {
                 val2 = val2.substring(0, val2.lastIndexOf(input1pre));
             }
			 if(document.getElementById('shoptype').options[document.getElementById('shoptype').selectedIndex].value==1){
			    document.getElementById('siso').innerText = '￥'+(val1*{$CFG['creditnum']}).toFixed(1);
			 }else if(document.getElementById('shoptype').options[document.getElementById('shoptype').selectedIndex].value=='2'){
				document.getElementById('siso').innerText = '￥'+(val1*{$CFG['smsnum']}).toFixed(1); 
			 }
		 }
</script>
<script type="text/javascript">
$.validator("amount")
.setFocusMsg("请填写要购买数量(整数)")
.setRequired("请填写要购买数量(整数)")
.setRegexp(/^\d+(?=\{0,1}\d+$|$)/, "数量错误", false)
.setServerCharset("UTF-8")
.setStrlenType("symbol");
</script>
</body>
</html>
