<?php
include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_right.php");
$folder = "";
if (isset($_POST["folder"])) {
    $folder = $_POST["folder"];
}

?>
<!doctype html>
<html class="fixed">

<head>
	<?php include("bim-support-header.html"); ?>
	<script src="./script/js/jquery.redirect.js"></script>
	<script src="./script/js/global.js"></script>
	<script>
		var userName = "<?php echo $_SESSION['name'] ?>";
		var role = "<?php echo ($groupName); ?>";
		var right = <?php echo ($right); ?>;
		var folderFromVideoPlay = '<?php echo ($folder); ?>';;
		pageHeader = "亞新教育訓練平台";
	</script>
</head>

<body>
	<section class="body">
		<!-- start: header -->
		<header-menu></header-menu>
		<!-- end: header -->
		<div class="inner-wrapper">
			<!-- start: sidebar -->
			<side-bar></side-bar>
			<!-- end: sidebar -->
			<section role="main" class="content-body">
				<header class="page-header">
					<h2>{{pageHeader}}</h2>
				</header>
				<div class="inner-body mg-main" style="margin-left: 0px;">
					<div class="inner-toolbar">
						<ul>
							<search-bar></search-bar>
							<li id="reset" style="padding-top: 10px;">
								<div class="input-group input-search" style="table-layout: auto;">
									<a class="btn btn-primary" href="video-list.php" id="resetbtn" data-toggle="tooltip" data-original-title="" title="">
										<i class="fa fa-undo"></i>
									</a>
								</div>
							</li>
							<button class="mb-xs mt-xs mr-xs btn btn-default right" type="button" style="float: right;" onclick="initList(parent)">回上層</button>
						</ul>
					</div>
					<div class="row" id="video-list"></div>
				</div>
			</section>
		</div>
	</section>
	</div>
	<script>
		vm.mount('.body');
addUserImage(userName.charAt(0),role);
	</script>
	<script src="./script/js/video-list.js"></script>
	<?php include("bim-support-body.html"); ?>

	<script>
		$(".input-search .btn").on("click", function() {
			// alert($("#quicksearch").val());
			$("#video-list").empty();
			search_video($("#quicksearch").val());
		});

		$('.input-search input').on('keyup', function(e) {
			if (e.key === 'Enter' || e.keyCode === 13) {
				$('#video-list').empty();
				search_video($("#quicksearch").val());
			}
		});
	</script>

	</section>
</body>

</html>