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

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>直销商_菜单</title>\r\n<meta http-equiv=\"Content-Language\" content=\"zh-CN\">\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<link rel=\"stylesheet\" href=\"";
echo $vd['content'];
echo "css/style.css\" type=\"text/css\">\r\n";
echo "<s";
echo "cript type=\"text/javascript\" src=\"";
echo $vd['content'];
echo "js/utils.js\"></script>\r\n";
echo "<s";
echo "cript language=\"JavaScript\" type=\"text/JavaScript\">\r\nfunction toggle(targetid){\r\n\tif (document.getElementById){\r\n\t\ttarget=document.getElementById(targetid);\r\n\t\t\tif (target.style.display==\"\"){\r\n\t\t\t\ttarget.style.display = \"none\";\r\n\t\t\t} else {\r\n\t\t\t\ttarget.style.display = \"\";\r\n\t\t\t}\r\n\t}\r\n}\r\n</script>\r\n</head>\r\n<body class=\"leftbg\">\r\n<table width=\"180\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n\t<tr>\r\n\t\t<td";
echo ">\r\n\t\t\t<div id=\"menuuserinfo\" onclick=\"toggle('div66')\"></div>\r\n\t\t\t<div class=\"usermain\" id=\"div66\">\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t<li>编 号：";
echo "<s";
echo "pan id=\"mchaid\">";
displaycode( $vd['agent'][7], 4, 0 );
echo "</span></li>\r\n\t\t\t\t\t<li id=\"staffid\" ";
if ( isset( $vd['agent'][9] ) && 0 < $vd['agent'][9] )
{
}
else
{
				echo "style=\"display:none\"";
}
echo ">员 工：";
echo "<s";
echo "pan id=\"mchstaffid\">";
displaycode( $vd['agent'][9], 2 );
echo "</span></li>\r\n\t\t\t\t\t<li>级 别：";
echo "<s";
echo "pan id=\"mchalv\">";
echo $vd['agent'][2];
echo "</span></li>\r\n\t\t\t\t\t<li>区 域：";
echo "<s";
echo "pan id=\"mchaddr\">";
echo $vd['agent'][3];
echo "</span></li>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<li id=\"mchremainid\">余 额：<a href=\"";
echo $vd['root'];
echo "index.php?m=mod_agent&c=funds&a=AddFunds\" target=\"main\">";
echo "<s";
echo "pan class=\"ye\" id=\"mcharemain\">";
echo $vd['lang']['moneysymbol'];
echo $vd['agent'][6];
echo "</span></a></li>\r\n\t\t\t\t\t<li id=\"mcharrearsid\">欠 款：<a href=\"";
echo $vd['root'];
echo "index.php?m=mod_agent&c=loan&a=Create\" target=\"main\">";
echo "<s";
echo "pan class=\"ye\" id=\"mcharrears\">";
echo $vd['lang']['moneysymbol'];
echo $vd['arrears'];
echo "</span></a></li>\r\n\t\t\t\t\t<li id=\"mchcreditid\">信 用：<a href=\"";
echo $vd['root'];
echo "index.php?m=mod_agent&c=loan&a=Create\" target=\"main\">";
echo "<s";
echo "pan class=\"ye\" id=\"mchcredit\">";
echo $vd['lang']['moneysymbol'];
echo $vd['credit'];
echo "</span></a></li>\r\n\t\t\t\t  <li id=\"mchparentidid\"><label>上 级：</label>";
echo "<s";
echo "pan id=\"mchparentid\" style=\"font-weight:bold\">";
displaycode( $vd['agent'][4] );
echo "</span></li>\r\n\t\t\t\t</ul>\r\n\t\t\t\t<div id=\"userbottom\"></div>\r\n\t\t\t\t";
echo "<s";
echo "cript type=\"text/javascript\">\r\n\t\t\t\t\t\$(\"mchremainid\").style.display = getCookie('umebiz_com_1') == \"0\" ? \"none\" : \"\";\r\n          \$(\"mchparentidid\").style.display = getCookie('umebiz_com_2') == \"0\" ? \"none\" : \"\";\r\n          \$(\"mcharrearsid\").style.display = getCookie('umebiz_com_9') == \"0\" ? \"none\" : \"\";\r\n          \$(\"mchcreditid\").style.display = getCookie('umebiz_com_10') == \"0\" ? \"none\" : \"\";\r\n\t\t";
echo "\t\t</script>\r\n\t\t\t</div>\r\n\t\t</td>\r\n\t</tr>\r\n\t";
$tmp = array( );
if ( isset( $vd['agent'][9] ) && 0 < $vd['agent'][9] )
{
				$staffrights = $vd['agent'][11];
				$tmp = explode( ",", $staffrights );
}
else
{
				$staffrights = $vd['agent'][11];
				$tmp = explode( ",", $staffrights );
				$len = count( $tmp );
				if ( $len < 20 )
				{
								$i = 0;
								for ( ;	$i < 80;	++$i	)
								{
												$tmp[$i] = "0";
								}
				}
}
$leftinfo = array(
				array(
								"name" => "我要进货",
								"cls" => "jh",
								"id" => array( 0, 0, 0, 0 ),
								"val" => array(
												array( "id" => 0, "txt" => "购卡售用户", "url" => "index.php?m=mod_b2b&c=Category", "nobr" => 1 ),
												array( "id" => 0, "txt" => "收藏夹", "url" => "index.php?m=mod_b2b&c=Fav" ),
												array( "id" => 0, "txt" => "库存取卡售用户", "url" => "index.php?m=mod_b2b&c=Category" ),
												array( "id" => 0, "txt" => "便民中心", "url" => "index.php?m=mod_b2b&c=Quick" )
								)
				),
				array(
								"name" => "销售记录",
								"cls" => "xsjl",
								"id" => array( 5, 1, 34, 11, 38 ),
								"val" => array(
												array( "id" => 5, "txt" => "加款扣款记录", "url" => "index.php?m=mod_agent&c=trade&tpl=history" ),
												array( "id" => 1, "txt" => "进货记录查询", "url" => "index.php?m=mod_agent&c=order" ),
												array( "id" => 34, "txt" => "销售记录查询", "url" => "index.php?m=mod_agent&c=VOrder&ordstate=2" ),
												array( "id" => 11, "txt" => "员工零售利润报表", "url" => "index.php?m=mod_agent&c=order&a=staffProfit" ),
												array( "id" => 38, "txt" => "员工结帐管理", "url" => "index.php?m=mod_agent&c=Check&a=Add" )
								)
				),
				array(
								"name" => "账户管理",
								"cls" => "zhgl",
								"id" => array( 3, 6, 6, 26, 27, 1001, 12, 23, 35 ),
								"val" => array(
												array( "id" => 3, "txt" => "帐户余额充值", "url" => "index.php?m=mod_agent&c=funds&a=AddFunds" ),
												array( "id" => 6, "txt" => "资金锁定", "url" => "index.php?m=mod_agent&c=funds&a=lock", "nobr" => 1 ),
												array( "id" => 6, "txt" => "记录", "url" => "index.php?m=mod_agent&c=funds&a=LockHistory" ),
												array( "id" => 26, "txt" => "借款申请", "url" => "index.php?m=mod_agent&c=loan&a=Create", "nobr" => 1 ),
												array( "id" => 26, "txt" => "记录", "url" => "index.php?m=mod_agent&c=loan" ),
												array( "id" => 1001, "txt" => "帐户资料修改", "url" => "index.php?m=mod_agent&c=Home" ),
												array( "id" => 12, "txt" => "操作日志", "url" => "index.php?m=mod_agent&c=log" ),
												array( "id" => 23, "txt" => "员工帐户管理", "url" => "index.php?m=mod_agent&c=staff&nrows=500" ),
												array( "id" => 35, "txt" => "员工零售价设定", "url" => "index.php?m=mod_b2b&c=product&a=PriceMy" )
								)
				),
				array(
								"name" => "安全管理",
								"cls" => "aqgl",
								"id" => array( 20, 39, 40, 41, 42 ),
								"val" => array(
												array( "id" => 20, "txt" => "帐户密码设定", "url" => "index.php?m=mod_agent&c=home&a=modifyPass" ),
												array( "id" => 39, "txt" => "IP及所在地安全绑定", "url" => "index.php?m=mod_agent&c=IPCheck&a=IP" ),
												array( "id" => 40, "txt" => "硬件信息安全绑定", "url" => "index.php?m=mod_agent&c=PCCheck&a=CPU" ),
												array( "id" => 41, "txt" => "手机令牌安全绑定", "url" => "index.php?m=mod_agent&c=Mobile&a=Apply" ),
												array( "id" => 42, "txt" => "密保产品安全绑定", "url" => "index.php?m=mod_agent&c=MiBaoKa&a=Apply" )
								)
				),
				array(
								"name" => "积分管理",
								"cls" => "xsjl",
								"id" => array( 52, 52, 52 ),
								"val" => array(
												array( "id" => 52, "txt" => "积分商品", "url" => "index.php?m=mod_b2b&c=Scored" ),
												array( "id" => 52, "txt" => "积分兑换记录", "url" => "index.php?m=mod_b2b&c=Scored&a=OrderList" ),
												array( "id" => 52, "txt" => "积分累积记录", "url" => "index.php?m=mod_b2b&c=Scored&a=ScoredList" )
								)
				),
				array(
								"name" => "服务与支持",
								"cls" => "kf",
								"id" => array( 16, 18, 19 ),
								"val" => array(
												array( "id" => 16, "txt" => "在线投诉系统", "url" => "index.php?m=mod_agent&c=Complaint" ),
												array( "id" => 18, "txt" => "平台内部短信", "url" => "index.php?m=mod_agent&c=Messenger" ),
												array( "id" => 19, "txt" => "汇款通知书", "url" => "index.php?m=mod_agent&c=Remit&a=Add", "nobr" => 1 ),
												array( "id" => 19, "txt" => "记录", "url" => "index.php?m=mod_agent&c=Remit&a=Mon" )
								)
				),
				array(
								"name" => "淘宝自动充值",
								"cls" => "fw",
								"id" => array( 64, 65, 66 ),
								"val" => array(
												array( "id" => 64, "txt" => "淘宝小店列表/挂机", "url" => "index.php?m=mod_agent&c=Tb" ),
												array( "id" => 65, "txt" => "淘宝小店添加", "url" => "index.php?m=mod_agent&c=Tb&a=Add" ),
												array( "id" => 66, "txt" => "淘宝订单记录", "url" => "index.php?m=mod_agent&c=Tb&a=Orders" )
								)
				)
);
$i = 0;
foreach ( $leftinfo as $item )
{
				$totle = 0;
				foreach ( $item['id'] as $item2 )
				{
								if ( $item['name'] == "淘宝自动充值" && $vd['ainfo']['tbcz'] != 1 )
								{
												continue;
								}
								if ( $item2 == 1002 || $item2 != 1001 && $tmp[$item2] == "1" )
								{
												$totle = 1;
								}
								else if ( $item2 == 1001 && isset( $vd['agent'][9] ) && $vd['agent'][9] == 0 )
								{
												$totle = 1;
								}
				}
				if ( $totle == 1 )
				{
								$go = 1;
								++$i;
								echo "<tr><td><div id=\"menutop\" onclick=\"toggle('div".$i."')\"><span class=\"".$item['cls']."\">".$item['name']."</span></div><div class=\"menumain\" id=\"div".$i."\"><ul>";
								foreach ( $item['val'] as $item1 )
								{
												if ( $item1['id'] == 1002 || $item1['id'] != 1001 && $tmp[$item1['id']] == "1" || $item1['id'] == 1001 && isset( $vd['agent'][9] ) && $vd['agent'][9] == 0 )
												{
																if ( $go )
																{
																				echo "<li><span onMouseOver=\"this.className = 'leftmenubg'\" onMouseOut=\"this.className='none'\"><a href=\"".$vd['root'].$item1['url']."\" target=\"main\">".$item1['txt']."</a>";
																}
																if ( $go == 0 )
																{
																				echo " / <a href=\"".$vd['root'].$item1['url']."\"  target=\"main\">".$item1['txt']."</a>";
																				$go = 1;
																}
																if ( isset( $item1['nobr'] ) )
																{
																				$go = 0;
																}
																if ( $go )
																{
																				echo "</span></li>";
																}
												}
								}
								echo "</ul><div id=\"menubottom\"></div></div></td></tr>";
				}
}
echo "</table>\r\n";
echo "<s";
echo "cript type=\"text/javascript\">\r\n\tfunction RemainAlert(){\r\n    var xmlhttptop;\r\n    \r\n    var obj = document.getElementById(\"mcharemain\");\r\n    \r\n    try{\r\n      xmlhttptop=new XMLHttpRequest();\r\n    }\r\n    catch(e){\r\n      xmlhttptop=new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n    }\r\n    xmlhttptop.onreadystatechange=function(){\r\n      if (xmlhttptop.readyState==4){\r\n        if (xmlhttptop.status==200";
echo "){\r\n          var data=xmlhttptop.responseText;\r\n\r\n          if(data == \"-1\")\r\n          {\r\n          \talert(\"系统已经退出，请重新登陆\");\r\n          \twindow.top.location.href = \"";
echo $vd['root'];
echo "index.php?m=mod_b2b&a=logout\";\r\n          }\r\n          else\r\n          {\r\n          \tif(data.length > 20)\r\n          \t{\r\n          \t\tobj.innerHTML = \"--\";\r\n          \t}\r\n            else\r\n          \t{\r\n              obj.innerHTML = \"";
echo $vd['lang']['moneysymbol'];
echo "\" + data;\r\n            }\r\n          }\r\n          \r\n          \$(\"mchremainid\").style.display = getCookie('umebiz_com_1') == \"0\" ? \"none\" : \"\";\r\n          \$(\"mchparentidid\").style.display = getCookie('umebiz_com_2') == \"0\" ? \"none\" : \"\";\r\n          \$(\"mcharrearsid\").style.display = getCookie('umebiz_com_9') == \"0\" ? \"none\" : \"\";\r\n          \$(\"mchcreditid\").style.display = getCookie('umebiz_com_10') ";
echo "== \"0\" ? \"none\" : \"\";\r\n        }\r\n      }\r\n    }\r\n    xmlhttptop.open(\"post\", \"";
echo $vd['root'];
echo "index.php?m=mod_b2b&c=Frame&a=Remain\", true);\r\n    xmlhttptop.setRequestHeader('Content-type','application/x-www-form-urlencoded');\r\n    xmlhttptop.send('');\r\n  }\r\n  \r\n  setInterval(RemainAlert, 10000);\r\n\r\n  if (screen.width<=1024)\r\n  {\r\n  document.getElementById(\"div3\").style.display=\"none\";\r\n  document.getElementById(\"div4\").style.display=\"none\";\r\n  }\r\n</script>\r\n</body>\r\n</html>\r\n";
?>
