<?php
    session_start();
    if(!isset($_SESSION["GSB-User"]) || $_SESSION["GSB-User"] == 0) {
        // header("Location: server/login/login.php");
    }
?>
<!DOCTYPE HTML>

<html lang="hr">

   <head>

      <!--
       ________  _____            __________  _____    ________ 
      /   __   \/  _  \           \____    / /  _  \  /  _____/ 
      \____    /  /_\  \   ______   /     / /  /_\  \/   \  ___ 
         /    /    |    \ /_____/  /     /_/    |    \    \_\  \
        /____/\____|__  /         /_______ \____|__  /\______  /
                      \/                  \/       \/        \/ 
      -->

      <title>9A - GUITAR SONG BOOK</title>

      <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1.0"/>

      <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto">
      <link rel="stylesheet" type="text/css" href="/global-resources/fonts/FontAwesome/fontawesome-pro-5.4.1-web/css/all.min.css">

      <script src="/global-resources/jquery-3.3.1.min.js"></script>

      <style>
          html, body { padding: 0; margin: 0; }
          body { font-family: Roboto, arial, helvetica, sans-serif; }
          #GSBWrapper {
              position: fixed;
              top: 0;
              left: 0;
              right: 0;
              bottom: 0;
          }
          #TSEditorFrame { display: none; }
          #GSBToolbar {
              position: fixed;
              top: 0;
              left: 0;
              right: 0;
              height: 40px;
              /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#6d0019+0,a90329+100 */
              background: #6d0019; /* Old browsers */
              background: -moz-linear-gradient(top, #6d0019 0%, #a90329 100%); /* FF3.6-15 */
              background: -webkit-linear-gradient(top, #6d0019 0%,#a90329 100%); /* Chrome10-25,Safari5.1-6 */
              background: linear-gradient(to bottom, #6d0019 0%,#a90329 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
              filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#6d0019', endColorstr='#a90329',GradientType=0 ); /* IE6-9 */
          }
          #GSBToolbar>div {
              display: inline-block;
              padding: 5px;
          }
          .label { font-size: 18px; color: gainsboro; }
          .value { font-size: 24px; color: white; }
          #logOff {
              float: right;
              border: none;
              background-color: black;
              color: white;
              padding: 0 20px;
              height: 40px;
              cursor: pointer;
          }
          #logOff:hover {
              background-color: transparent;
          }
          .frame {
              position: fixed;
              top: 40px;
              left: 0;
              right: 0;
              bottom: 0;
          }
          iframe {
              border: none;
              width: 100%;
              height: 100%;
          }
      </style>

      <script>
          $(document).ready(function(){
              $("#GSBToolbar span.value").text("<?php echo $_SESSION["GSB-Name"]; ?>");
              $("#logOff").click(function() {
                  $.get("server/login/manageUsers.php", { todo: "LogMeOut" }, function(data) { location.reload(); });
              });
          });
          function toggleToASEditor() {
              $("#TSEditorFrame").fadeOut(300, function() { $("#ASEditorFrame").fadeIn(300); });
          }
          function toggleToTSEditor(ID) {
              $("#ASEditorFrame").fadeOut(300, function() { $("#TSEditorFrame iframe").attr("src", "_ts-editor.php?ID=" + ID); $("#TSEditorFrame").fadeIn(300); });
          }
      </script>

   </head>

   <body class="noselect">
      <div id="GSBWrapper">
          <div id="GSBToolbar"><div><span class="label">Korisnik:</span> <span class="value"></span></div><button id="logOff">ODJAVA</button></div>
          <div id="ASEditorFrame" class="frame"><iframe src="_as-editor.php"></iframe></div>
          <div id="TSEditorFrame" class="frame"><iframe src=""></iframe></div>
      </div>
   </body>

</html>