<?php
	!defined('IN_MANAGE') && exit('Access Denied!');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link href="admin/template/images/tm_core.css" type="text/css" rel="stylesheet" />
<link href="statics/ui-jquery/jquery-ui.css" type="text/css" rel="stylesheet" />
<title>网站管理后台</title>
<script language="javascript" src="statics/ui-jquery/jquery-1.8.3.js"></script>
<script language="javascript" src="statics/ui-jquery/jquery-ui.js"></script>
<script language="javascript" src="admin/template/images/tm-core.js"></script>
<script language="javascript">
$(document).ready(function(){
	autoHeight('left-wrap',117);
	autoHeight('right-wrap',117);
	autoHeight('iframe-wrap',127);
	<?php if($usermodule2){?>
	eval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[0-6]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$("#moremenu a").3(0(){$(1).2().4("5").slideDown(\'6\').show();$(1).2().3(0(){},0(){$(1).2().4("5").fadeOut(\'6\')})});',[],7,'function|this|parent|hover|find|ul|fast'.split('|'),0,{}))
	<?php }?>
});
function adminmenu(moduleid,nowid)
{
	var adminmenutitle=new Array();
	<?php foreach($usermodule as $r){ ?>
	adminmenutitle[<?php echo $r['id'];?>]='<?php echo $r['name'];?>';
	<?php }?>
	var url='<?php echo ADMIN_FILE;?>?action=leftmenu&moduleid='+moduleid;
	$.post(url, function(data){
		$('#adminmenutitle').html(adminmenutitle[moduleid]);
		$('#adminmenu').html(data);
	});
	
	for(var i=0;i<<?php echo sizeof($usermodule);?>;i++)
	{
		$('#topmenu_'+i).removeClass('hover');
	}
	eval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[0-7]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(\'#0\'+1).addClass(\'hover\');$(\'#0\'+1).4(\'加载中...\');$(\'#5\').6();$(\'#2-3\').7();$("#2-3").load(function(){$(\'#5\').7();$(\'#2-3\').6();$(\'#0\'+1).4(adminmenutitle[moduleid])});',[],8,'topmenu_|nowid|iframe|wrap|html|loading|show|hide'.split('|'),0,{}))
}

function sysmenu(moduleid,nowid)
{
	var adminmenutitle=new Array();
	<?php foreach($systemmodule as $r){ ?>
	adminmenutitle[<?php echo $r['id'];?>]='<?php echo $r['name'];?>';
	<?php }?>
	var url='<?php echo ADMIN_FILE;?>?action=leftmenu&moduleid='+moduleid;
	$.post(url, function(data){
		$('#adminmenutitle').html(adminmenutitle[moduleid]);
		$('#adminmenu').html(data);
	});
	
	for(var i=0;i<<?php echo sizeof($usermodule);?>;i++)
	{
		$('#topsysmenu_'+i).removeClass('hover');
	}
	
	$('#topsysmenu_'+nowid).addClass('hover');
	
	eval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[0-7]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('$(\'#2\'+3).4(\'加载中...\');$(\'#5\').6();$(\'#0-1\').7();$("#0-1").load(function(){$(\'#5\').7();$(\'#0-1\').6();$(\'#2\'+3).4(adminmenutitle[moduleid])});',[],8,'iframe|wrap|topsysmenu_|nowid|html|loading|show|hide'.split('|'),0,{})) 
}
</script>
</head>

<body>
<!-- head start -->
<div class="top-div">
	<div class="logo"><a href="<?php echo LA_PATH.ADMIN_FILE;?>"><img src="admin/template/images/logo.png" /></a></div>
	<div class="words-nav">
		<ul>
			<?php 
			foreach($systemmodule as $no => $r){
			if(($r['folder']!='mysql' && (in_array($_userid,$admin_founders) || in_array($_roleid,explode(',',$r['adminrole'])))) || in_array($_userid,$admin_founders)){
			?>
			<li><a id="topsysmenu_<?php echo $no;?>" href="?mod=<?php echo $r['folder'];?>&file=<?php echo $r['folder'];?>" target="iframe-wrap" onclick="javascript:sysmenu(<?php echo $r['id'];?>,<?php echo $no;?>);"><?php echo $r['name'];?></a></li>
			<?php }}?>
			<?php if(in_array($_userid,$admin_founders)){?><li><a href="?mod=config&file=config&action=module" target="iframe-wrap">模块管理</a></li><?php }?>

		</ul>
	</div>
	<div class="button-nav">
		<ul>
			<li><a href="<?php echo LA_PATH;?>" target="_blank" class="adminindex"></a></li>
			<li><a href="<?php echo LA_PATH.ADMIN_FILE;?>" class="wwwindex"></a></li>
			<?php if(SITETYPE){?><li class="nomargin"><a href="?mod=config&file=config&action=siteid" target="iframe-wrap" class="createindex"></a></li><?php }?>
		</ul>
		<div class="admin-info"><?php echo $adminobj->getrolename($_roleid);?>：<font color="#FF3300"><?php echo $_username;?> </font><a href="<?php echo ADMIN_FILE;?>?file=login&action=logout">[注销]</a></div>
	</div>
