
<?php
  require "class/LB.php";
  require "class/ADMIN.php";
  require "class/USER.php";

  $_SESSION['lbname']="Logbuch";
  $_SESSION['dauereinaus']=0;
  $ADMIN = new ADMIN("Database",".php");


  $USER = new USER("Database",".php");
  // $RL = new RL("Database",".php");

  if(isset($_GET['LID'])) {
    $LID = $_GET['LID'];
    $_SESSION['prefix'] = $USER->test_id($LID);
  }

  if(isset($_POST['passw']) && isset($_POST['usern'])) {
    $_SESSION['prefix'] = $USER->check_login($_POST['usern'],$_POST['passw']);
  }

  if(isset($_POST['subuser'])) {
    if(isset($_POST['bname']) && isset($_POST['pass'])) {
      $USER->adduser($_POST['bname'],$_POST['pass']);
    }
  }

  if (isset($prefix)) {
    $prefix = $USER->test_id();

  }

  if (isset($_SESSION['user_logged_in']) && $_SESSION['user_logged_in'] == "config") {
    $USER->user_config();
  }
  if (isset($_SESSION['prefix']) ) {
    $LB = new LB("Database",".php",$_SESSION['prefix']);

}
#exit;
  // $tmp = $RL->config();

  // $konfig = array(
  //   "tbl_bereich" => "a_kat",
  //   "" => "",
  //   "" => ""
  // );
  //
  // $spalten = array(
  //   "bereich" => "name"
  // );



?>
