<?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 "<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> 管理员设置\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    如果不想修改密码的话，提交的时候留空即可  \r\n  </p>\r\n</div>\r\n<div style=\"float:right\"><a href=\"index.php?m=mod_home&a=Help&t=admin_b2b_master_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 id=\"contentTip\" style=\"display:none;\"></div>\r\n<div class=\"mytitle\" id=\"mytitle\">\r\n  <div class=\"titleOp4\" onmouseover=\"this.className='iconbg4'\" onmouseout=\"this.className='titleOp4'\" onclick=\"disp('adddiv')\">";
				echo "<s";
				echo "amp title=\"点击添加管理员\">\r\n    <div style=\"padding-top:10px;padding-left:9px;\"><img src=\"";
				echo $vd['sc'];
				echo "images/add.gif\" style=\"vertical-align:middle\"/> 添加</div></samp>\r\n  </div>  \r\n  <div style=\"float:right;padding-top:4px;\">\r\n    \r\n  </div>\r\n</div>\r\n<div id=\"adddiv\" style=\"position:absolute;top:60px;left:50px;;width:320px;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=Master&a=Create\" id=\"cform\">\r\n  <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n    <tr>\r\n      <td width=\"25%\">管理员</td>\r\n      <td width=\"75%\"><input name=\"adminname\" type=\"text\" size=\"25\"></td>\r\n    </tr>\r\n    <tr>\r\n      <td width=\"25%\">密码</td>\r\n";
				echo "      <td width=\"75%\"><input name=\"adminpass\" type=\"password\" size=\"25\"></td>\r\n    </tr>\r\n    <tr>\r\n      <td width=\"25%\">角色</td>\r\n      <td width=\"75%\">\r\n        ";
				echo "<s";
				echo "elect size=\"1\" name=\"adminrank\">\r\n          ";
				if ( $vd['issuper'] == 1 )
				{
								echo "          <option value=2>系统管理员</option>\r\n          ";
				}
				echo "          <option value=3>会员管理员</option>\r\n          <option value=4>订单管理员</option>\r\n          <option value=5>商品管理员</option>\r\n          <option value=6>新闻管理员</option>\r\n        </select>\r\n      </td>\r\n    </tr>\r\n    <tr>\r\n      <td width=\"25%\"></td>\r\n      <td width=\"75%\">\r\n        <input type=\"submit\" name=\"Submit\" value=\"添 加\" class=\"button\">\r\n        <input type=\"button\" name=\"Submit\" value=";
				echo "\"取 消\" 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=Sup&v=Sup\" method=\"post\" style=\"margin:0px\">\r\n  <div class=\"menuContent\">\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"tid\" id=\"tid\" class=\"checkbox\" onFocus='this.blur()'/> 商品编号<br/>\r\n  <input ";
				echo "type=\"checkbox\" name=\"id[]\" value=\"tordering\" id=\"tordering\" class=\"checkbox\" onFocus='this.blur()'/> 商品名称<br/>\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"tpics\" id=\"tpics\" class=\"checkbox\" onFocus='this.blur()'/> 供货商<br/>\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"tname\" id=\"tname\" class=\"checkbox\" onFocus='this.blur()'/> 进货审核<br/>\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"tabst\" id=\"";
				echo "tabst\" class=\"checkbox\" onFocus='this.blur()'/> 进货优先级<br/>\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"tfee\" id=\"tfee\" class=\"checkbox\" onFocus='this.blur()'/> 进货价<br/>\r\n  <input type=\"checkbox\" name=\"id[]\" value=\"tcode\" id=\"tcode\" class=\"checkbox\" onFocus='this.blur()'/> 最低售价<br/>\r\n  </div>\r\n  <div class=\"menuOp\">\r\n  <input type=\"submit\" value=\"保存\" class=\"button\" disabled />\r\n  <input type=";
				echo "\"button\" value=\"重置\" class=\"button\" disabled onclick=\"tInfoReset()\"/>\r\n  <input type=\"button\" value=\"取消\" class=\"button\" onclick=\"setMenuMask()\"/>\r\n  </div>\r\n  </form>\r\n</div>\r\n<div style=\"display:none\">\r\n  <form method=\"post\" id=\"fakeform\" action=\"index.php?m=mod_b2b&c=master&a=Update\">\r\n    <input type=\"hidden\" id=\"tadminname\" name=\"adminname\"/>\r\n    <input type=\"hidden\" id=\"toldname\"  name=\"oldname\"/";
				echo ">\r\n    <input type=\"hidden\" id=\"sid\" name=\"id\"/>\r\n    <input type=\"hidden\" id=\"tadminpass\" name=\"adminpass\">\r\n    <input type=\"hidden\" id=\"tadminrank\" name=\"adminrank\">\r\n  </form>\r\n</div>\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='this.blur()' disable";
				echo "d /></td>\r\n";
				echo "    <td width=\"35px\">编号</td>\r\n    <td width=\"165px\">管理员</td>\r\n    <td width=\"165px\">密码</td>\r\n    <td width=\"100px\">角色</td>\r\n    <td width=\"80px\">修改</td>\r\n    <td width=\"60px\"><img src=\"";
				echo $vd['sc'];
				echo "images/icon_edit.gif\" alt=\"设置权限\" style=\"padding-right:3px\">权限</td>\r\n    <td width=\"60px\"><img src=\"";
				echo $vd['sc'];
				echo "images/bind.gif\" alt=\"绑定密保卡\" style=\"padding-right:6px\">绑定</td>\r\n    <td width=\"60px\"><img src=\"";
				echo $vd['sc'];
				echo "images/destroy.gif\" alt=\"删除\" style=\"padding-right:6px\">删除</td>\r\n";
				echo "    <td class=\"endtd\">\r\n      <div class=\"infoicon\" style=\"color:#ccc\"><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 "  <table id=\"tbody\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n  ";
