<!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 src="js/common.js"></script>
</head>
<body>
<!--{template header}-->
<div class="wrapper">
	<!-- 主体 -->
    <!--{template member_left_com}-->
	<div class="col_main">
	 <!--{template member_topmenu}-->
     <div class="post_li f14">
  <form name="post" method="post" action="member.php?act=saleedit" enctype="multipart/form-data">
      <ul>  
        <li><h3 class="f3f">首单消费</h3>立减 <input name="sojian" type="text" id="sojian" size="5" class="inputs" value="{$cominfo['zk_sojian']}" /> 元</li>
        {if ($cominfo['zk_list_count']<1)}
        <li id="adds">
        <h3 class="f3f">持卡折扣1</h3>消费 >= <input name="money1" type="text" id="money1" size="5" class="inputs" /> 元，享受 <select name="zkl1" id="zkl1" style="padding:8px 10px;border:1px solid #e1e1e1;border-radius:4px;font-size:14px">
					    <option value="0">0</option>
					    <option value="1">1</option>
					    <option value="2">2</option>
					    <option value="3">3</option>
					    <option value="4">4</option>
					    <option value="5">5</option>
					    <option value="6">6</option>
					    <option value="7">7</option>
					    <option value="8">8</option>
					    <option value="9">9</option>
                      </select>
					  <select name="zkr1" id="zkr1" style="padding:8px 10px;border:1px solid #e1e1e1;border-radius:4px;font-size:14px">
					    <option value="0">0</option>
					    <option value="1">1</option>
					    <option value="2">2</option>
					    <option value="3">3</option>
					    <option value="4">4</option>
					    <option value="5">5</option>
					    <option value="6">6</option>
					    <option value="7">7</option>
					    <option value="8">8</option>
					    <option value="9">9</option>
				      </select> 折优惠
        </li>
        {else}
        {php $i=1}
        {loop $zk_list $val}
        <li id="{if ($i==$cominfo['zk_list_count'])}adds{else}div_{$i}{/if}">
        <h3 class="f3f">持卡折扣{$i}</h3>消费 >= <input name="money{$i}" type="text" id="money{$i}" size="5" class="inputs" value="{$val[0]}" /> 元，享受 <select name="zkl{$i}" id="zkl{$i}" style="padding:8px 10px;border:1px solid #e1e1e1;border-radius:4px;font-size:14px">
					    {php for($i1=0;$i1<10;$i1++){}
                        <option value="{$i1}"{if (substr($val[1], 0, 1))==$i1} selected='selected'{/if}>{$i1}</option>
                        {php }}
                      </select>
					  <select name="zkr{$i}" id="zkr{$i}" style="padding:8px 10px;border:1px solid #e1e1e1;border-radius:4px;font-size:14px">
					    {php for($i2=0;$i2<10;$i2++){}
                        <option value="{$i2}"{if (substr($val[1],-1))==$i2} selected='selected'{/if}>{$i2}</option>
					    {php }}
				      </select> 折优惠
        </li>
        {php $i++}
        {/loop}
        {/if}
    <li class="t_c"><div class="clearfix h_15"></div>
<input type=hidden name=id value={$cominfo['comid']}>
<input type="button" id="add" value="增加" class="btn_1" />&nbsp;
<input type="submit" class="btn_1" name="submit" value="保存折扣设置" id="submit" />
    </li>
   </ul>
</form>
      </div>
        <!--{template member_right}-->　
    </div>
    </div>
	<!--{template footer}-->
<script language="javascript">
{if ($cominfo['zk_list_count']<1)}
i = 2;
{else}
i = {floor($cominfo['zk_list_count']+1)};
{/if}
document.getElementById("add").onclick=function(){
if(i<={$CFG['max_zklist']}){
document.getElementById("adds").innerHTML+='<li id="div_'+i+'"><h3 class="f3f">持卡折扣'+i+'</h3>消费 >= <input name="money'+i+'" type="text" value="" class="inputs" size="5" /> 元，享受 <select name="zkl'+i+'" id="zkl'+i+'" style="padding:8px 10px;border:1px solid #e1e1e1;border-radius:4px;font-size:14px"><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option></select> <select name="zkr'+i+'" id="zkr'+i+'" style="padding:8px 10px;border:1px solid #e1e1e1;border-radius:4px;font-size:14px"><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option></select> 折优惠&nbsp;<input type="button" value="X" onclick="del('+i+')"/></li>';
i++;
}else{
	alert('折扣套餐不能在添加了~~');
    return false;
}
}
function del(o){
 document.getElementById("adds").removeChild(document.getElementById("div_"+o));
}
</script>
</body>
</html>
