<?php 
  session_start();
	if(!isset($_SESSION['username'])){
  header("HTTP/1.1 301 Moved Permanently");
  header("Location: login.php");
  header("Connection: close");

  exit();
  }
    ?>
<!doctype html>
 
<html lang="cs">
<head>
  <meta charset="utf-8" />
  <title>jQuery UI Button - Toolbar</title>
  <link rel="stylesheet" href="jquery-ui.max.css" />
  <link rel="stylesheet" href="styl.css" />
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  <script type="text/javascript">
  if (typeof jQuery == 'undefined') {
        document.write(unescape("%3Cscript src='js/jquery.js' type='text/javascript'%3E%3C/script%3E"));
    }
  </script>
  <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
  <script type="text/javascript">
  if (typeof jQuery.ui == 'undefined') {
        document.write(unescape("%3Cscript src='js/jquery-ui.min.js' type='text/javascript'%3E%3C/script%3E"));
  }
  </script>
  
  

  <script>
 
  
  $(function() {
  
   $('#tabs').tabs({
        cache: false,
        beforeActivate: function (event, ui) {
           ui.oldPanel.empty();
         
           

        }
    });

 $(function() {
  $(this).ajaxStart(function() {
    $("#ajaxLoading").show(); });
  $(this).ajaxStop(function() {
    $("#ajaxLoading").hide(); });
  $(this).ajaxError(function() {
    $("#ajaxLoading").hide(); });
 });
 


 
  });
  </script>
  
</head>
<body>
<h1>Přístupový registrační systém - administrátorské rozhraní</h1> 
<div id="tabs">
    <ul>
        <li><a href="attend.php"><img src="dochazka.png" /><span style="font-size:13pt;">Docházka</span></a>
        </li>
        <?php if(($_SESSION['rights']== 'G') || ($session['rights'] == 'A')) 
        echo " <li><a href=\"users.php\"><img src=\"user.png\" /><span style=\"font-size:13pt;\">Uživatelé</span></a>
        </li>";
        
        if($_SESSION['rights']== 'A')
        echo " <li><a href=\"groups.php\"><img src=\"group.png\" /><span style=\"font-size:13pt;\">Skupiny</span></a>
        </li>";
        ?>
        
        <li><a href="stats.php"><img src="stats.png"><span style="font-size:13pt;">Statistiky</span></a>
        </li>
        <li><a href="settings.php"><img src="settings.png"><span style="font-size:13pt;">Nastavení</span></a>
        </li>
        <div style="margin-right: auto%; margin-left: 87%;">
        
         
            
            
            <?php 
            echo date("Y-m-d");
            echo "<br /><u>Přihlášený uživatel:</u><br />";
            echo $_SESSION[ 'username']; ?>
            <br /><a href="logout.php" style="color: #024890; ">Odhlásit se</a>
        </div>
    </ul>
    <img style="display: block;
  margin-left: auto;
  margin-right: auto;" id="ajaxLoading" src="loading.gif" />
</div>
<div id="footer"><b>Diplomová práce - Martin Tříska @ FEKT VUT Brno - 2013</b>
</div>
 
</body>
</html>