<?php
include($_SERVER['DOCUMENT_ROOT'] . "/Authorization/script/php/permission/check_right.php");

if (isset($_POST["id"])) {
    $id = $_POST["id"];
}
$folder = "";
if (isset($_POST["folder"])) {
    $folder = $_POST["folder"];
}


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

<head>
    <?php include("bim-support-header.html"); ?>
    <link href="https://vjs.zencdn.net/7.17.0/video-js.css" rel="stylesheet">
    <script src="./script/js/global.js"></script>
    <script src="./script/js/jquery.redirect.js"></script>

    <script>
        var userName = "<?php echo $_SESSION['name'] ?>";
		var role = "<?php echo ($groupName); ?>";
		var right = <?php echo ($right); ?>;
        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 id="header">{{pageHeader}}</h2>
                    <button class="mb-xs mt-xs mr-xs btn btn-default right" type="button" style="float: right;" onclick="returnToList(folder)">回上層</button>
                </header>
                <div class="row">
                    <div class="col-md-9">
                        <section class="panel" id="video-body">
                            <video class="video-js vjs-big-play-centered vjs-16-9" controls="" width="100%" data-setup="{}" id="video" poster="/Common/assets/images/video-loading.gif" preload="auto">
                                <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="https://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
                            </video>
                            <div class="panel-body" style="color:black;">
                                <h4>課程簡介</h4>
                                <text id="description"></text>
                            </div>
                        </section>
                    </div>
                    <div class="col-md-3">
                        <section class="panel" id="video-list-panel">
                            <div class="panel-body" style="height: 100%;overflow: auto;">
                                <span>相關影片</span>
                                <ul class="nav nav-main" id="video-list"></ul>
                            </div>
                        </section>
                    </div>
                    <div class="col-md-3">
                        <section class="panel" id="file-list-panel">
                            <div class="panel-body" style="height: 100%;overflow: auto;">
                                <span>參考檔案</span>
                                <ul class="nav nav-main" id="file-list"></ul>
                            </div>
                        </section>
                    </div>

                </div>
        </div>
    </section>
    </div>
    <script src="https://vjs.zencdn.net/7.17.0/video.min.js"></script>
    <script>
        vm.mount('.body');
addUserImage(userName.charAt(0),role);
        var id = '<?php echo ($id); ?>';
        var folder = '<?php echo ($folder); ?>';
    </script>
    <script src="./script/js/video-play.js"></script>
    <?php include("bim-support-body.html"); ?>
    </section>
</body>

</html>