<?
$db_operation = false;
if(isset($_POST['order'])){
  $order = $_POST['order'];
  $db_operation = true;
  if($order == 'create') include "./db_create.php";
  elseif($order == 'delete') include "./db_delete.php";
}
else $order = null;
include "../lib/mysql_connect.php";
?>

<!DOCTYPE html>
<html lang="cs">
<head>
<title>Kolské Borec - ADMIN//24</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-black.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css">
</head>
<style>
#menu{
  min-height: 300px;
}
#title{margin:0px; padding: 1% 20% 1% 20%;}
.nav_button {
  width: 100%
}

</style>
<body class="w3-black">
  <!-- First Grid: Logo & About -->
  <div class="w3-row w3-black" id="title">
    <div class="w3-full w3-center w3-black">
    <div class="w3-green w3-round-xxlarge w3-padding">
      <a href="./"><h1>Kalské Borec <span class="w3-green">//ADMIN</span></h1></a>
    </div>
  </div>
  </div>
  <!-- Content -->
  <div class="w3-row w3-black w3-padding-large">
    <div class="w3-quarter w3-center w3-black w3-padding" id="menu">
      <form action="./" method="post">
      <input type="hidden" name="order" value="create">
        <div class="w3-container w3-padding-large">
          <input type="submit" value="Create Table" class="w3-button w3-round-xlarge w3-border w3-border-black w3-xlarge w3-green w3-padding w3-hover-white nav_button">
        </div>
      </form>
      <form action="./" method="post">
        <input type="hidden" name="order" value="delete">
        <div class="w3-container w3-padding-large">
          <input type="submit" value="Delete Table" class="w3-button w3-round-xlarge w3-border w3-border-black w3-xlarge w3-green w3-padding w3-hover-white nav_button">
        </div>
      </form>
      <div class="w3-container w3-padding-large">
        <a href="./">
          <button class="w3-button w3-round-xlarge w3-border w3-border-black w3-xlarge w3-green w3-padding w3-hover-white nav_button">Seznam</button>
        </a>
      </div>
      <div class="w3-container w3-padding-large">
        <a href="../">
          <button class="w3-button w3-round-xlarge w3-border w3-border-black w3-xlarge w3-green w3-padding w3-hover-white nav_button">&lt;&lt; Domů</button>
        </a>
      </div>
    </div>
    <div class="w3-threequarter w3-black w3-padding-large" id="content">
      <div class="w3-padding w3-white w3-round-large">
      <? 
      if($db_operation){
        echo "$order";
      }
      else{
        include "../lib/registered_table.php";
      }
      ?>
      </div>
    </div>
  </div>
</div>
</body>
</html>
