<!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" class="loading">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="viewport" content="width=device-width, initial-scale=0.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="keywords" content="" />
<meta name="description" content="">
<meta name="author" content="" />
<link rel="stylesheet" type="text/css" href="public/style/style.css" />
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta content="telephone=no" name="format-detection">
<link rel="apple-touch-icon-precomposed" href="http://www.lede.cc/images/favicon.ico">

<script>
var logined = 0
</script>
<title><?=encode_output($seo['title'])?></title>
</head>

<body>
<?include tpl("header");?>
<form name="post" method="post">
<div id="sort">
  <? if($_POST){ ?>
  <div class="sort_cate">
	<div class="sort_b t_c"><a>微信扫描二维码支付</a><div class="clear"></div></div>
  </div>
  <div class="pd5"></div>
  <div class="pd10 t_c"><img src="../img2code.php?id=<?=$id?>&code=<?=$money?>" /></div>
  <div class="pd10">
  <a href="com.php?act=addma" class="login_submit">返回上页</a>
  </div>
  <? }else{ ?>
  <div class="sort_cate">
	<div class="sort_b t_c"><a>生成订单</a><div class="clear"></div></div>
  </div>
</div>
<div id="list_li">
  <ul>
        <li><h3>消费金额(元)</h3><input name="money" type="text" size="10" id="money" class="inputs fb f43 f18" onKeyUp="changeValue()" value="" /></li>
        <li><h3>享受折扣(折)</h3><input name="zekou" type="text" size="10" id="zekou" value="0" class="inputs fb" disabled="disabled" /></li>
        <li><h3>赠送积分(分)</h3><input name="jifen" type="text" size="10" id="jifen" value="0" class="inputs fb" disabled="disabled" /><? if (strpos($cominfo['jf_day'][0],strval(",".$todays.","))!==false){?>&nbsp;<span class="pad10 f12 f99">[<strong class="fe43"><?=$todays?></strong>]号<?=$CFG['cardname']?>积分优惠日，可享受<strong class="fe43"><?=$cominfo['jf_day'][1]?></strong>倍积分</span><?}?></li>
        <div class="pd5"></div>
<li>持卡会员价 <strong class="f43 f18" id="siso">0</strong>&nbsp;元</li>
        <li>普通会员价 <strong id="sisos">0</strong>&nbsp;元</li>
        <div class="pd5"></div>
  </ul>
  <p>
    <input name="id" type="hidden" id="id" value="<?=$cominfo[comid]?>" />
  <input type="submit" class="login_submit" name="buttonid" value="生成二维码订单" id="buttonid" />
  </p>
  <?}?>
</div>
</form>
</div>

<script>
         var input1pre;
		 var input2pre;
         function changeValue() {
             var val1 = document.getElementById('money').value;
             var val2 = document.getElementById('jifen').value;
			 var val3 = document.getElementById('zekou').value;
			 var val4 = document.getElementById('siso').innerText;
             if(typeof input1pre != 'undefined') {
                 val2 = val2.substring(0, val2.lastIndexOf(input1pre));
             }
			 <? if (!empty($cominfo[jf_bl][0]) && !empty($cominfo[jf_bl][1])){ ?>
			 document.getElementById('jifen').value = ((Math.floor(val1/parseInt(<?=$cominfo[jf_bl][0]?>)))*parseInt(<?=$cominfo[jf_bl][1]?>)).toFixed(0)+'<? if (strpos($cominfo['jf_day'][0],strval(",".$todays.","))!==false){?> × <?=$cominfo['jf_day'][1]?><?}?>';
			 <?}else{?>
			 document.getElementById('jifen').value = 0;
			 <?}?>
			 document.getElementById('sisos').innerText = (val1*1).toFixed(2);
			 if(typeof input2pre != 'undefined') {
                 val3 = val3.substring(0, val3.lastIndexOf(input2pre));
             }
			  <?php
                 foreach((array)$zk_list as $key=>$val){
              ?>	
			   <? if ($val[0]!=0){ ?>
			   <? if ($key==0){ ?>	   
			    if(val1<<?=$val[0]?>){
			     document.getElementById('zekou').value = '0';
			     document.getElementById('siso').innerText = (val1*1).toFixed(2);
			    }
			   <? } ?>
			   if(val1>=<?=$val[0]?>){
			     document.getElementById('zekou').value = (<?=$val[1]?>).toFixed(0);
			     document.getElementById('siso').innerText = ((val1*(parseInt(document.getElementById('zekou').value)/100))).toFixed(2);
			    }
				<?}else{?>
				   document.getElementById('zekou').value = '0';
			       document.getElementById('siso').innerText = (val1*1).toFixed(2);
				<?}?>
			   <?}?>
         }
</script>

	<?include tpl("plus_share");?>
</body>
</html>