<?php
include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_right.php");
?>
<!doctype html>
<html class="fixed sidebar-left-collapsed">

<head>
	<!-- Basic -->
	<meta charset="UTF-8">
	<title>首頁 | MAA資訊系統</title>
	<meta name="keywords" content="HTML5 Admin Template" />
	<meta name="description" content="JSOFT Admin - Responsive HTML5 Template">
	<meta name="author" content="JSOFT.net">
	<!-- Mobile Metas -->
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

	<!-- Web Fonts  -->
	<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css">
	<!-- Vendor CSS -->
	<link rel="stylesheet" href="/Common/assets/vendor/bootstrap/css/bootstrap.css" />
	<link rel="stylesheet" href="/Common/assets/vendor/font-awesome/css/font-awesome.css" />
	<link rel="stylesheet" href="/Common/assets/vendor/magnific-popup/magnific-popup.css" />
	<link rel="stylesheet" href="/Common/assets/vendor/bootstrap-datepicker/css/datepicker3.css" />
	<link rel="stylesheet" href="/Common/assets/vendor/pnotify/pnotify.custom.css" />
	<!-- Specific Page Vendor CSS -->
	<link rel="stylesheet" href="/Common/assets/vendor/jquery-ui/css/ui-lightness/jquery-ui-1.10.4.custom.css" />
	<link rel="stylesheet" href="/Common/assets/vendor/bootstrap-multiselect/bootstrap-multiselect.css" />
	<link rel="stylesheet" href="/Common/assets/vendor/morris/morris.css" />
	<link rel="stylesheet" href="/Common/assets/vendor/bootstrap-fileupload/bootstrap-fileupload.min.css" />
	<!-- Theme CSS -->
	<link rel="stylesheet" href="/Common/assets/stylesheets/theme.css" />
	<!-- Skin CSS -->
	<link rel="stylesheet" href="/Common/assets/stylesheets/skins/default.css" />
	<!-- Theme Custom CSS -->
	<link rel="stylesheet" href="/Common/assets/stylesheets/theme-custom.css">

	<!-- Head Libs -->
	<script src="assets/vendor/modernizr/modernizr.js"></script>

	<!-- DataTable -->
	<script src="/Common/assets/vendor/jquery/jquery.js"></script>
	<script src="/Common/assets/vendor/jquery-hoverIntent/jquery.hoverIntent.js"></script>

	<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.css">

	<!-- Icon -->
	<link rel="shortcut icon" href="/Common/assets/images/favicon.ico" />

	<!-- vue3 -->
	<script src="https://unpkg.com/vue@next"></script>
	<script src="./script/js/vue-panel.js"></script>

	<style>
		.widget-summary-col-icon {
			padding-right: 10px;
		}

		.widget-summary-col-icon img {
			height: 75px;
			width: 75px;
		}

		.bg-primary .widget-summary .summary-icon {
			background-color: rgba(0, 0, 0, 0);
		}

		.panel-heading-profile-picture img {
			display: block;
			margin: 0 auto;
			width: 100px;
			height: 100px;
			border: 0px;
			-webkit-border-radius: 0px;
			border-radius: 0px;
		}

		p {
			margin: 0 0 0px;
		}
	</style>
</head>

<body>
	<section class="body">
		<!-- start: header -->
		<header class="header">
			<div class="logo-container">
				<div class="banner-txt">MAA資訊系統</div>
				<div class="visible-xs toggle-sidebar-left" data-toggle-class="sidebar-left-opened" data-target="html" data-fire-event="sidebar-left-opened">
					<i class="fa fa-bars" aria-label="Toggle sidebar"></i>
				</div>
			</div>
			<!-- start: search & user box -->
			<div class="header-right">
				<span class="separator"></span>
				<div id="userbox" class="userbox">
					<a href="#" data-toggle="dropdown">
						<figure class="profile-picture"> <img id="userImage" src="/Common/assets/images/!logged-user.jpg" class="img-circle" data-lock-picture="/Common/assets/images/!logged-user.jpg" /> </figure>
						<div class="profile-info" data-lock-name="John Doe" data-lock-email="johndoe@JSOFT.com"> <span class="name"><?php echo $_SESSION['name'] ?></span> <span class="role"><?php echo ($groupName); ?></span> </div> <i class="fa custom-caret"></i>
					</a>
					<div class="dropdown-menu">
						<ul class="list-unstyled">
							<li class="divider"></li>
							<li> <a role="menuitem" tabindex="-1" href="/Common/script/php/Logout.php"><i class="fa fa-power-off"></i> Logout</a> </li>
						</ul>
					</div>
				</div>
			</div>
			<!-- end: search & user box -->
		</header>
		<!-- end: header -->
		<div class="inner-wrapper">
			<!-- start: sidebar -->
			<aside id="sidebar-left" class="sidebar-left">
				<div class="sidebar-header">
					<div class="sidebar-title"> 導覽 </div>
					<div class="sidebar-toggle hidden-xs" data-toggle-class="sidebar-left-collapsed" data-target="html" data-fire-event="sidebar-left-toggle"> <i class="fa fa-bars" aria-label="Toggle sidebar"></i> </div>
				</div>

			</aside>
			<!-- end: sidebar -->
			<section role="main" class="content-body">
				<header class="page-header">
					<h2>綜合登入入口</h2>
				</header>

				<panel-row></panel-row>
			</section>

		</div>

	</section>

	<script>
		var userName = "<?php echo $_SESSION['name'] ?>";
		var role = "<?php echo ($groupName); ?>";
		var right = <?php echo ($right); ?>;
		var rowWidth = 3;
		var panelGroup = [];
		let tempData = [];
		
		panel_data.forEach(function(data){
			if(right >= data.right){
				tempData.push(data);
				if(tempData.length == rowWidth){
					panelGroup.push(tempData);
					tempData = [];
				}
			}	
		})
		if(tempData.length > 0){
			panelGroup.push(tempData);
			tempData = [];
		}

		vm.mount('.body');
	</script>

	<!-- Vendor -->
	<script src="/Common/assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
	<script src="/Common/assets/vendor/bootstrap/js/bootstrap.js"></script>
	<script src="/Common/assets/vendor/nanoscroller/nanoscroller.js"></script>
	<script src="/Common/assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
	<script src="/Common/assets/vendor/magnific-popup/magnific-popup.js"></script>
	<script src="/Common/assets/vendor/jquery-placeholder/jquery.placeholder.js"></script>
	<script src="/Common/script/js/user-image.js"></script>
	<!-- Theme Base, Components and Settings -->
	<script src="assets/javascripts/theme.js"></script>

	<script>
		$(document).ready(function() {
			addUserImage(userName.charAt(0), role);
			localStorage.setItem('myKey', 'Maagis123');
		})

		$('.panel').hoverIntent({
			sensitivity: 50, //滑鼠滑動的敏感度,最少要設定為1    
			interval: 200, //滑鼠滑過後要延遲的秒數    
			over: function(e) {
				e.preventDefault();
				$(this).closest('.panel').find('.panel-body-info').slideDown(200);
			}, //滑鼠滑過要執行的函式   
			timeout: 200, //滑鼠滑出前要延遲的秒數    
			out: function(e) {
				e.preventDefault();
				$(this).closest('.panel').find('.panel-body-info').slideUp(200);
			} //滑鼠滑出要執行的函式
		});
	</script>
</body>

</html>