<!--if($vd['table'] == 0){-->
{load(head)}
<body>
<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> <span style="font-size:12px;"><a href="index.php?m=mod_b2b&c=Right&{$vd['op']}" title="点击重新获取权限列表资料" onclick="loadDisp(1)"><font color="#000">权限列表</font></a></span> (共 <b><span id="tol1">{$vd['totlerow']}</span></b> 个)</div>
<div style="float:right"><a href="index.php?m=mod_home&a=Help&t=admin_b2b_card_index" onFocus="this.blur()" title="查看权限相关帮助"><img src="{$vd['sc']}images/help.gif" style="vertical-align:middle" border="0"/></a></div>
</div>
<div class="mytitle" id="mytitle">
  <div class="titleOp4" onmouseover="this.className='iconbg4'" onmouseout="this.className='titleOp4'" onclick="delAllSubmit('destroyitems')"><samp title="先选择您要删除的行,再点此按钮">
    <div style="padding-top:10px;padding-left:9px;">批量删除</div></samp>
  </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:10px;">实时修改</div></samp>
  </div>
  <div class="titleOp2" onmouseover="this.className='iconbg2'" onmouseout="this.className='titleOp2'" onclick="tableRefresh()" style="margin-right:7px"><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 style="float:right;padding-top:4px;">
    <form action="index.php?m=mod_b2b&c=Right" method="post" style="margin:0px 0px 0px 0px;" onsubmit="return searchSubmit()">
    <input type="text" name="keywords" size="16" value="{$vd['keywords']}" style="vertical-align:middle;" class="custsearch" onMouseOver="iEvent('mouseover',this)" onFocus="iEvent('focus',this)" onBlur="iEvent('blur',this)" onMouseOut="iEvent('mouseout',this)" />
    <select name="stype" style="vertical-align:middle;font-size:14px;">
      {#Option($vd['sarray'], $vd['stype'])}
    </select>
    <input type="submit" value=" 搜 索 &gt;&gt;" style="vertical-align:middle;" class="button"/><input type="button" value="&gt;&gt;" onFocus="this.blur()" onclick="disp('adddiv')" class="button" style="vertical-align:middle;border-left:0px;padding-left:1px" disabled/>
    </form>
  </div>
</div>
<div id="contentTip" style="display:none;"></div>
<div id="adddiv" style="position:absolute;top:100px;left:230px;;width:350px;display:none">
  <div class="popbg">
  <div class="poptitle">设置商品购买权限</div>
  <div style="float:right;"><img src="{$vd['sc']}images/destroy.gif" onclick="disp('adddiv')" style="cursor:pointer"/></div>
  <form action="index.php?m=mod_b2b&c=Right&a=Right" method="post" onsubmit="return searchSubmit()" style="clear:both">
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
      <td width="35%">设置的类别</td>
      <td width="65%">
        <select name="agent" onchange="setParam(this)" style="width:150px">
          <option value="0">请选择设置的对象</option>
          <option value="1">给用户设置购买权限</option>
          <option value="2">给一卡通设置购买权限</option>
        </select>
      </td>
    </tr>
    <tr>
      <td width="35%">设置的对象</td>
      <td width="65%">
        <select name="param" id="param" onchange="setidx(this)" style="width:150px">
          <option value="">请选择设置的对象</option>
        </select>
      </td>
    </tr>
    <tr>
      <td width="35%"><span id="label">--</span></td>
      <td width="65%">
        <input type="text" name="idx" value="" size="20" id="idx" style="width:143px"/>
      </td>
    </tr>
    <tr>
      <td width="35%">是否允许购买</td>
      <td width="65%">
        <input type="radio" name="isok" value="1" class="checkbox" checked />是 
        <input type="radio" name="isok" value="-1" class="checkbox"/>否
      </td>
    </tr>
    <tr>
      <td width="35%"></td>
      <td width="65%">
        <input type="submit" value="设 置" class="button"/>
        <input type="button" value="取 消" onclick="disp('adddiv')" class="button"/>
      </td>
    </tr>
  </table>
  </form>
  </div>
</div>
<div id="menuMask" class="menuMask" style="display:none">
  <form action="?m=mod_b2b&c=Tpl&tpl=right" method="post" style="margin:0px">
  <div class="menuContent">
  <input type="checkbox" name="id[]" value="tpids" id="tpids" class="checkbox" onFocus='this.blur()'/> 商品编号<br/>
  <input type="checkbox" name="id[]" value="tidx" id="tidx" class="checkbox" onFocus='this.blur()'/> 参数值<br/>
  <input type="checkbox" name="id[]" value="tparam" id="tparam" class="checkbox" onFocus='this.blur()'/> 参数类型<br/>
  <input type="checkbox" name="id[]" value="tisok" id="tisok" class="checkbox" onFocus='this.blur()'/> 权限<br/>
  </div>
  <div class="menuOp">
  <input type="submit" value="保存" class="button"/>
  <input type="button" value="重置" class="button" 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()'/></td>
<!--//thead-->
<td width="250px"><span class="canedit">商品编号</span>(编号前后要有半角的逗号)</td>
<td width="60px"><span class="canedit">参数值</span></td>
<td width="150px"><b>参数类型</b></td>
<td width="60px"><b>权限</b></td>
<!--//endthead-->
    <td width="22px">
      <img src="{$vd['sc']}images/icon_edit.gif"/>
    </td>
    <td width="22px">
      <img src="{$vd['sc']}images/destroy.gif"/>
    </td>
    <td class="endtd">
      <div class="infoicon" onclick="setMenuMask()"><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>
  <!--}-->
  <form id="cform" name="form" method="post" action="index.php?m=mod_b2b&c=Right&a=ItemDeal" onsubmit="return Check();">
  <table id="tbody"  border="0" cellspacing="0" cellpadding="0">
  <!--foreach($vd['items'] as $item) {-->
  <tr onmouseover="setoverbg(this)" onmouseout="setoutbg(this)">
    <td width="30px">
      <input type="checkbox" name="id[]" id="idchk_{$item['id']}" class="checkbox" value="{$item['id']}" onclick="CheckThis(this)" onFocus='this.blur()'></input>
    </td>
<!--//tbody-->
<td width="250px"><nobr><samp title="{$item['pids']}"><span onclick="toInput(this,{$item['id']},'pids')">{$item['pids']}</span></samp></nobr></td>
<td width="60px"><span onclick="toInput(this,{$item['id']},'idx')">{$item['idx']}</span></td>
<td width="150px"><a href="index.php?m=mod_b2b&c=Right&stype=param&keywords={$item['param']}">{#TxtByOption($vd['params'],$item['param'])}</a></td>
<td width="60px"><!--if($item['isok'] == 1){--><a href="index.php?m=mod_b2b&c=Right&stype=isok&keywords={$item['isok']}" title="点击查看对应状态卡密"><font color="#008800">允许</font></a><!--}else{--><a href="index.php?m=mod_b2b&c=Right&stype=isok&keywords={$item['isok']}" title="点击查看对应状态卡密"><font color="#ff0000">不允许</font></a><!--}--></td>
<!--//endtbody-->
    <td width="22px">
      <a href="index.php?m=mod_b2b&c=Right&a=Right&isok={$item['isok']}&idx={$item['idx']}&param={$item['param']}&agent=<!--if(strpos($item['param'],'kt') != false){-->2<!--}else{-->1<!--}-->" title="编辑权限"><img src="{$vd['sc']}images/icon_edit.gif"/></a>
    </td>
    <td width="22px">
      <img src="{$vd['sc']}images/destroy.gif" onclick="delSubmit({$item['id']},'destroyitems')" alt="清除权限,无法恢复" style="cursor:pointer"/>
    </td>
    <td class="endtd"></td>
  </tr>
  <!--}-->
  
</table>
</form>
<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=Right&a=deals&{$vd['op']}" id="op"/>
<input type="hidden" value="index.php?m=mod_b2b&c=Right&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=Right&{$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(2,58);
totleRows = {$vd['totlerow']};
deltxt  = "清除权限将无法恢复,您确定进行清除操作吗？";
thisaction = "清除";
thisdel = 0;
onedel  = 0;
sc = "{$vd['sc']}";
statistics = 0;
var resizeidx = 1;
</script>
<script type="text/javascript">
//当前表格配置
<!--//tinfo-->
 tInfo = Array('tpids','tidx','tparam','tisok');
<!--//endtinfo-->
</script>
<script src="{$vd['sc']}js/tools.js" type="text/javascript"></script>
<script type="text/javascript">
  agenttxt = Array("用户编号","用户所在级别","用户所在组");
  agentval = Array("aid","alv","gid");
  
  ykttxt   = Array("一卡通面值","一卡通批次","一卡通编号","一卡通特征码");
  yktval   = Array("yktprice","yktgroup","yktid","yktcode");
  
  function setParam(obj)
  {
    val          = obj.value;
    o            = $("param");
    o.length     = 0;
    o.options[0] = new Option("请选择设置的对象", "");
    len          = val == 1 ? agentval.length : yktval.length;
    
    $("idx").value = "";
    $("label").innerHTML = "--";
    
    for(i = 0; i < len; i++)
    {
      if(val == 1)
      {
        o.options[o.length] = new Option(agenttxt[i], agentval[i]);
      }
      else if(val == 2)
      {
        o.options[o.length] = new Option(ykttxt[i],   yktval[i]);
      }
      else
      {
        break;
      }
    }
  }
  
  function setidx(obj)
  {
    val = obj.value;
    if(val != "")
    {
      $("label").innerHTML = obj.options[obj.selectedIndex].text;
    }
    else
    {
      $("label").innerHTML = "--";
    }
    $("idx").value = "";
  }
</script>
</html>
<!--}-->