<!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="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-->
<br>
<center >
<form action="add_tel_auto.php" method="get">

                          <?php if ($_SESSION["uzivatel"]->prava=='admin' || $_SESSION["uzivatel"]->prava=='superadmin') 
                            { ?>                         
                                <button  name="pridej" type="submit" value="telefon" style="background-color: #4CAF50; border: none;  color: white; padding: 2% 3% ; text-decoration: none;margin: 4px 2px;cursor: pointer; font-size : 150%;">Přidat telefon</button>
								<button  name="pridej" type="submit" value="tank" style="background-color: #4CAF50; border: none;  color: white; padding: 2% 3%; text-decoration: none;margin: 4px 2px;cursor: pointer;font-size : 150%;"> Přidat tankovací kartu  </button>
								<button  name="pridej" type="submit" value="udalost" style="background-color: #4CAF50; border: none;  color: white; padding: 2% 3%; text-decoration: none;margin: 4px 2px;cursor: pointer;font-size : 150%;"> Přidat událost  </button>
                           <?php  } ?>






<button  name="pridej" type="submit" value="auto" style="background-color: #4CAF50; border: none;  color: white; padding: 2% 3%; text-decoration: none;margin: 4px 2px;cursor: pointer;font-size : 150%;"> Přidat automobil  </button>               
               
               

</form> 

<form action="phpqrcode/qr/testqr.php" method="get">
<button  name="aktualizuj" type="submit" value="qr" style="background-color: #4CAF50; border: none;  color: white; padding: 2% 3%; text-decoration: none;margin: 4px 2px;cursor: pointer;font-size : 150%;"> Aktualizovat QR databazi  </button>               

</form> 
                                                                                                
  <?php  if (isset($_GET["pridej"])) { 
  if  ($_GET["pridej"]=="telefon")     {echo "<h2 style='color: green'><p>Telefon byl přidán do databáze.</p></h2>";
  
  include_once ("databaze/pripojit.php");
  $dotaz = "INSERT INTO telefony (vyrobce, Konektor, model, SIM_karta, system, obrazek, verze_operacni_system, informace, rozliseni, uhlopricka_displeje, Funkce, oddeleni, odd_jmeno, odd_post, odd_email, zapujcil, odd_tel) VALUES ('Výrobce', 'Konektor', 'Model', 'SIM', 'Systém', 'img/Telefon/telefon.jpg', 'verze OS', 'inforamce', '123', '123', 'Funkce', 'oddělení', 'jméno', 'pozice', 'email', 'zapůjčil', 'telefon' )";
  $vysledek = mysqli_query($link, $dotaz);
  if(!$vysledek) {
    echo "error pridej telefon.php";
    exit();
  }
   include_once ("databaze/odpojit.php");
 
  // Získání počtu uživatelů odpovídajících dotazu 
 // $pocet = mysqli_num_rows($vysledek);
  //$radek=mysqli_fetch_object($vysledek);
  
  
  }
  else if  ($_GET["pridej"]=="auto")     {echo "<h2 style='color: green'><p>Auto bylo přidáno do databáze.</p></h2>";
   include_once ("databaze/pripojit.php");
  $dotaz = "INSERT INTO auta (znacka, obrazek, infotainment, propojeni, palivo, rok_vyroby, vybava, model, spz, vin, barva, prevodovka, oddeleni, parkovani, odd_jmeno, odd_post, odd_email, odd_tel, park_place, informace, najeto_km) VALUES ('Značka', 'img/Auto/auto.jpg', 'infotainment', 'propojeni', 'palivo', '9999', 'výbava', 'model', 'XXX123XXX', '111VIN111', 'barva', 'převodovka', 'oddělení', 'XX', 'Jméno', 'Pozice', 'email', '123456789', 'XX', 'Informace vlož zde.', '9999')";
  $vysledek = mysqli_query($link, $dotaz);
  if(!$vysledek) {
    echo "error pridej auto.php";
    exit();
  }
    include_once ("databaze/odpojit.php");
  
 
}
  if  ($_GET["pridej"]=="tank")     {echo "<h2 style='color: green'><p>Tankovací karta byla přidána do databáze.</p></h2>";
  
  include_once ("databaze/pripojit.php");
  $dotaz = "INSERT INTO tank_k (c_karty, spravce, zapujcil_jmeno, zapujcil_email, zapujcil_telefon, stav_karty, obrazek) VALUES ('0', 'spravce karty', 'zapujcil jmeno', 'zapujcil email', 'zapujcil_telefon', 'kredit karty', 'img/karta/karta.jpg')";
  $vysledek = mysqli_query($link, $dotaz);
  if(!$vysledek) {
    echo "error pridej tank.php";
    exit();
  }
   include_once ("databaze/odpojit.php");



}
  if  ($_GET["pridej"]=="udalost")     {echo "<h2 style='color: green'><p>Událost byla vytvořena.</p></h2>";
  
  include_once ("databaze/pripojit.php");
  $dotaz = "INSERT INTO event (nazev, popis, obsazeno, max_osoby, vedouci, prihlaseni_datum, odhlaseni_datum, misto_konani) VALUES ('Nová událost', '', '', '', '', '', '', '')";
  $vysledek = mysqli_query($link, $dotaz);
  if(!$vysledek) {
    echo "error pridej udalost.php";
    exit();
  }
   include_once ("databaze/odpojit.php");





       
   } 
   
         if  ($_GET["pridej"]=="qr")     {echo "<h2 style='color: green'><p>Databáze QR byla aktualizována.</p></h2>";   }
    
   
   
}
                            ?>


   </center>










<script type="text/javascript" src="js/jquery-2.2.0.min.js"></script>
<!-- Error <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>