foreach ( $vd['items'] as $item )
{
				echo "  <tr>\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()'  disabled ></input>\r\n    </td>\r\n    ";
				echo "    <td width=\"35px\">";
				echo $item['id'];
				echo "</td>\r\n    <td width=\"165px\">\r\n      <input name=\"adminname\" id=\"adminname_";
				echo $item['id'];
				echo "\" type=\"text\" size=\"25\" value=\"";
				echo $item['adminName'];
				echo "\"/>\r\n      <input type=\"hidden\" name=\"oldname\" id=\"oldname_";
				echo $item['id'];
				echo "\" value=\"";
				echo $item['adminName'];
				echo "\" />\r\n      <input type=\"hidden\" name=\"id\" id=\"id_";
				echo $item['id'];
				echo "\" value=\"";
				echo $item['id'];
				echo "\" />\r\n    </td>\r\n    <td width=\"165px\"><input name=\"adminpass\" id=\"adminpass_";
				echo $item['id'];
				echo "\" type=\"password\" size=\"25\"></td>\r\n    <td width=\"100px\">\r\n      ";
				if ( $item['adminRank'] == 1 )
				{
								echo "      ";
								echo "<s";
								echo "elect size=\"1\" name=\"adminrank\" id=\"adminrank_";
								echo $item['id'];
								echo "\">\r\n        <option value=\"1\">超级管理员</option>\r\n      </select>\r\n      ";
				}
				else
				{
								if ( $item['adminRank'] == 2 )
								{
												echo "      ";
												echo "<s";
												echo "elect size=\"1\" name=\"adminrank\" id=\"adminrank_";
												echo $item['id'];
												echo "\">\r\n        <option value=\"2\">系统管理员</option>\r\n        ";
												if ( $vd['issuper'] == 1 )
												{
																echo "        <option value=3 ";
																if ( $item['adminRank'] == "3" )
																{
																				echo " selected ";
																}
																echo ">会员管理员</option>\r\n        <option value=4 ";
																if ( $item['adminRank'] == "4" )
																{
																				echo " selected ";
																}
																echo ">订单管理员</option>\r\n        <option value=5 ";
																if ( $item['adminRank'] == "5" )
																{
																				echo " selected ";
																}
																echo ">商品管理员</option>\r\n        <option value=6 ";
																if ( $item['adminRank'] == "6" )
																{
																				echo " selected ";
																}
																echo ">新闻管理员</option>\r\n        ";
												}
												echo "      </select>\r\n      ";
								}
								else
								{
												echo "      ";
												echo "<s";
												echo "elect size=\"1\" name=\"adminrank\" id=\"adminrank_";
												echo $item['id'];
												echo "\">\r\n        ";
												if ( $vd['issuper'] == 1 )
												{
																echo "        <option value=2>系统管理员</option>\r\n        ";
												}
												echo "        <option value=3 ";
												if ( $item['adminRank'] == "3" )
												{
																echo " selected ";
												}
												echo ">会员管理员</option>\r\n        <option value=4 ";
												if ( $item['adminRank'] == "4" )
												{
																echo " selected ";
												}
												echo ">订单管理员</option>\r\n        <option value=5 ";
												if ( $item['adminRank'] == "5" )
												{
																echo " selected ";
												}
												echo ">商品管理员</option>\r\n        <option value=6 ";
												if ( $item['adminRank'] == "6" )
												{
																echo " selected ";
												}
												echo ">新闻管理员</option>\r\n      </select>\r\n      ";
								}
				}
				echo "    </td>\r\n    <td width=\"80px\"><input type=\"button\" name=\"Submit\" value=\"修改\" class=\"button\" onclick=\"tofake('";
				echo $item['id'];
				echo "')\">\r\n    </td>\r\n    <td width=\"60px\">\r\n      ";
				if ( 1 < $item['adminRank'] )
				{
								echo "      -- \r\n      ";
				}
				else
				{
								echo "      --\r\n      ";
				}
				echo "    </td>\r\n    <td width=\"60px\">\r\n      <a href=\"index.php?m=mod_b2b&c=Master&a=Bind&adminname=";
				echo $item['adminName'];
				echo "\"><img src=\"";
				echo $vd['sc'];
				echo "images/bind.gif\" alt=\"绑定密保卡\"> 绑定</a> \r\n    </td>\r\n    <td width=\"60px\">\r\n      ";
				if ( 1 < $item['adminRank'] )
				{
								echo "      <a href=\"index.php?m=mod_b2b&c=Master&a=Del&id=";
								echo $item['id'];
								echo "\" onClick=\"return confirm('您确定要删除此管理员吗？')\"><img src=\"";
								echo $vd['sc'];
								echo "images/destroy.gif\" alt=\"删除\"> <font color=red>删除</font></a> \r\n      ";
				}
				else
				{
								echo "      --\r\n      ";
				}
				echo "    </td>\r\n    ";
				echo "    <td class=\"endtd\"></td>\r\n  </tr>\r\n  ";
}
echo "  \r\n</table>\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=master&a=Deals&";
				echo $vd['op'];
				echo "\" id=\"op\"/>\r\n<input type=\"hidden\" value=\"index.php?m=mod_b2b&c=master&a=index&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=master&a=index&";
				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(0,0);\r\ntotleRows = ";
				echo $vd['totlerow'];
				echo ";\r\ndeltxt  = \"销毁分类后,是无法恢复的,只能重新添加,您确定进行销毁操作吗？\";\r\nthisaction = \"销毁\";\r\nthisdel = 0;\r\nstatistics = 0;\r\nvar resizeidx = 4;\r\n</script>\r\n";
				echo "<s";
				echo "cript type=\"text/javascript\">\r\n//当前表格配置\r\n";
				echo " tInfo = Array('tid','tordering','tpics','tname','tabst','tfee','tcode');\r\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\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\nfunction setct(val)\r\n{\r\n  \$(\"cttr\").style.display = val == 3 ? \"\" : \"none\";\r\n}\r\n\r\nfunction tofake(id)\r\n{\r\n  vararray = Array(\"adminname\",\"oldname\",\"adminpass\");\r\n  len = vararray.length;\r\n  for(i=0; i<len; i++)\r\n  {\r\n    \$(\"t\"+vararray[i]).value = \$(vararray[i]+\"_\"+id).value;\r\n  }\r\n  \$(\"sid\").value = id;\r\n  \$(\"tadminrank\").value = \$(\"adminrank_\"+id).options[\$(\"adminra";
				echo "nk_\"+id).selectedIndex].value;\r\n  \$(\"fakeform\").submit();\r\n}\r\n</script>\r\n</html>\r\n";
}
?>
