<?php
/*

	应用主框架

*/

//载入依赖库以及配置
require_once dirname(__FILE__)."/include/global.php";

//载入 日历转换 类
require_once("class/lunar.php");

//读取个人配置
if( $_SESSION["Manager"]["id"] ){
	
	//mysql open
	reader_mysql();
	
	$sql="select * from ".VI_DBMANPRE."admin where id = ".$_SESSION["Manager"]["id"];
	
	$Manager = $db -> getOne($sql);
	
	//mysql close
	reader_mysql(true);
	
}

//开启页面压缩
ob_start("compress");

//header("location:http://www.veryide.com/");


//echo fileext( "class/lunar.php" );

//exit(dirname($_SERVER["REQUEST_URI"]));

/*
echo VI_ROOT;

echo '<br />';

echo $Project["base"];
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Project["charset"];?>" />
<title>VeryIDE Bee* - Powered By VeryIDE</title>
<meta product="<?php echo $Project["product"];?>" />
<link type="text/css" href="style/layout.css" rel="stylesheet" />
<link type="text/css" id="style" href="theme/<?php echo $Manager["theme"] ? $Manager["theme"] : "default";?>/style.css" rel="stylesheet" />
<script type="text/javascript" src="js/mo.js" charset="utf-8"></script>
<script type="text/javascript" src="js/mo.ui.js" charset="utf-8"></script>
<script type="text/javascript" src="js/mo.xml.js" charset="utf-8"></script>
<script type="text/javascript" src="js/mo.hash.js" charset="utf-8"></script>
<script type="text/javascript" src="js/mo.drag.js" charset="utf-8"></script>

<script type="text/javascript" src="js/fx.js" charset="utf-8"></script>
<script type="text/javascript" src="js/serv.js" charset="utf-8"></script>

<script type="text/javascript">
	
	//当前主题
	Mo.store.theme	= "<?php echo $Manager["theme"];?>";
	
	//当前头像
	Mo.store.avatar	= "<?php echo $Manager["avatar"];?>";

	//当前UID
	Mo.store.aid	= "<?php echo $Manager["id"];?>";
		
	//当前用户
	Mo.store.account= "<?php echo $Manager["account"];?>";

</script>
</head>

<body>

	<!--欢迎_开始-->
	<div id="greet">
    
    	<!--欢迎界面_开始-->
		<!--div id="start">
			<div class="logo"></div>
			<div class="load"></div>
		</div-->
        <!--欢迎界面_结束-->        
        <?php
		
		//加载测试工具
		require( VI_ROOT."/dialog/checkin.php" );		
		
		//加载安装界面
		if( !VI_DBMANPRE || !VI_DBMODPRE ){
			require( VI_ROOT."/dialog/install.php" );
		}
		
		?>        
	</div>
	<!--欢迎_结束-->

	<!--页面_开始-->
	<div id="wrapper" style=" display:none;">
    
    	<!--页头_开始-->
        <div id="header">
    
            <!--LOGO_开始-->
            <div id="logo">
                <a href="./"><img src="image/logo.png" /></a>
            </div>
            <!--LOGO__结束-->
		
			<!--快捷方式_开始-->
			<ul id="quick">
				<!--li id="bind_menu"><a href="javascript:void(0);"><img src="image/extra/scummvm2.png" /><br />开始</a></li-->
				<li id="bind_market"><a href="#"><img src="image/extra/netvibes.png" /><br />添加</a></li>
                
				<!--li><a href="javascript:void(0);" onclick="Serv.Apps.open('system','系统管理','safari','start.php');"><img src="image/extra/safari.png" /><br />开始</a></li-->
				<!--li id="bind_admins"><a href="javascript:void(0);"><img src="image/extra/contacts.png" /><br />用户</a></li>
				<li id="bind_system"><a href="javascript:void(0);"><img src="image/extra/settings.png" /><br />系统</a></li>
				<li id="bind_module"><a href="javascript:void(0);"><img src="image/extra/calculator.png" /><br />模块</a></li>
				<li id="bind_stats"><a href="javascript:void(0);"><img src="image/extra/stocks.png" /><br />统计</a></li>				
				
				<li id="bind_addons"><a href="javascript:void(0);"><img src="image/extra/netvibes.png" /><br />应用</a></li-->
				
				<!--li id="bind_tasks"><a href="javascript:void(0);"><img src="image/extra/itunes.png" /><br />任务</a></li-->
				
				<!--li id="bind_widget"><a href="javascript:void(0);"><img src="image/extra/gpsphone.png" /><br />小工具</a></li-->
				<!--li id="bind_addons"><a href="javascript:void(0);"><img src="image/spacer.gif" /></a></li-->				
			</ul>
			<!--快捷方式_开始-->
			
			<div id="addon">
			
			</div>
		
			<!--头像_开始-->
			<div id="avatar">
							
				<a href="javascript:void(0);" id="bind_avatar"><img src="image/face.png" /></a>
				<strong><?php echo $_SESSION["Manager"]["account"] ? $_SESSION["Manager"]["account"] : '<a href="http://www.veryide.com/">谜</a>';?></strong>
				<br />
				<a href="javascript:void(0);" id="bind_account">修改资料</a>

				<?php
				//加载用户偏好
				require( VI_ROOT."/dialog/loader.php" );
				?>
				
			</div>
			<!--头像_结束-->
			
			<!--菜单_开始-->
			<div id="collect" style=" display:none;">
				<ul>
				</ul>
			</div>
			
			<div id="menu" style=" display:none;">
				<?php
				
				/*
				//已登录
				if( $_SESSION["Manager"]["id"] ){
	
					//当前用户组权限设置
					$permit = $VICACHE["sys.group"][$_SESSION["Manager"]["gid"]]["config"];
	
					//模块菜单
					foreach($VICACHE["sys.module"] as $key){
	
						//exit($key["config"]);
	
						//判断模块状态、是否有菜单、是否设置偏好、当前用户是否有权限
						// && strpos($permit,'mod-'.$key["appid"].'-') !== false
						if( isset($key["config"]) && $key["config"] && $key["status"] && $Custom['mod-'.$key["appid"]] != "N" ){
	
							//config
							$file = $Project["module"].$key["config"];
							if( file_exists($file) ) require_once($file);
	
							if( is_array($Modules[$key["appid"]]["menu"]) ){
	
								$icon = '<img src="'.$Project["module"].$key["appid"].'/icon.png" title="'.$key["name"].'" />';
	
								echo '<div><span>'.$icon.$key["name"].'</span></div>';
	
								echo '<ul id="MU-'.$key["appid"].'">';
	
									foreach( $Modules[$key["appid"]]["menu"] as $name => $link ){
	
											echo '<li><a onclick="Serv.Apps.open(\''.$key["appid"].'\',\''.$key["name"].'\',\'\',\''.$link.'\');" href="javascript:void(0);" rel="module/'.$key["appid"]."/".$link.'">'.$name.'</a></li>';
									}
	
								echo '</ul>';
							}
	
						}
	
					}
				
				}
				*/
				
				?>
				<div class="clear"></div>
			</div>
			<!--菜单_开始-->      
        
        </div>
    	<!--页头_结束-->
        
        <!--主体_开始-->
        <div id="container">

			<!--工具_开始-->
			<div id="widget">

			</div>
			<!--工具_结束-->
			
			<!--窗口_开始-->
			<div id="window">

			</div>
			<!--窗口_结束-->
  
			<!--应用_开始-->
			<div id="apps">
	  			
				<dl>					
				</dl>				
	 
			</div>
			<!--应用_结束-->
 
        </div>
        <!--主体_结束-->
    
    	<!--页尾_开始-->
		<div id="footbg"></div>
		
		<div id="footer">
		
			<!--任务栏_开始-->
			<ul id="task">
			</ul>
			<!--任务栏_结束-->
		
			<!--设置栏_开始-->
			<ul id="place">
				<li id="bind_desktop"><a href="javascript:void(0);"></a></li>
				<li id="bind_theme"><a href="javascript:void(0);"></a></li>
				<li id="bind_refresh"><a href="javascript:void(0);"></a></li>
				<li id="bind_custom"><a href="javascript:void(0);"></a></li>
				<li id="bind_logout"><a href="javascript:void(0);"></a></li>
			</ul>
			<!--设置栏_结束-->

			<!--驱动方_开始-->
			<div id="powered">
				<?php echo $Project["powered"];?>
			</div>
			<!--驱动方_结束-->
			
		</div>
    	<!--页尾_结束-->    
    
    </div>
	<!--页面_结束-->
    
</body>
</html>