<!DOCTYPE html>
<html lang="en">
<head>
    <title>Wasah</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="utf-8">

             
    <!-- External CSS libraries -->
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap-submenu.css">
    <link rel="stylesheet" type="text/css" href="css/animate.min.css">
    <link rel="stylesheet" type="text/css" href="css/slider.css">
     <link rel="stylesheet" type="text/css" href="css/style_form.css">
    <link rel="stylesheet" type="text/css" href="fonts/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="fonts/linearicons/style.css">
    <link rel="stylesheet" type="text/css" href="fonts/flaticon/font/flaticon.css">
    
    

    <link href="css/bootstrap-select.min.css" type="text/css" rel="stylesheet">

    <!-- Custom stylesheet -->
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <link rel="stylesheet" type="text/css" id="style_sheet" href="css/colors/default.css">

    <!-- Favicon icon -->
    <link rel="shortcut icon" href="img/favicon.gif" type="image/x-icon" >

    <!-- Google fonts -->
    <link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700,800%7CPlayfair+Display:400,700%7CRoboto:100,300,400,400i,500,700">
    <link href="https://fonts.googleapis.com/css?family=Oswald:400,600,700" rel="stylesheet">
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script type="text/javascript" src="js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script type="text/javascript" src="js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script type="text/javascript" src="js/html5shiv.min.js"></script>
    <script type="text/javascript" src="js/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<div class="page_loader"><img src="img/loader.gif" alt="Loader"></div>

<!-- Top Header start -->
 <?php include_once ("styl/vrchni_panel.php");?>
<!-- Top Header end -->

<!-- Main header start -->
<?php include_once ("styl/panel.php");?>
<!-- Main header end -->

<!-- Sub banner start -->
<div class="sub-banner">
    <div class="overlay">  
    </div>
</div>
<!-- Sub banner end -->

<!-- Car list start-->
<?php  
//echo $_SESSION["uzivatel"]->prava;
$admin = 'admin';
$admin2 = "superadmin";
 if ($_SESSION["uzivatel"]->prava==$admin || $_SESSION["uzivatel"]->prava==$admin2) {}
 else {echo '<meta http-equiv="refresh" content="0;url=../../index.php">';}
include_once ("databaze/pripojit.php");
$dotaz="SELECT * FROM uzivatele_prehled";
$vysledek = mysqli_query($link, $dotaz);
if(!$vysledek) {
    echo "error sprava uzivatelu";
    exit();
  }
 // $radek=mysqli_fetch_object($vysledek);
  $pocet = mysqli_num_rows($vysledek);
?>

<!-- TABULKA!!! -->
<div class="container">
   <p class="text-center">
    <h2>Správa souborů</h2>
  </p>
  
  <table class="table table-bordered table-striped">
    
    <thead>
      <tr>
        <th>Soubor</th>
        <th>Smazat</th>

      </tr>
    </thead>
    
    <tbody>
    
    
    
       <form action="files_delete.php" method="GET">
       <?php
                     $files = scandir( "files" );
                              foreach( $files as $file ){
                                 if ($file === '.' or $file === '..') continue;
                                     
                                    echo "<tr>";
                                    echo "<td>$file</td>";
                                    
                                    
                                    
                                    
                                 echo   " <td><button name='someAction' type='submit' value='$file'>Smazat</button></td>" ;
                                     
                                     echo "</tr>"    ;
                                 
                                 
                                 } 
                        
                 ?>
                    
                       
                    </form>
                     <?php
    if($_SERVER['REQUEST_METHOD'] == "GET" and isset($_GET['someAction']))
    {
        unlink('files/'.$file.'');
    }

?>
							       
    </tbody>
    
  </table>
  
  
  
</div>

<!-- Car list end-->






<script type="text/javascript" src="js/jquery-2.2.0.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap-slider.js"></script>
<script type="text/javascript" src="js/wow.min.js"></script>
<script type="text/javascript" src="js/jquery.scrollUp.js"></script>
<script type="text/javascript" src="js/bootstrap-select.min.js"></script>
<script type="text/javascript" src="js/bootstrap-submenu.js"></script>

<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script type="text/javascript" src="js/ie10-viewport-bug-workaround.js"></script>

<!-- Custom javascript -->
<script type="text/javascript" src="js/app.js"></script>

</body>
</html>