</div>
<div class="main-bannber" style="">
	<ul>
		<li class="leftborder"></li>
		<?php 
		foreach($usermodule1 as $no => $r){
		if(in_array($_userid,$admin_founders) || in_array($_roleid,explode(',',$r['adminrole']))){
		?>
		<li><a id="topmenu_<?php echo $no;?>" href="?mod=<?php echo $r['folder'];?>&file=<?php echo $r['folder'];?>" target="iframe-wrap" onclick="javascript:adminmenu(<?php echo $r['id'];?>,<?php echo $no;?>);"><?php echo $r['name'];?></a></li>
		<li <?php if(sizeof($usermodule)>($no+1)){?>class="midborder"<?php }else{?> id="moremenu"<?php }?>></li>
		<?php }}?>
		
		<li class="rightborder"></li>
	</ul>
</div>
<!-- head end -->
<!-- main start -->
<div class="body-wrap">
	<div class="left-wrap" id="left-wrap">
		<div class="small-wrap">
			<div class="title" id="adminmenutitle">后台管理</div>
			<ul id="adminmenu">
				<?php 
				foreach($systemmodule as $no => $r){
				if(in_array($_userid,$admin_founders) || in_array($_roleid,explode(',',$r['adminrole']))){
				?>
				<li><a href="javascript:void(0);" onclick="javascript:adminmenu(<?php echo $r['id'];?>);"><?php echo $r['name'];?></a></li>
				<?php }}?>
				<?php if(in_array($_userid,$admin_founders)){?><li class="noborder"><a href="?mod=config&file=config&action=module" target="iframe-wrap">模块管理</a></li><?php }?>
			</ul>
		</div>
	</div>
	<div class="right-wrap" id="right-wrap" <?php echo $_SESSION['w']<=1024?'style="width:78%" ':'';?>>
		<div id="loading" style="display:none"><img src="admin/template/images/loading.gif" /></div>
		<iframe frameborder="0" name="iframe-wrap" id="iframe-wrap" src="?mod=config&file=config&action=main" width="100%" scrolling="1"></iframe>
	</div>
</div>
<div class="admin-nav"><a  href="?mod=config&file=config&action=cache" target="iframe-wrap">&nbsp;</a></div>
<div class="admin-statics" id="admin-statics" style="display:none">
	<div style=" background-color:#F5F5F5; font-weight:bold; padding:4px;"><span style="float:right; font-weight:normal; font-size:12px"><a href="javascript:void(0);" onclick="$('#admin-statics').hide('slow');">关闭</a></span>信息统计</div>
	<table width="100%">
	<?php foreach($usermodule as $r){ ?>
	<?php if(in_array($r['folder'],array('news','fang','shangwu','jiaoyou','auto','chongwu','shichang','hr'))){?>
	<tr><td><?php echo $r['name'];?>：</td><td>共 <a style="color:#FF0000" href="?mod=<?php echo $r['folder'];?>&file=<?php echo $r['folder'];?>&action=manage&status=0"  target="iframe-wrap"><?php echo $conobj->constatis($r['id'],0,-1);?></a> 条</td><td> &nbsp;待审核<a style="color:#FF0000" href="?mod=<?php echo $r['folder'];?>&file=<?php echo $r['folder'];?>&action=manage&status=0" target="iframe-wrap"><?php echo $conobj->constatis($r['id'],0,0);?></a>条</td></tr>	
	<?php }}?>
	<tr><td>商家店铺：</td><td>共 <a style="color:#FF0000" href="?mod=yp&file=yp&action=manage"  target="iframe-wrap"><?php echo $ypobj->ypstatis(16,-1);?></a> 条</td><td> &nbsp;待审核<a style="color:#FF0000" href="?mod=yp&file=yp&action=manage&status=0" target="iframe-wrap"><?php echo $ypobj->ypstatis(16,0);?></a>条</td></tr>
	<tr><td>团购统计：</td><td>共 <a style="color:#FF0000" href="?mod=tuan&file=tuan&action=manage"  target="iframe-wrap"><?php echo $tuanobj->goodsstatis(18,-1);?></a> 条</td><td> &nbsp;待审核<a style="color:#FF0000" href="?mod=tuan&file=tuan&action=manage&status=0" target="iframe-wrap"><?php echo $tuanobj->goodsstatis(18,0);?></a>条</td></tr>
	<tr><td>商品统计：</td><td>共 <a style="color:#FF0000" href="?mod=shop&file=shop&action=goods"  target="iframe-wrap"><?php echo $shopobj->goodsstatis(17,-1);?></a> 条</td><td> &nbsp;待审核<a style="color:#FF0000" href="?mod=shop&file=shop&action=goods&status=0" target="iframe-wrap"><?php echo $shopobj->goodsstatis(17,0);?></a>条</td></tr>
	<tr><td>问题统计：</td><td>共 <a style="color:#FF0000" href="?mod=ask&file=ask&action=question"  target="iframe-wrap"><?php echo $askobj->questionstatis(20,-1);?></a> 条</td><td> &nbsp;待审核<a style="color:#FF0000" href="?mod=ask&file=ask&action=question&status=0" target="iframe-wrap"><?php echo $askobj->questionstatis(20,0);?></a>条</td></tr>
	<tr><td>论坛主题：</td><td>共 <a style="color:#FF0000" href="?mod=bbs&file=bbs&action=thread"  target="iframe-wrap"><?php echo $bbsobj->threadstatis(19,-1);?></a> 条</td><td> &nbsp;待审核<a style="color:#FF0000" href="?mod=bbs&file=bbs&action=thread&status=0" target="iframe-wrap"><?php echo $bbsobj->threadstatis(19,0);?></a>条</td></tr>
	</table>
</div>
<!-- main end -->
</body>
</html>
