<?php
header("Content-type:text/html;charset=utf-8"); 
session_start();
$session_admin = isset($_SESSION['admin']) ? $_SESSION['admin'] : ''; 
if ($session_admin == '') {
	Header('Location: logout.php');
}
?>
<!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>
<title><?php require("info/title.php"); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link type="text/css" rel="stylesheet" href="css/base.css" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />

<style type="text/css">
html,body{margin:0;padding:0;width:100%;height:100%}
body{margin:0;padding:0;overflow-x:hidden;overflow-y:hidden;font:12px Helvetica,Arial,sans-serif;background-color:#f4f4f4;}
#client_top{margin:0;padding:0;width:100%;height:25px;border-bottom:1px solid #dadada;background-color:#ffffff;}
#client_left{float:left;margin:0;padding:0 0 0 8px;width:183px;height:520px;overflow-x:hidden;overflow-y:auto;}
#client_right{float:right;margin:0;padding:0;width:600px;height:520px;overflow-x:hidden;overflow-y:hidden;}
#childframe{margin:0;padding:0;width:600px;height:520px;border:0;}
.slipt {clear:both;margin:0;padding:0;height:10px;width:150px;} 
/* vmenu */
.vmenu {margin:0;padding:0;width:175px;list-style-type:none;font-size:13px;font-weight:normal;border:1px solid #d8d8d8;}
.vmenu a {color:#757575;text-decoration:none;cursor:pointer;}
.vmenu li {margin:0;padding:4px 10px 0 20px;height:21px;color:#3e3e3e;border-bottom:1px solid #e5e5e5;background-color:#FFFFFF;}
.vmenu li.title {padding-left:10px;color:#3e3e3e;font-weight:bold;background:url(images/vmenu_title.png) repeat-x;}
.vmenu li.selected {background:url(images/vmenu_item_selected.png) no-repeat;color:#FFFFFF;}
</style>

<script type="text/javascript">
function openPage(obj, pagename) {
	var childframe = document.getElementById("childframe");
	childframe.src = "pages/" + pagename;
	
	var client_left = document.getElementById("client_left");
	var objs_li = client_left.getElementsByTagName("li");
	for (var i = 0; i < objs_li.length; i++) { 
		if (objs_li[i].className == "selected") objs_li[i].className = "";
	}	
	
	var objs_li = obj.getElementsByTagName("li");
	for (var i = 0; i < objs_li.length; i++) { 
		if (objs_li[i].className != "selected") objs_li[i].className = "selected";
	}		
}//openPage

function resizePage() {
	var clientWidth = document.body.clientWidth;
	var clientHeight = document.body.clientHeight;
	
	var client_left = document.getElementById("client_left");
	client_left.style.height = (clientHeight - 26) + "px";

	var client_right = document.getElementById("client_right");
	client_right.style.width = (clientWidth - 191) + "px";	
	client_right.style.height = (clientHeight - 26) + "px";	

	var childframe = document.getElementById("childframe");
	childframe.style.width = (clientWidth - 191) + "px";	
	childframe.style.height = (clientHeight - 26) + "px";	
}//resizePage

window.onload = function() { 
	resizePage();
};//onload

window.onresize = function() { 
	resizePage();
};//onresize
</script>

</head>
<body>

<div id="client_top">
	<div style="clear:both;margin:0 auto;padding:0;width:100%;height:26px;color:#ffffff;background-color:#068cbf">
		<div style="float:left;margin:0;padding:2px 10px 0 5px;font-size:18px;font-weight:bold;"><?php require("info/title.php"); ?></div>
		<div style="float:right;margin:0;padding:3px 3px 0 0;font-size:12px;text-align:right;">
			<?php echo '管理员: ' . $_SESSION['admin'] . '&nbsp;&nbsp;'; echo '登录时间: ' . $_SESSION['logintime'] . '&nbsp;'; ?>
			<input class="cssbtn" type="button" value="注销" onclick="window.location='logout.php'" />
		</div>
	</div>
</div>
<div id="client_left">
	<div class="slipt"></div>
	<ul class="vmenu">
		<li class="title">用户帐号</li>
		<a href="javascript:void(0)" onclick="openPage(this, 'departments.php');"><li class="selected">组织机构</li></a>
		<a href="javascript:void(0)" onclick="openPage(this, 'users.php');"><li>内部帐号</li></a>
		<a href="javascript:void(0)" onclick="openPage(this, 'publicusers.php');"><li>外部帐号</li></a>
		<a href="javascript:void(0)" onclick="openPage(this, 'accounts.php');"><li>发布与注册</li></a>
	</ul>		
	<div class="slipt"></div>
	<ul class="vmenu">
		<li class="title">群组/讨论组</li>
		<a href="javascript:void(0)" onclick="openPage(this, 'groups.php');"><li>群组</li></a>
		<a href="javascript:void(0)" onclick="openPage(this, 'rooms.php');"><li>讨论组</li></a>
	</ul>	
	<div class="slipt"></div>			
	<ul class="vmenu">
		<li class="title">应用中心</li>
		<a href="javascript:void(0)" onclick="openPage(this, 'webapps.php');"><li>内部应用</li></a>
		<a href="javascript:void(0)" onclick="openPage(this, 'publicwebapps.php');"><li>外部应用</li></a>
	</ul>
	<div class="slipt"></div>
	<ul class="vmenu">
		<li class="title">系统管理</li>
		<a href="javascript:void(0)" onclick="openPage(this, 'sysmsgs.php');"><li>系统消息</li></a>
		<a href="javascript:void(0)" onclick="openPage(this, 'admins.php');"><li>管理员</li></a>
	</ul>
	<div class="slipt"></div>
	<div class="slipt"></div>
	<div class="slipt"></div>
	<div class="slipt"></div>
</div>
<div id="client_right">
	<iframe id="childframe" frameborder="no" border="0" src="pages/departments.php"></iframe>
</td>	

</body>
</html>
