<?php
session_start();
//Can't come in without logged in
if (!isset($_SESSION['loggedin'])) {
	header('Location: pages-signin.html');
	exit;
}
?>

<!DOCTYPE html>
<html class="fixed js flexbox flexboxlegacy csstransforms csstransforms3d no-overflowscrolling no-mobile-device custom-scroll sidebar-left-collapsed" style="">

<head>
    <!-- jstree CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/themes/default/style.min.css">
    <meta charset="UTF-8">
    <title>資料庫管理</title>
    <meta content="HTML5 Admin Template" name="keywords">
    <meta content="JSOFT Admin - Responsive HTML5 Template" name="description">
    <meta content="JSOFT.net" name="author">
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><!-- Mobile Metas -->
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"><!-- Unity CSS -->

    <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 href="assets/vendor/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="assets/vendor/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="assets/vendor/magnific-popup/magnific-popup.css" rel="stylesheet">
    <link href="assets/vendor/bootstrap-datepicker/css/datepicker3.css" rel="stylesheet">
    <link href="assets/vendor/pnotify/pnotify.custom.css" rel="stylesheet"><!-- Specific Page Vendor CSS -->
    <link href="assets/vendor/jquery-ui/css/ui-lightness/jquery-ui-1.10.4.custom.css" rel="stylesheet">
    <link href="assets/vendor/bootstrap-multiselect/bootstrap-multiselect.css" rel="stylesheet">
    <link href="assets/vendor/morris/morris.css" rel="stylesheet">
    <link href="assets/vendor/bootstrap-fileupload/bootstrap-fileupload.min.css" rel="stylesheet">
    
    <link href="assets/stylesheets/theme.css" rel="stylesheet"><!-- Skin CSS -->
    <link href="assets/stylesheets/skins/default.css" rel="stylesheet"><!-- Theme Custom CSS -->
    <link href="assets/stylesheets/theme-custom.css" rel="stylesheet">
    <link href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.css" rel="stylesheet" type="text/css"><!-- Icon -->
    <link rel="stylesheet" href="assets/vendor/jquery-datatables-bs3/assets/css/datatables.css" />
    <link href="assets/images/favicon.ico" rel="shortcut icon"><!-- 資料庫管理CSS -->
    <link href="./script/css/bim-support.css" rel="stylesheet" type="text/css"><!-- Head Libs -->

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

    <script src="https://cdn.jsdelivr.net/npm/chart.js@3.1.1"></script><!-- DataTable -->

    <script src="assets/vendor/jquery/jquery.js"></script>    
    <script charset="utf8" src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.js" type="text/javascript"></script>
    <script src="assets/vendor/pnotify/pnotify.custom.js"></script>
    
    <style type="text/css">
        .jqstooltip {
            position: absolute;
            left: 0px;
            top: 0px;
            visibility: hidden;
            background: rgb(0, 0, 0) transparent;
            background-color: rgba(0, 0, 0, 0.6);
            filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);
            -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
            color: white;
            font: 10px arial, san serif;
            text-align: left;
            white-space: nowrap;
            padding: 5px;
            border: 1px solid white;
            z-index: 10000;
        }

        .jstree-default .jstree-icon {
            color: #ffe693;
        }

        .jqsfield {
            color: white;
            font: 10px arial, san serif;
            text-align: left;
        }

        td,
        th {
            text-align: center;

        }

        th {
            width: 30%;
        }

        .node-hidden {
            display: none;
        }


        #datatable-ajax tr:hover {
            background-color: #e8e8e8;
        }
    </style>
</head>

