<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="<{$__APP__}>public/css/common.css" rel="stylesheet" type="text/css" /> 
<script type="text/javascript" src="<{$__PUBLIC__}>js/jquery.min.js"></script> 
<script type="text/javascript" src="<{$__APP__}>public/js/common.js"></script>
<style type="text/css"> 
*{ font: 14px  "微软雅黑","宋体", Arial Narrow, Helvetica; }
a{ font: 14px  "微软雅黑","宋体", Arial Narrow, Helvetica; text-decoration:none; } 
body{ min-width:1400px; margin:0; height:100%; padding:0; background:#fff; margin:0; float:left; }

.top{ width:0 auto; background:#0781C6; border-bottom:1px solid #ccc; height:50px; } 
.top span{ width:190px; height:43px; text-align:center; font-size:22px; color:#fff; padding:10px 10px 0 0; float:left; } 
.top ul{ width:800px; float:left; } 
.top ul a{ height:29px; padding:16px 22px 5px; color:#f8f8f8; margin:0; float:left; font-size:15px; text-decoration:none; }  
.top ul a.top_ch{ color:#f8f8f8; background:#0577B7; } 
.top ul em{ font-weight:100; color:#6AAEBE; margin:17px 0 0 0; font-size:12px; float:left; }

.top h3{ margin:15px 15px 0 0; float:right; color:#FFFFFF; }
.top h3 a{ font-size:14px; color:#FFFFFF; float:left;}
.top h3 em{ font-weight:100; color:#666; margin:2px 10px 0 10px; font-size:12px; float:left;}

.left{ width:200px; top:50px; bottom:0; background:#ECEFF3; position:absolute; }
.left_box{ display:none; }

.ltop{ width:200px; padding:0; float:left;}
.ltop .title{ width:65px; height:100%; bottom:0; background:#353946; position: absolute; float:left;   }
.ltop .title a.lname{ width:65px; padding:15px 0; left:0; cursor:pointer; background:#353946; color:#1282B7; float:left; }
.ltop .title a.lname:first-child{ margin-top:1px; }
.ltop .title a.lname i.arrow{ width:60px; height:27px; float: left; }
.ltop .title a.lname span{ width:60px; color:#fff; text-align:center; padding:2px 0 0 0; float:left; }
.ltop .title a.ch{ background:#50576E; }

.titlecon{ float:left; }
.titlecon ul{ width:130px; position: absolute; top:1px; left:65px; display:none; float:left; } 

.titlecon ul li{ width:135px; padding:0 0; float:left; }
.titlecon ul li em{ width:10px; padding:8px 0 10px 0px; float:left;}
.titlecon ul li a{ width:115px; padding:10px 0 10px 20px; font-size:12px; color:#333; text-decoration:none; float:left;}
.titlecon ul li a.ch{ background:#fff; } 
.titlecon ul li a:before {content: '·'; font-size:14px; margin:0 6px 0 0; color:#333; }

/*右侧菜单*/
.right{ left:200px; width:auto; top:50px; bottom:0; right:0; position:absolute; } 
.login_main{ width:100%; min-width:1200px; left:0px; width:auto; top:0; bottom:0; right:0; padding:0; margin:0; position:absolute; }
.login_main iframe{ margin:0; padding:0; float:left; height:100%; width:100%; }
</style>
</head>
<body>
	<div class="top">
		<span><img src="<{$__APP__}>public/images/admin_logo.png"></span>
		<ul>
			<{foreach from=$data_one item=t key=k}> 
				<a href="javascript:;" parent-id="<{$t.id}>"<{if $k == 0}> class="top_ch"<{else}><{/if}>><{$t.name}></a>
			<{/foreach}> 
			<{if $stock_status == '1'}>
				<a href="stock.php" target="_blank">进销存</a>
			<{/if}>
		</ul>
		<h3>
			<a href="javascript:;" onClick="clear_cache()">清空缓冲</a><em>|</em>
			<a href="http://www.uqcms.com/" target="_blank">系统官方</a><em>|</em>
			<a href="?a=server" target="_blank">系统反馈</a><em>|</em>
			<a href="index.php" target="_blank">网站首页</a><em>|</em>
			<a href="?a=logout">退出登录</a>
		</h3>
	</div>
	<div class="left">
		<div class="ltop">
		<{section name=m loop=$menu}>
			<div class="left_box" id="top_left_<{$menu[m].id}>"> 
				<div class="title">
					<{section name=mm loop=$menu[m].p_menu}>
						<a class="lname" href="javascript:;" data-id="<{$menu[m].p_menu[mm].id}>">
							<i class="arrow" style="background:url(<{$__APP__}>public/images/login/l_<{$menu[m].p_menu[mm].id}>.png) no-repeat center top; background-size:22px;">&nbsp;</i>
							<span><{$menu[m].p_menu[mm].name}></span>
						</a> 
					<{/section}> 
			  	</div>
				<div class="titlecon">
					<{section name=mm loop=$menu[m].p_menu}> 
						<ul class="in_<{$menu[m].p_menu[mm].id}>">
							<{section name=mmm loop=$menu[m].p_menu[mm].sp_menu}> 			
								<li><a href="javascript:;" url="?m=<{$menu[m].p_menu[mm].sp_menu[mmm].method}>&a=<{$menu[m].p_menu[mm].sp_menu[mmm].action}>" menu_id="<{$menu[m].p_menu[mm].sp_menu[mmm].id}>"><{$menu[m].p_menu[mm].sp_menu[mmm].name}></a></li>
							<{/section}>
						</ul>
					<{/section}> 
				</div>
			</div>	
			<{/section}>
		</div>
	</div> 
	<div class="right"> 
		<div class="login_main">
			<iframe name="content" id="content" src="?m=index&a=panel" frameborder="0" scrolling="auto"></iframe>
		</div>
	</div> 
	<div id="ajax_box"></div>
</body> 
</html>
<script type="text/javascript"> 
window.onload = function() {
	if (!window.applicationCache) {
		alert("你的浏览器不支持HTML5,请使用谷歌为内核的浏览器。");
	}
} 
$(function(){ 
	win_h = $(window).height(); 
	function change_window(){
		win_w = $(window).width();
		if(win_w < 1200){
			$('body').css('width',1200+'px'); 
		}else{
			$('body').css('width',100+'%'); 
		}
	}
	change_window();
	$(window).resize(function(){ 
		win_w = $(window).width(); 
		if(win_w < 1200){
			$('body').css('width',1200+'px');
		}else{
			$('body').css('width',100+'%'); 
		} 
	}); 
	$(".left_box:first").show();  
	//------------//
	$(".left_box .title a:first").addClass('ch');  
	//顶部操作
	$(".top ul a").click(function(){
		$this = $(this);
		$this.addClass("top_ch").siblings().removeClass("top_ch"); 
		
		top_id = $this.attr('parent-id'); 
		$("#top_left_"+top_id).show().siblings().hide(); 
		$("#top_left_"+top_id+" .titlecon ul").hide();
		$("#top_left_"+top_id+" .titlecon ul:eq(0)").show();
		$("#top_left_"+top_id+" .titlecon ul li a").removeClass('ch');
		$("#top_left_"+top_id+" .titlecon ul li:eq(0) a").addClass('ch'); 
		// 地址
		url = $("#top_left_"+top_id+" ul li:first a").attr('url'); 
		$("#content").attr('src',url);
		// 大标
		$("#top_left_"+top_id+" .title a").removeClass('ch');
		$("#top_left_"+top_id+" .title a:first").addClass('ch');
	}); 
	//左侧部分
	$(".left ul li a").click(function(){ 
		$this = $(this);
		url = $this.attr('url');
		$("#content").attr('src',url);
		$this.addClass('ch').parents('li').siblings().find('a').removeClass('ch'); 
	}); 
	// 左侧大标
	$(".left_box .title a.lname").click(function(){
		id = $(this).attr('data-id'); 
		$(this).siblings().removeClass('ch');
		$(this).addClass("ch");
		
		$(".titlecon ul.in_"+id).show().siblings().hide();
		$(".titlecon ul.in_"+id+" li a").removeClass('ch');
		$(".titlecon ul.in_"+id+" li:eq(0) a").addClass('ch');  
		 
		url = $(".titlecon ul.in_"+id+" li:eq(0) a").attr('url');
		$("#content").attr('src',url); 
	}); 
	// 让第一个显示
	$(".left_box").each(function(){
		$(this).find('.titlecon ul').eq(0).show();
		$(this).find('.titlecon ul').eq(0).find('li a:eq(0)').addClass('ch').show(); 
	}); 
	
});
function clear_cache(){
	$.get("?m=config&a=temp_clear&path=all&jq_time="+new Date().getTime(), function(result){
		data = jQuery.parseJSON(result);
		if(data.error == '0'){
			$.alert('清空成功');
		}else{
			$.alert(data.msg);
		}
	});
}
</script>