<!--if($vd['table']==0){-->
{load(head)}
<style type="text/css">
.bind{color:#0000ff;cursor:pointer}
</style>
<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> <font color="#000">密保卡列表</font> (共 <b><span id="tol1">{$vd['totlerow']}</span></b> 个)
  <strong onmouseover="showhide(this);" onmouseout="showhide(this);" style="cursor:pointer">[?]</strong><p style="display:none">
    密保卡操作:<br/>
    先添加密保，然后再把密保卡发给前台用户，为了安全，目前密宝解绑或者申请均需要后台管理员操作，密保卡一旦绑定后，她就属于所绑定的人，不允许改绑他人。您可以新增密保卡对他人做绑定<br/><br/>
    绑定操作:<br/>
    1.点添加生成密保<br/>
    2.点击本列表对应密宝的的“绑”<br/>
    3.提交<br/><br/>
    解绑操作:<br/>
    1.进入用户或者员工列表<br/>
    2.点击对应的“绑”字即可<br/>
    3.把密保卡处的勾去掉，让后提交即可<br/><br/>
    注意事项:<br/>
    绑定成功后，请务必找到对应用户的绑定信息查看一下，确认那里的密保序号和绑定的密保序号一致，并且勾选绑定，方法如下<br/>
    绑定的是管理员：后台 -> 管理员设置 -> <img src="{$vd['sc']}images/bind.gif" /><br/>
    绑定的是用户：后台 -> 用户 -> <img src="{$vd['sc']}images/bind.gif" /><br/>
    绑定的是用户的员工：后台 -> 用户 -> 用户的员工列表 -> <img src="{$vd['sc']}images/bind.gif" /><br/>
  </p>
</div>
<div id="contentTip" style="display:none;"></div>
<div style="float:right"><a href="index.php?m=mod_home&a=Help&t=admin_b2b_catalog_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="titleOp2" onmouseover="this.className='iconbg2'" onmouseout="this.className='titleOp2'" onclick="tableRefresh()" style="margin-right:3px"><samp title="点击刷新本页刷新数据,并保持原来勾选状态">
    <div style="padding-top:10px;padding-left:10px;">刷新</div></samp>
  </div>
  <div class="titleOp4" onmouseover="this.className='iconbg4'" onmouseout="this.className='titleOp4'" onclick="createmibao()"><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=MiBaoKa" method="post" style="margin:0px 0px 0px 0px;" onsubmit="return searchSubmit()">
    <input type="text" name="keywords" size="25" 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"/>
    </form>
  </div>
</div>
<div id="adddiv" style="position:absolute;top:100px;left:230px;;width:430px;display:none">
  <div style="padding:20px;background:#F1F5FA;border:5px #75BCD7 solid">
  <div style="font-size:14px;font-weight:bold;padding:5px;float:left">添加绑定</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=MiBaoKa&a=Save" id="tform" style="clear:both">
  <table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
      <td width="30%">序列号</td>
      <td width="70%"><input type="text" name="sn" size="25" id="sn"/></td>
    </tr>
    <tr id="tr0">
      <td width="30%">用户编号</td>
      <td width="70%"><input type="text" name="aid" id="aid" size="25"/></td>
    </tr>
    <tr id="tr1" style="display:none">
      <td width="30%" id="td1">员工编号</td>
      <td width="70%"><input type="text" name="staffid" id="staffid" size="25" value="0"/></td>
    </tr>
    <tr>
      <td width="30%">绑定对象</td>
      <td width="70%">
        <input type="radio" name="bindobj" value="0" class="checkbox" checked onclick="setbindview(0)"/> 用户
        <input type="radio" name="bindobj" value="1" class="checkbox" onclick="setbindview(1)"/> 用户的员工
        <input type="radio" name="bindobj" value="2" class="checkbox" onclick="setbindview(2)"/> 管理员
      </td>
    </tr>
    <tr>
      <td width="30%"></td>
      <td width="70%">
        <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=MiBaoKa" method="post" style="margin:0px">
  <div class="menuContent">
  <input type="checkbox" name="id[]" value="id" id="id" onFocus='this.blur()'/>编号<br/>
  <input type="checkbox" name="id[]" value="tsn" id="tsn" onFocus='this.blur()'/>序列号<br/>
  <input type="checkbox" name="id[]" value="createdate" id="createdate" onFocus='this.blur()'/>创建时间<br/>
  <input type="checkbox" name="id[]" value="bindinfo" id="bindinfo" 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="50px">编号</td>
<td width="250px">序列号</td>
<td width="150px">创建时间</td>
<td width="150px">绑定信息</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=MiBaoKa&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="50px">{$item['id']}</td>
<td width="250px">{$item['sn']}</td>
<td width="150px">{$item['createdate']}</td>
<td width="150px"><!--if($item['staffid'] > 0 && $item['aid'] > 0){-->用户{$item['aid']}的员工{$item['staffid']}<!--echo $item['mibaokacheck']==0 ? '(<font color="#cccccc">未生效</font>)' : '(<font color="#0000ff">已生效</font>)' ;--><!--}else if($item['aid']>0){-->用户{$item['aid']}<!--echo $item['mibaokacheck']==0 ? '(<font color="#cccccc">未生效</font>)' : '(<font color="#0000ff">已生效</font>)' ;--><!--}else if($item['aid']==0 && $item['staffid']>0){-->管理员{$item['staffid']}<!--echo $item['adminmibaokacheck']==0 ? '(<font color="#cccccc">未生效</font>)' : '(<font color="#0000ff">已生效</font>)' ;--><!--}else{-->[<span class="bind" onclick="setbind({$item['sn']})"><img src="{$vd['sc']}images/bind.gif" alt="绑定密保卡"></span>]<font color="#cccccc">未绑定</font><!--}--></td>
<!--//endtbody-->
    <td width="22px">
      <img src="{$vd['sc']}images/icon_edit.gif" onclick="viewmibao({$item['sn']})" style="cursor:pointer"/>
    </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=MiBaoKa&a=Deals&{$vd['op']}" id="op"/>
<input type="hidden" value="index.php?m=mod_b2b&c=MiBaoKa&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=MiBaoKa&{$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;
statistics = 0;
var resizeidx = 2;
</script>
<script type="text/javascript">
//当前表格配置
<!--//tinfo-->
 tInfo = Array('id','tsn','createdate','bindinfo');
<!--//endtinfo-->
function pickcolor(id) 
{
  var color = showModalDialog("{$vd['sc']}tools/colorselect.htm", "", "font-family:Verdana; font-size:12; status:no; dialogWidth:21em; dialogHeight:21em");
  if (color != null) 
  {
    $("colorexample"+id).style.backgroundColor = color;
    $("textcolor"+id).value = color;
  }
}
</script>
<script src="{$vd['sc']}js/tools.js" type="text/javascript"></script>
<script type="text/javascript">
  function setbind(sn)
  {
    $("sn").value = sn;
    disp('adddiv');
  }
  
  function createmibao()
  {
    var yes = window.open("index.php?m=mod_b2b&c=MiBaoKa&a=Create", "", "width=400 height=600");
    if(yes)
    {
      window.location.reload();
    }
  }
  
  function viewmibao(sn)
  {
    window.open("index.php?m=mod_b2b&c=MiBaoKa&a=Detail&sn=" + sn, "", "width=400 height=600");
  }
  
  function setbindview(val)
  {
    if(val == "2")
    {
      $("staffid").value = "";
      $("aid").value = "0";
      $("td1").innerHTML = "管理员编号";
      $("tr0").style.display = "none";
      $("tr1").style.display = "";
    }
    else if(val == "0")
    {
      $("staffid").value = "0";
      $("aid").value = "";
      $("td1").innerHTML = "员工编号";
      $("tr0").style.display = "";
      $("tr1").style.display = "none";
    }
    else if(val == "1")
    {
      $("staffid").value = "";
      $("aid").value = "";
      $("td1").innerHTML = "员工编号";
      $("tr0").style.display = "";
      $("tr1").style.display = "";
    }
  }
</script>
</html>
<!--}-->