<?php


require_once("../classes/Mysql.php");

session_start();

$m = new Mysql();

if(isset($_POST['pridat'])){
$sql = "INSERT INTO uzivatele (user, card, pass)
	VALUES ('".$_POST['jmenouzivatele']."', ".$_POST['IDkarty'].", ".$_POST['heslo'].")";

$mysql_result = $m->dotaz($sql) or die('Query failed: ' . mysql_error());
}else{

  if($_SESSION['name'] == "admin"){ 
    $sql = "DELETE FROM uzivatele
            WHERE card = ".$_POST['IDkarty'];
    
    $mysql_result = $m->dotaz($sql) or die('Query failed: ' . mysql_error());     
  }
}


header("Location: /web/index.php?sekce=nastaveni");
exit();

?>
