<?php
/****************************************/
/*                                      */
/*  百信卡盟平台联系QQ:84945491         */
/*  淘宝店 http://shop70674652.taobao.com  */
/*  百信卡盟 http://www.caipiaobus.com  */
/*                                      */
/****************************************/

if ( $vd['table'] == 0 )
{
				widget( "head" );
				include( $path_cache.DS."mod_b2b_Shared_head.php" );
				echo "<s";
				echo "tyle type=\"text/css\">\r\n.bind{color:#0000ff;cursor:pointer}\r\n</style>\r\n<body>\r\n<div class=\"titleDiv\" id=\"titleList\">\r\n<div style=\"float:left\"><a href=\"index.php?a=Home\"><img src=\"";
				echo $vd['sc'];
				echo "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> ";
				echo "<s";
				echo "pan style=\"font-size:7px;\">>></span> <font color=\"#000\">密保卡列表</font> (共 <b>";
				echo "<s";
				echo "pan id=\"tol1\">";
				echo $vd['totlerow'];
				echo "</span></b> 个)\r\n  ";
				echo "<s";
				echo "trong onmouseover=\"showhide(this);\" onmouseout=\"showhide(this);\" style=\"cursor:pointer\">[?]</strong><p style=\"display:none\">\r\n    密保卡操作:<br/>\r\n    先添加密保，然后再把密保卡发给前台用户，为了安全，目前密宝解绑或者申请均需要后台管理员操作，密保卡一旦绑定后，她就属于所绑定的人，不允许改绑他人。您可以新增密保卡对他人做绑定<br/><br/>\r\n    绑定操作:<br/>\r\n    1.点添加生成密保<br/>\r\n    2.点击本列表对应密";
				echo "宝的的“绑”<br/>\r\n    3.提交<br/><br/>\r\n    解绑操作:<br/>\r\n    1.进入用户或者员工列表<br/>\r\n    2.点击对应的“绑”字即可<br/>\r\n    3.把密保卡处的勾去掉，让后提交即可<br/><br/>\r\n    注意事项:<br/>\r\n    绑定成功后，请务必找到对应用户的绑定信息查看一下，确认那里的密保序号和绑定的密保序号一致，并且勾选绑定，方法如下<br/>\r\n    绑定的是管理员：后台 -> 管理员设置 -> <img src=\"";
				echo $vd['sc'];
				echo "images/bind.gif\" /><br/>\r\n    绑定的是用户：后台 -> 用户 -> <img src=\"";
				echo $vd['sc'];
				echo "images/bind.gif\" /><br/>\r\n    绑定的是用户的员工：后台 -> 用户 -> 用户的员工列表 -> <img src=\"";
				echo $vd['sc'];
				echo "images/bind.gif\" /><br/>\r\n  </p>\r\n</div>\r\n<div id=\"contentTip\" style=\"display:none;\"></div>\r\n<div style=\"float:right\"><a href=\"index.php?m=mod_home&a=Help&t=admin_b2b_catalog_index\" onFocus=\"this.blur()\" title=\"查看密保卡相关帮助\"><img src=\"";
				echo $vd['sc'];
				echo "images/help.gif\" style=\"vertical-align:middle\" border=\"0\"/></a></div>\r\n</div>\r\n<div class=\"mytitle\" id=\"mytitle\">\r\n  <div class=\"titleOp4\" onmouseover=\"this.className='iconbg4'\" onmouseout=\"this.className='titleOp4'\" onclick=\"delAllSubmit('destroyitems')\">";
				echo "<s";
				echo "amp title=\"先选择您要销毁的行,再点此按钮\">\r\n    <div style=\"padding-top:10px;padding-left:9px;\">批量销毁</div></samp>\r\n  </div>\r\n  <div class=\"titleOp2\" onmouseover=\"this.className='iconbg2'\" onmouseout=\"this.className='titleOp2'\" onclick=\"tableRefresh()\" style=\"margin-right:3px\">";
				echo "<s";
				echo "amp title=\"点击刷新本页刷新数据,并保持原来勾选状态\">\r\n    <div style=\"padding-top:10px;padding-left:10px;\">刷新</div></samp>\r\n  </div>\r\n  <div class=\"titleOp4\" onmouseover=\"this.className='iconbg4'\" onmouseout=\"this.className='titleOp4'\" onclick=\"createmibao()\">";
				echo "<s";
				echo "amp title=\"点击刷新本页刷新数据,并保持原来勾选状态\">\r\n    <div class=\"addicon\" style=\"padding-top:10px;padding-left:26px;\">添加</div></samp>\r\n  </div>\r\n  <div style=\"float:right;padding-top:4px;\">\r\n    <form action=\"index.php?m=mod_b2b&c=MiBaoKa\" method=\"post\" style=\"margin:0px 0px 0px 0px;\" onsubmit=\"return searchSubmit()\">\r\n    <input type=\"text\" name=\"keywords\" size=\"25\" value=\"";
				echo $vd['keywords'];
				echo "\" style=\"vertical-align:middle;\" class=\"custsearch\" onMouseOver=\"iEvent('mouseover',this)\" onFocus=\"iEvent('focus',this)\" onBlur=\"iEvent('blur',this)\" onMouseOut=\"iEvent('mouseout',this)\" />\r\n    ";
				echo "<s";
				echo "elect name=\"stype\" style=\"vertical-align:middle;font-size:14px;\">\r\n      ";
				option( $vd['sarray'], $vd['stype'] );
				echo "    </select>\r\n    <input type=\"submit\" value=\"密保卡搜索 &gt;&gt;\" style=\"vertical-align:middle;\" class=\"button\"/>\r\n    </form>\r\n  </div>\r\n</div>\r\n<div id=\"adddiv\" style=\"position:absolute;top:100px;left:230px;;width:430px;display:none\">\r\n  <div style=\"padding:20px;background:#F1F5FA;border:5px #75BCD7 solid\">\r\n  <div style=\"font-size:14px;font-weight:bold;padding:5px;float:left\">添加绑定</div>\r\n  <div sty";
				echo "le=\"float:right;\"><img src=\"";
				echo $vd['sc'];
				echo "images/destroy.gif\" onclick=\"disp('adddiv')\" style=\"cursor:pointer\"/></div>\r\n  <form name=\"form1\" method=\"post\" action=\"index.php?m=mod_b2b&c=MiBaoKa&a=Save\" id=\"tform\" style=\"clear:both\">\r\n  <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n    <tr>\r\n      <td width=\"30%\">序列号</td>\r\n      <td width=\"70%\"><input type=\"text\" name=\"sn\" size=\"25\" id=\"sn\"/></td>\r\n    </tr>\r\n    <tr id=\"tr0\">\r\n  ";
				echo "    <td width=\"30%\">用户编号</td>\r\n      <td width=\"70%\"><input type=\"text\" name=\"aid\" id=\"aid\" size=\"25\"/></td>\r\n    </tr>\r\n    <tr id=\"tr1\" style=\"display:none\">\r\n      <td width=\"30%\" id=\"td1\">员工编号</td>\r\n      <td width=\"70%\"><input type=\"text\" name=\"staffid\" id=\"staffid\" size=\"25\" value=\"0\"/></td>\r\n    </tr>\r\n    <tr>\r\n      <td width=\"30%\">绑定对象</td>\r\n      <td width=\"70%\">\r\n        <input type=\"radio\" ";
				echo "name=\"bindobj\" value=\"0\" class=\"checkbox\" checked onclick=\"setbindview(0)\"/> 用户\r\n        <input type=\"radio\" name=\"bindobj\" value=\"1\" class=\"checkbox\" onclick=\"setbindview(1)\"/> 用户的员工\r\n        <input type=\"radio\" name=\"bindobj\" value=\"2\" class=\"checkbox\" onclick=\"setbindview(2)\"/> 管理员\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td width=\"30%\"></td>\r\n      <td width=\"70%\">\r\n        <input type=\"subm";
				echo "it\" value=\"设 置\" class=\"button\"/>\r\n        <input type=\"button\" value=\"取 消\" onclick=\"disp('adddiv')\" class=\"button\"/>\r\n      </td>\r\n    </tr>\r\n  </table>\r\n  </form>\r\n  </div>\r\n</div>\r\n\r\n<div id=\"menuMask\" class=\"menuMask\" style=\"display:none\">\r\n  <form action=\"?m=mod_b2b&c=Tpl&tpl=MiBaoKa\" method=\"post\" style=\"margin:0px\">\r\n  <div class=\"menuContent\">\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"id\" id=\"i";
				echo "d\" onFocus='this.blur()'/>编号<br/>\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"tsn\" id=\"tsn\" onFocus='this.blur()'/>序列号<br/>\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"createdate\" id=\"createdate\" onFocus='this.blur()'/>创建时间<br/>\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"bindinfo\" id=\"bindinfo\" onFocus='this.blur()'/>绑定信息<br/>\r\n  </div>\r\n  <div class=\"menuOp\">\r\n  <input type=\"submit\" value=";
				echo "\"保存\" class=\"button\"/>\r\n  <input type=\"button\" value=\"重置\" class=\"button\" onclick=\"tInfoReset()\"/>\r\n  <input type=\"button\" value=\"取消\" class=\"button\" onclick=\"setMenuMask()\"/>\r\n  </div>\r\n  </form>\r\n</div>\r\n\r\n<table id=\"thead\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n  <tr>\r\n    <td width=\"30px\">\r\n      <input name=\"chkall\" id=\"chkall\" type=\"checkbox\" class=\"checkbox\" onclick=\"CheckAll(this)\" onFocus";
				echo "='this.blur()'/></td>\r\n";
				echo "<td width=\"50px\">编号</td>\n<td width=\"250px\">序列号</td>\n<td width=\"150px\">创建时间</td>\n<td width=\"150px\">绑定信息</td>\n";
				echo "    <td width=\"22px\">\r\n      <img src=\"";
				echo $vd['sc'];
				echo "images/icon_edit.gif\"/>\r\n    </td>\r\n    <td width=\"22px\">\r\n      <img src=\"";
				echo $vd['sc'];
				echo "images/destroy.gif\"/>\r\n    </td>\r\n    <td class=\"endtd\">\r\n      <div class=\"infoicon\" onclick=\"setMenuMask()\"><b><u>>></u></b></div>\r\n    </td>\r\n  </tr>\r\n</table>\r\n<div id=\"tip\" style=\"display:none\">\r\n  ";
				echo "<s";
				echo "pan id=\"tiptable\">此页中所有 <b>";
				echo "<s";
				echo "pan id=\"ncheck\">";
				echo $vd['nrows'] < $vd['totlerow'] ? $vd['nrows'] : $vd['totlerow'];
				echo "</span></b> 条记录已选中 </span> \r\n  ";
				echo "<s";
				echo "pan id=\"tipspan\">\r\n    <a href=\"javascript:CheckTotle(";
				echo $vd['totlerow'];
				echo ",0)\">点此选择当前列表中所有 <b>";
				echo $vd['totlerow'];
				echo "</b> 条记录>></a>\r\n  </span>\r\n</div>\r\n<div id=\"content\">\r\n";
}
echo "  ";
if ( $vd['totlerow'] == 0 )
{
				echo "  <table  width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n  <tr>\r\n    <td align=\"right\" colspan=\"20\">无任何记录</td>\r\n  </tr>\r\n  </table>\r\n  ";
}
echo "  <form id=\"cform\" name=\"form\" method=\"post\" action=\"index.php?m=mod_b2b&c=MiBaoKa&a=ItemDeal\" onsubmit=\"return Check();\">\r\n  <table id=\"tbody\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n  \r\n  ";
foreach ( $vd['items'] as $item )
{
				echo "  <tr onmouseover=\"setoverbg(this)\" onmouseout=\"setoutbg(this)\">\r\n    <td width=\"30px\">\r\n      <input type=\"checkbox\" name=\"id[]\" id=\"idchk_";
				echo $item['id'];
				echo "\" class=\"checkbox\" value=\"";
				echo $item['id'];
				echo "\" onclick=\"CheckThis(this)\" onFocus='this.blur()'></input>\r\n    </td>\r\n";
				echo "<td width=\"50px\">";
				echo $item['id'];
				echo "</td>\n<td width=\"250px\">";
				echo $item['sn'];
				echo "</td>\n<td width=\"150px\">";
				echo $item['createdate'];
				echo "</td>\n<td width=\"150px\">";
				if ( 0 < $item['staffid'] && 0 < $item['aid'] )
				{
								echo "用户";
								echo $item['aid'];
								echo "的员工";
								echo $item['staffid'];
								echo $item['mibaokacheck'] == 0 ? "(<font color=\"#cccccc\">未生效</font>)" : "(<font color=\"#0000ff\">已生效</font>)";
				}
				else if ( 0 < $item['aid'] )
				{
								echo "用户";
								echo $item['aid'];
								echo $item['mibaokacheck'] == 0 ? "(<font color=\"#cccccc\">未生效</font>)" : "(<font color=\"#0000ff\">已生效</font>)";
				}
				else if ( $item['aid'] == 0 && 0 < $item['staffid'] )
				{
								echo "管理员";
								echo $item['staffid'];
								echo $item['adminmibaokacheck'] == 0 ? "(<font color=\"#cccccc\">未生效</font>)" : "(<font color=\"#0000ff\">已生效</font>)";
				}
				else
				{
								echo "[";
								echo "<s";
								echo "pan class=\"bind\" onclick=\"setbind(";
								echo $item['sn'];
								echo ")\"><img src=\"";
								echo $vd['sc'];
								echo "images/bind.gif\" alt=\"绑定密保卡\"></span>]<font color=\"#cccccc\">未绑定</font>";
				}
				echo "</td>\n";
				echo "    <td width=\"22px\">\r\n      <img src=\"";
				echo $vd['sc'];
				echo "images/icon_edit.gif\" onclick=\"viewmibao(";
				echo $item['sn'];
				echo ")\" style=\"cursor:pointer\"/>\r\n    </td>\r\n    <td width=\"22px\">\r\n      <img src=\"";
				echo $vd['sc'];
				echo "images/destroy.gif\" onclick=\"delSubmit(";
				echo $item['id'];
				echo ",'destroyitems')\" alt=\"销毁密保卡记录后,是无法恢复的,只能重新添加\" style=\"cursor:pointer\"/>\r\n    </td>\r\n    <td class=\"endtd\"></td>\r\n  </tr>\r\n  ";
}
echo "  \r\n</table>\r\n</form>\r\n<input type=\"hidden\" value=\"";
echo $vd['totlepage'];
echo "\" id=\"totlePage\"/>\r\n<input type=\"hidden\" value=\"";
echo $vd['thispage'];
echo "\" id=\"thisPage\"/>\r\n";
if ( $vd['table'] == 0 )
{
				echo "</div>\r\n\r\n<input type=\"hidden\" value=\"index.php?m=mod_b2b&c=MiBaoKa&a=Deals&";
				echo $vd['op'];
				echo "\" id=\"op\"/>\r\n<input type=\"hidden\" value=\"index.php?m=mod_b2b&c=MiBaoKa&istable=1&";
				echo $vd['op'];
				echo "\" id=\"url\"/>\r\n<input type=\"hidden\" value=\"";
				echo $vd['op'];
				echo "\" id=\"params\"/>\r\n<div style=\"position:absolute;bottom:0px\">\r\n  <div class=\"tbBottom\" id=\"tbBottom\">\r\n    <div style=\"float:left;padding-top:8px;\">\r\n      ";
				echo "<s";
				echo "trong> 总计 <font color=\"#ff0000\">";
				echo "<s";
				echo "pan id=\"tol2\">";
				echo $vd['totlerow'];
				echo "</span></font> 条</strong>\r\n    </div>\r\n    <div style=\"float:right;text-align:right;\">\r\n    <form id=\"actionform\" method=\"post\" action=\"index.php?m=mod_b2b&c=MiBaoKa&";
				echo $vd['op'];
				echo "\" style=\"margin:0px;\" onsubmit=\"loadDisp(1)\">\r\n    <div id=\"page\"></div>\r\n    <div style=\"float:left;margin-top:3px\">\r\n      每页显示<input type=\"text\" name=\"nrows\" size=\"2\" value=\"";
				echo $vd['nrows'];
				echo "\" class=\"pagetxt\" onMouseOver=\"iEvent('mouseover',this)\" onFocus=\"iEvent('focus',this)\" onBlur=\"iEvent('blur',this)\" onMouseOut=\"iEvent('mouseout',this)\" /> 个 \r\n      到第<input type=\"text\" name=\"page\" size=\"2\" value=\"";
				echo $vd['thispage'];
				echo "\" 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\" />\r\n    </div>\r\n    </form>\r\n    </div>\r\n  </div>\r\n</div>\r\n<div id=\"load\" style=\"display:none;\">\r\n  <div id=\"loadcontent\" >页面加载中请稍等...</div>\r\n</div>\r\n</body>\r\n";
				echo "<s";
				echo "cript type=\"text/javascript\">\r\n//第一参数，后边保留显示的列数\r\n//第二参数，除最后一个参数外的保留参数的总宽度\r\ntRows   = ";
				echo $vd['nrows'] < $vd['totlerow'] ? $vd['nrows'] : $vd['totlerow'];
				echo ";\r\ntInfoA  = Array(2,58);\r\ntotleRows = ";
				echo $vd['totlerow'];
				echo ";\r\ndeltxt  = \"销毁密保卡后,是无法恢复的,只能重新添加,您确定进行销毁操作吗？\";\r\nthisaction = \"销毁\";\r\nthisdel = 0;\r\nstatistics = 0;\r\nvar resizeidx = 2;\r\n</script>\r\n";
				echo "<s";
				echo "cript type=\"text/javascript\">\r\n//当前表格配置\r\n";
				echo " tInfo = Array('id','tsn','createdate','bindinfo');\n";
				echo "function pickcolor(id) \r\n{\r\n  var color = showModalDialog(\"";
				echo $vd['sc'];
				echo "tools/colorselect.htm\", \"\", \"font-family:Verdana; font-size:12; status:no; dialogWidth:21em; dialogHeight:21em\");\r\n  if (color != null) \r\n  {\r\n    \$(\"colorexample\"+id).style.backgroundColor = color;\r\n    \$(\"textcolor\"+id).value = color;\r\n  }\r\n}\r\n</script>\r\n";
				echo "<s";
				echo "cript src=\"";
				echo $vd['sc'];
				echo "js/tools.js\" type=\"text/javascript\"></script>\r\n";
				echo "<s";
				echo "cript type=\"text/javascript\">\r\n  function setbind(sn)\r\n  {\r\n    \$(\"sn\").value = sn;\r\n    disp('adddiv');\r\n  }\r\n  \r\n  function createmibao()\r\n  {\r\n    var yes = window.open(\"index.php?m=mod_b2b&c=MiBaoKa&a=Create\", \"\", \"width=400 height=600\");\r\n    if(yes)\r\n    {\r\n      window.location.reload();\r\n    }\r\n  }\r\n  \r\n  function viewmibao(sn)\r\n  {\r\n    window.open(\"index.php?m=mod_b2b&c=MiBaoKa&a=Detail&";
				echo "sn=\" + sn, \"\", \"width=400 height=600\");\r\n  }\r\n  \r\n  function setbindview(val)\r\n  {\r\n    if(val == \"2\")\r\n    {\r\n      \$(\"staffid\").value = \"\";\r\n      \$(\"aid\").value = \"0\";\r\n      \$(\"td1\").innerHTML = \"管理员编号\";\r\n      \$(\"tr0\").style.display = \"none\";\r\n      \$(\"tr1\").style.display = \"\";\r\n    }\r\n    else if(val == \"0\")\r\n    {\r\n      \$(\"staffid\").value = \"0\";\r\n      \$(\"aid\").value = \"\";\r\n      \$(\"t";
				echo "d1\").innerHTML = \"员工编号\";\r\n      \$(\"tr0\").style.display = \"\";\r\n      \$(\"tr1\").style.display = \"none\";\r\n    }\r\n    else if(val == \"1\")\r\n    {\r\n      \$(\"staffid\").value = \"\";\r\n      \$(\"aid\").value = \"\";\r\n      \$(\"td1\").innerHTML = \"员工编号\";\r\n      \$(\"tr0\").style.display = \"\";\r\n      \$(\"tr1\").style.display = \"\";\r\n    }\r\n  }\r\n</script>\r\n</html>\r\n";
}
?>
