<!--if($vd['table']==0){-->
{load(head)}
<style type="text/css">
.tab_normal {
	width:130px;cursor:pointer;height:29px;BACKGROUND: #f0f0f0; MARGIN-LEFT: 4px; VERTICAL-ALIGN: middle; border:1px #ccc solid; BORDER-BOTTOM: #ccc 1px solid; POSITION: relative; TOP: 1px
}
.tab_active {
	width:130px;cursor:pointer;height:29px;FONT-WEIGHT: bold; BACKGROUND: #f5fbff; MARGIN-LEFT: 4px; VERTICAL-ALIGN: middle; border:1px #ccc solid;BORDER-BOTTOM: #f0f0f0 1px solid; POSITION: relative; TOP: 1px
}

#thead td{BORDER-right:1px solid #D6D6D6;BORDER-bottom:1px solid #D6D6D6;BORDER-top:1px solid #D6D6D6;height:30px;font-weight:bold}
</style>
<body>
<!--$isb2c=intval(request('b2c'))-->
<div class="titleDiv" id="titleList">
<div style="float:left"><a href="index.php?a=Home"><img src="{$vd['sc']}images/home.png" style="vertical-align:middle" border="0"/></a></div><div style="float:left;padding-top:8px;padding-left:3px;"><a href="index.php?a=Home" title="回到后台首页"><font color="#000">桌面</font></a> <span style="font-size:7px;">>></span> 
  级别列表
  <strong onmouseover="showhide(this);" onmouseout="showhide(this);" style="cursor:pointer">[?]</strong><p style="display:none">
      1、排列顺序：在列表中，从下到下，是低级别到高级别的顺序，编号只是一个代号，不需要关心他的大小<br/>
      2、组别从低到高(会员->直销商->经销商)<br/>
      3、如果含一卡通或者零售平台，请务必在会员组中勾选一个默认级别<br/>
      4、如果含批发平台，请务必在直销商组以上的级别中勾选一个默认级别<br/>
      5、<font color="#ff0000">提醒：</font>
      低级别的升级消费额一定要小于高级别的升级消费额，以免出现意想不到的错误<br/>
    </p> 
</div>
<div style="float:right"><a href="javascript:toHelper()" onFocus="this.blur()" title="查看级别相关帮助"><img src="{$vd['sc']}images/help.gif" style="vertical-align:middle" border="0"/></a></div>
</div>
<div id="contentTip" style="display:none;"></div>
<div class="mytitle" id="mytitle" style="width:95%">
	<div style="float:right">
		<div style="margin-top:6px;margin-right:100px">
		<button class="<!--if($isb2c==1){-->tab_normal<!--}else{-->tab_active<!--}-->" onclick="loadDisp(1);window.location.href='?m=mod_b2b&c=Rank'">批发用户级别</button>
    <!--if(UB_B2C||UB_YKT){--><button class="<!--if($isb2c==1){-->tab_active<!--}else{-->tab_normal<!--}-->" onclick="loadDisp(1);window.location.href='?m=mod_b2b&c=Rank&b2c=1'">{$vd['tagname']}级别</button><!--}-->
    </div>
  </div>
  <div class="titleOp4"  onmouseover="if(editRealtime) return;this.className='iconbg4'" onmouseout="if(editRealtime) return;this.className='titleOp4'" onclick="batchEdit(this)"><samp title="批量修改所选项的记录">
    <div style="padding-top:10px;padding-left:9px;">实时修改</div></samp>
  </div>
  <div class="titleOp2" onmouseover="this.className='iconbg2'" onmouseout="this.className='titleOp2'" onclick="tableRefresh()"><samp title="点击刷新本页刷新数据,并保持原来勾选状态">
    <div style="padding-top:10px;padding-left:9px;">刷新</div></samp>
  </div>
  <div class="titleOp4" onmouseover="this.className='iconbg4'" onmouseout="this.className='titleOp4'" onclick="disp('adddiv')"><samp title="点击刷新本页刷新数据,并保持原来勾选状态">
    <div class="addicon" style="padding-top:10px;padding-left:26px;">添加</div></samp>
  </div>  
  <div class="titleOp4"  onmouseover="this.className='iconbg4'" onmouseout="this.className='titleOp4'" onclick="disp('adddivguize')"><samp title="级别规则">
    <div style="padding-top:10px;padding-left:10px;">级别规则</div></samp>
  </div>
</div>

<div id="adddiv" style="position:absolute;top:60px;left:50px;;width:320px;display:none">
  <div style="padding:20px;background:#F1F5FA;border:5px #75BCD7 solid">
  <div style="font-size:14px;font-weight:bold;padding:5px;float:left">给<font color="#ff0000"><!--if($isb2c==0){-->批发平台<!--}else{-->{$vd['tagname']}平台<!--}--></font>添加用户级别</div>
  <div style="float:right;"><img src="{$vd['sc']}images/destroy.gif" onclick="disp('adddiv')" style="cursor:pointer"/></div>
  <form name="form1" method="post" action="index.php?m=mod_b2b&c=Rank&a=Save" id="cform">
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
      <td width="35%">级别名称</td>
      <td width="65%"><input type="text" name="name" size="16"/></td>
    </tr>
    <tr>
      <td width="35%">升级消费额</td>
      <td width="65%"><input type="text" name="money" size="16"/></td>
    </tr>
    <tr<!--if(!UB_B2B){--> style="display:none"<!--}-->>
      <td width="35%">组别</td>
      <td width="65%">
        <select name="gid">
        {#Option($vd['group'], 0, 'gname', 'gid')}
        </select>
      </td>
    </tr>
    <tr>
      <td width="35%">默认注册级别</td>
      <td width="65%"><input type="checkbox"  name="isdefault" value="1" class="checkbox" onFocus="this.blur()"/></td>
    </tr>
    <tr>
      <td width="35%"></td>
      <td width="65%">
        <input type="hidden" name="discount" size="10" value="0.05"/>
        <input type="submit" name="Submit" value="添 加" class="button">
        <input type="button" name="Submit" value="取 消" onclick="disp('adddiv')" class="button"/>
      </td>
    </tr>
  </table>
  </form>
  </div>
</div>

<div id="adddivguize" style="position:absolute;top:60px;left:50px;;width:320px;display:none">
  <div style="padding:20px;background:#F1F5FA;border:5px #75BCD7 solid">
  <div style="font-size:14px;font-weight:bold;padding:5px;float:left">级别规则[<a href="?m=mod_b2b&c=Sys&a=Config#guize">点击设置规则</a>]</div>
  <div style="float:right;"><img src="{$vd['sc']}images/destroy.gif" onclick="disp('adddivguize')" style="cursor:pointer"/></div>
  <form name="form1" method="post" action="index.php?m=mod_b2b&c=Rank&a=Save" id="cform">
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
      <td style="font-size:12px">
      	规范型：<br/>
      	同一个组别的经销商不能互为上下级，比如一级经销商和二级经销商同属于经销商组别，则他们不能互为上下级<br/><br/>
      	松散型：<br/>
      	同一个组别的经销商也可以为上下级，规则是只要这个级别的升级消费金额足够大，他就可以接收比他小的级别，直销商除外(也就是说直销商不能收下级)<br/>
      	
      </td>
    </tr>
  </table>
  </form>
  </div>
</div>

<div id="menuMask" class="menuMask" style="display:none">
  <form action="?m=mod_b2b&c=Tpl&tpl=Sup&v=Sup" method="post" style="margin:0px">
  <div class="menuContent">
  <input type="checkbox" name="id[]" value="tordering" id="tordering"/> 商品名称<br/>
  <input type="checkbox" name="id[]" value="tpics" id="tpics"/> 供货商<br/>
  <input type="checkbox" name="id[]" value="tname" id="tname"/> 进货审核<br/>
  <input type="checkbox" name="id[]" value="tabst" id="tabst"/> 进货优先级<br/>
  <input type="checkbox" name="id[]" value="tfee" id="tfee"/> 进货价<br/>
  <input type="checkbox" name="id[]" value="tcode" id="tcode"/> 最低售价<br/>
  </div>
  <div class="menuOp">
  <input type="submit" value="保存" class="button" disabled />
  <input type="button" value="重置" class="button" disabled onclick="tInfoReset()"/>
  <input type="button" value="取消" class="button" onclick="setMenuMask()"/>
  </div>
  </form>
</div>

<table id="thead" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="30px">
      <input name="chkall" id="chkall" type="checkbox" class="checkbox" onclick="CheckAll(this)" onFocus='this.blur()' disabled /></td>
<!--//thead-->
    <!--if($vd['isselect'] == 1){-->
      <td width="35px"><b>选择</b></td>
    <!--}-->
    <td width="35px"><b>编号</b></td>
    <td width="130px"><span class="canedit">级别名称</span></td>
    <td width="100px"><span class="canedit">升级消费额</span></td>
    <!--if(UB_B2B){-->
    <td width="67px"><span class="canedit">组别</span></td>
    <!--}-->
    <td width="100px"><span class="canedit">默认注册级别</span></td>
    <td width="22px"><img src="{$vd['sc']}images/icon_trash.gif"/></td>
<!--//endthead-->
    <td class="endtd">
      <div class="infoicon" style="color:#ccc"><b><u>>></u></b></div>
    </td>
  </tr>
</table>
<div id="tip" style="display:none">
  <span id="tiptable">此页中所有 <b><span id="ncheck"><!--echo $vd['nrows'] < $vd['totlerow'] ? $vd['nrows'] : $vd['totlerow']--></span></b> 条记录已选中 </span> 
  <span id="tipspan">
    <a href="javascript:CheckTotle({$vd['totlerow']},0)">点此选择当前列表中所有 <b>{$vd['totlerow']}</b> 条记录>></a>
  </span>
</div>
<div id="content">
<!--}-->
  <!--if($vd['totlerow'] == 0) {-->
  <table  width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="right" colspan="20">无任何记录</td>
  </tr>
  </table>
  <!--}-->
  <table id="tbody"  border="0" cellspacing="0" cellpadding="0">
  <!--$isb2c=intval(request('b2c'))-->
  <!--foreach($vd['items'] as $item) {-->
  <!--if(($isb2c==1 && $item['gid']==0) || ($isb2c==0 && $item['gid'] > 0)){-->
  <tr>
    <td width="30px">
      <input type="checkbox" name="id[]" id="idchk_{$item['id']}" class="checkbox" value="{$item['id']}" onclick="CheckThis(this)" onFocus='this.blur()'  disabled ></input>
    </td>
    <!--//tbody-->
    <!--if($vd['isselect'] == 1){-->
      <td width="35px">
      <input type="checkbox" class="checkbox" onclick="setDialog('{$item['gid']}|{$item['name']}')" onFocus="this.blur()"/>
      </td>
    <!--}-->
    <td width="35px">{$item['id']}</td>
    <td width="130px"><span onclick="toInput(this,{$item['id']},'name')">{$item['name']}</span></td>
    <td width="100px"><span onclick="toInput(this,{$item['id']},'money')">{$item['money']}</span></td>
    <!--if(UB_B2B){-->
    <td width="67px">
      <select name="gid" onchange="toSelect(this, {$item['id']}, 'gid')">
        {#Option($vd['group'], $item['gid'], 'gname', 'gid')}
      </select>
    </td>
    <!--}-->
    <td width="100px"><img src="{$vd['sc']}{#ToggleImgSrc($item['isdefault'])}" onclick="toToggle(this,{$item['id']},'isdefault')" alt="点击此图片即可修改状态" onFocus="this.blur()" class="mousehand"/></td>
    <td width="22px">
      <img src="{$vd['sc']}images/icon_trash.gif" onclick="delSubmit({$item['id']},'delitems')" alt="如果删除了这个级别，级别对应的价格也会删除，对应级别的用户会下降一级，您确定进行删除操作吗？" class="mousehand"/>
    </td>
    <!--//endtbody-->
    <td class="endtd"></td>
  </tr>
  <!--}}-->
  
</table>
<input type="hidden" value="{$vd['totlepage']}" id="totlePage"/>
<input type="hidden" value="{$vd['thispage']}" id="thisPage"/>
<!--if($vd['table']==0){-->
</div>

<input type="hidden" value="index.php?m=mod_b2b&c=rank&a=Deals&b2c={$isb2c}&{$vd['op']}" id="op"/>
<input type="hidden" value="index.php?m=mod_b2b&c=rank&a=index&b2c={$isb2c}&istable=1&{$vd['op']}" id="url"/>
<input type="hidden" value="{$vd['op']}" id="params"/>
<div style="position:absolute;bottom:0px">
  <div class="tbBottom" id="tbBottom">
    <div style="float:left;padding-top:8px;">
      <strong> 总计 <font color="#ff0000"><span id="tol2">{$vd['totlerow']}</span></font> 条</strong>  
    </div>
    <div style="float:right;text-align:right;">
    <form id="actionform" method="post" action="index.php?m=mod_b2b&c=rank&a=index&b2c={$isb2c}&{$vd['op']}" style="margin:0px;" onsubmit="loadDisp(1)">
    <div id="page"></div>
    <div style="float:left;margin-top:3px">
      每页显示<input type="text" name="nrows" size="2" value="{$vd['nrows']}" class="pagetxt" onMouseOver="iEvent('mouseover',this)" onFocus="iEvent('focus',this)" onBlur="iEvent('blur',this)" onMouseOut="iEvent('mouseout',this)" /> 个 
      到第<input type="text" name="page" size="2" value="{$vd['thispage']}" class="pagetxt" onMouseOver="iEvent('mouseover',this)" onFocus="iEvent('focus',this)" onBlur="iEvent('blur',this)" onMouseOut="iEvent('mouseout',this)" />页<input type="submit" value=" 确 定 &gt;&gt;" class="pagesub" />
    </div>
    </form>
    </div>
  </div>
</div>
<div id="load" style="display:none;">
  <div id="loadcontent" >页面加载中请稍等...</div>
</div>
</body>
<script type="text/javascript">
//第一参数，后边保留显示的列数
//第二参数，除最后一个参数外的保留参数的总宽度
tRows   = <!--echo $vd['nrows'] < $vd['totlerow'] ? $vd['nrows'] : $vd['totlerow']-->;
tInfoA  = Array(0,0);
totleRows = {$vd['totlerow']};
deltxt  = "如果删除了这个级别，级别对应的价格也会删除，对应级别的用户会下降一级，您确定进行删除操作吗？";
thisaction = "删除";
thisdel = 0;
statistics = 0;
var resizeidx = 2;
var helperVal = 1;
</script>
<script type="text/javascript">
//当前表格配置
<!--//tinfo-->
 tInfo = Array();
<!--//endtinfo-->
</script>
<script src="{$vd['sc']}js/tools.js" type="text/javascript"></script>
<script type="text/javascript">
function setct(val)
{
  $("cttr").style.display = val == 3 ? "" : "none";
}

function loadst()
{
  if(!confirm('获取供货商的调价商品并按照下边模板调价？'))
  {
    return;
  }
  
  setLoad("正在调价中,请稍后...");
  loadDisp(1);
  
  window.location.href = "index.php?m=mod_b2b&c=Price&a=PriceSaveBySup";
  
}
</script>
</html>
<!--}-->