<?php
if (session_status() == PHP_SESSION_NONE && session_id() == '') {
    session_start();
}
include 'config.php';
require("connect.php");
error_reporting(0);
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <?php
    if(!isset($_SESSION['susername']) && !strpos($_SERVER['REQUEST_URI'],'index.php')){
  //  echo "<script>console.log('".$_SERVER['REQUEST_URI']."');</script>";
        // header("Location: index.php");
        echo "<script>window.location.href='index.php';</script>";
    }
    if(isset($_SESSION['susername']) && strpos($_SERVER['REQUEST_URI'],'index.php')){
        // header("Location: index0.php");
        echo "<script>window.location.href='index0.php';</script>";
    }
    if(isset($_SESSION['susername']) && $_SESSION['susername']=='approve' && !(strpos($_SERVER['REQUEST_URI'],'allpar.php') || strpos($_SERVER['REQUEST_URI'],'controlpar_view.php'))){
        echo "<script>window.location.href='allpar.php';</script>";
    }
	
	echo $_SESSION['susername'];
	echo $_SESSION['super'];
 ?>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>MEDFRIGO MEDSCAN</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="MedFrigo MedScan">
    <meta name="author" content="Dynacomp">

    <!-- The styles -->
    <link id="bs-css" href="css/bootstrap.min.css" rel="stylesheet">
    <link href='css/jquery-ui-1.8.21.custom.css' rel='stylesheet'>
    <link href='css/bootstrap-select.css' rel='stylesheet'>
    <link href='css/uploadify.css' rel='stylesheet'>
    <link href='css/animate.min.css' rel='stylesheet'>
    <link rel="stylesheet" href="alertify/themes/alertify.core.css" />
    <link rel="stylesheet" href="alertify/themes/alertify.bootstrap.css" />
    <link rel="stylesheet" href="js/DataTables-1.10.15/css/dataTables.bootstrap.css"></link>

    <!-- jQuery -->

    <script src="js/jQuery-2.2.4/jquery-2.2.4.min.js"></script>
    <script src="js_ui.js"></script>
    <script src="alertify/lib/alertify.min.js"></script>
    <script src="js/bootstrap.js"></script>
    <script src="js/bootstrap-select.js"></script>

    <!-- The fav icon -->
    <link rel="shortcut icon" href="img/favicon.ico">
    <style>
        .logo{
            height:50px;
            margin-left:10px;
        }
        footer {
            /* position: fixed; */
            height: 100px;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>

<body>
<?php
if (!isset($no_visible_elements) || !$no_visible_elements) { ?>
    <!-- topbar starts -->
    <div class="navbar navbar-default" role="navigation">

        <div class="navbar-inner">
            <div class="row">
              <div class="col-sm-2">
                <a href="index0.php"> <img alt="Charisma Logo" class="logo" src="source/logo_v1.svg" /></a>
              </div>
              <div class="col-sm-8" align="center">
                <ul class="nav navbar-nav">
                  <li class="active"><?php //echo $_SESSION['super']; echo " ".$_SESSION['susername']; echo " ".$_SESSION['sid2']; ?></li>
                  <!--<li><a href="Cvall.php">Έλεγχοι SELONDA</a></li>
                  <li><a href="Cvall2.php">Έλεγχοι SELONDA 2</a></li>
                  <li><a href="medView.php">Έλεγχοι MEDFRIGO</a></li>
                  <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">Στατιστικά
                    <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                      <li><a href="chart1.php">Chart Total(Selonda)</a></li>
                      <li><a href="iceChart.php">Chart Ice(Selonda)</a></li>
                      <li><a href="weightChart.php">Chart Weight(Selonda)</a></li>
                      <li><a href="eChart.php">Chart E(Selonda)</a></li>
                      <li><a href="chartall.php">Chart Χαρακτηριστικά</a></li>
                      <li><a href="suneik.php">Συν. Εικόνα</a></li>
                    </ul>
                  </li>-->
                </ul>
              </div>
              <div class="col-sm-2">
                <div class="btn-group pull-right">
                   <button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                       <i class="glyphicon glyphicon-user"></i><span class="hidden-sm hidden-xs">&nbsp;<?php echo $_SESSION['susername']; ?></span>
                       <span class="caret"></span>
                   </button>
                   <ul class="dropdown-menu">
                       <!--<li><a href="#">Profile</a></li>-->
                       <li class="divider"></li>
                       <li><a href="logout.php">Logout</a></li>
                   </ul>
               </div>
              </div>
            </div>
        </div>
    </div>
    <!-- topbar ends -->
<?php } ?>
<div class="ch-container">
    <div class="row">
        <?php if (!isset($no_visible_elements) || !$no_visible_elements) { ?>

        <noscript>
            <div class="alert alert-block col-md-12">
                <h4 class="alert-heading">Warning!</h4>

                <p>You need to have <a href="http://en.wikipedia.org/wiki/JavaScript" target="_blank">JavaScript</a>
                    enabled to use this site.</p>
            </div>
        </noscript>

        <!-- <div id="content" class="col-lg-12 col-sm-10 center"> -->
            <!-- content starts -->
            <?php } ?>
<div class="col-md-10 col-md-offset-1 col-sm-12">