<body>
    
    <script type="application/javascript">
        var i = 0;
        var download;
        var fileName;
        var folder;
        var software;
        var userName = 'maabim';
        var searchURL = window.location.search;
        searchURL = searchURL.substring(1, searchURL.length);
        object = decodeURIComponent(searchURL.split("&")[0].split("=")[1]);  
    </script>    
    <section class="body" data-v-app="">
        <!-- start: header -->
        <header class="header">
            <div class="logo-container">
                <div class="banner-txt">
                    資料庫管理
                </div>
                <div class="visible-xs toggle-sidebar-left" data-fire-event="sidebar-left-opened" data-target="html" data-toggle-class="sidebar-left-opened"></div>
            </div><!-- start: search & user box -->
            <div class="header-right">
                <div class="userbox" id="userbox">
                    <a data-toggle="dropdown" href="#">
                        <figure class="profile-picture">
                            <img alt="Joseph Doe" class="img-circle" data-lock-picture="assets/images/!logged-user.jpg" src="assets/images/!logged-user.jpg">
                        </figure>
                        <div class="profile-info" data-lock-email="johndoe@JSOFT.com" data-lock-name="John Doe">
                            <span class="name"><?php echo $_SESSION['name'] ?></span> <span class="role">administrator</span>
                        </div>
                    </a>
                    <div class="dropdown-menu">
                        <ul class="list-unstyled">
                            <li>
                                <a href="./script/php/Logout.php" role="menuitem" tabindex="-1">Logout</a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div><!-- end: search & user box -->
        </header><!-- end: header -->
        <div class="inner-wrapper">
            <!-- start: sidebar -->
            <section class="content-body" role="main">
                <section class="content-with-menu content-with-menu-has-toolbar media-gallery " style="margin: -220px -40px -53px -40px;">
                    <div class="content-with-menu-container">
                        <div class="inner-menu-toggle">
                            <a class="inner-menu-expand" data-open="inner-menu" href="#">Show Bar</a>
                        </div>
                        <menu class="inner-menu" id="content-menu" role="menu" style="left:0; width:373px; top:60px;">
                            <div class="nano has-scrollbar">
                                <div class="nano-content" style="right: -17px;" tabindex="0">
                                    <div class="inner-menu-toggle-inside">
                                        <a class="inner-menu-collapse" href="#">Hide Bar</a> <a class="inner-menu-expand" data-open="inner-menu" href="#">Show Bar</a>
                                    </div>
                                    <div class="inner-menu-content">
                                        <div class="sidebar-widget m-none">
                                            <div class="widget-header clearfix">
                                                <h6 class="title pull-left mt-xs">資料庫文件</h6>
                                            </div>
                                            <div class="widget-content">
                                                <div class="jstree jstree-1 jstree-default" id="treeAjaxHTML"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="nano-pane" style="display: none; opacity: 1; visibility: visible;">
                                <div class="nano-slider" style="height: 838px; transform: translate(0px, 0px);"></div>
                            </div>
                        </menu>
                    </div>
                    <div class="inner-body mg-main">
                        <div class="inner-toolbar" style="top:60px;">
                            <ul>
                                <li style="padding-top: 10px;">
                                    <div class="input-group input-search" style="table-layout: auto;"><input type="text" class="form-control" name="search" id="search" placeholder="Search..."><span class="input-group-btn"><button class="btn btn-default" id="btn-search"><i class="fa fa-search"></i></button></span></div>
                                </li>
                                <li class="right">
                                    <a id="reset">上一層</a>
                                </li>
                            </ul>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <section class="panel">
                                    <div class="panel-body">
                                        <br>
                                        <table style="width:99%;" class="table table-bordered table-striped" id="datatable-ajax">
                                            <thead>
                                                <tr>
                                                    <th width="33%">項次</th>
                                                    <th width="34%">資料名稱</th>
                                                    <th width="33%">版次</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </div>
                                </section>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12">
                                <section class="panel">
                                    <div class="panel-body">
                                        <div class="table-responsive">
                                            <table class="table table-bordered mb-none" id="tableDetail">
                                                <tbody>
                                                    <tr>
                                                        <th>計畫編號</th>
                                                        <td id="plan_code"></td>
                                                    </tr>
                                                    <tr>
                                                        <th>計畫名稱</th>
                                                        <td id="plan_name"></td>
                                                    </tr>
                                                    <tr>
                                                        <th>資料名稱</th>
                                                        <td id="fileName"></td>
                                                    </tr>
                                                    <tr>
                                                        <th>上傳日期</th>
                                                        <td id="time"></td>
                                                    </tr>
                                                    <tr>
                                                        <th>版次</th>
                                                        <td id="version"></td>
                                                    </tr>
                                                    <tr>
                                                        <th>文件</th>
                                                        <td id="download"></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </section>
                            </div>
                        </div>
                    </div>
                </section>
            </section>
        </div>
    </section><!-- end: page -->
    
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/jstree.min.js"></script>
    <script src="./script/js/jstreeAJAX.js"></script>
   

    
    
   
    
    
</body>

</html>