<?php


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

session_start();

$m = new Mysql();

$sql = "SELECT * FROM zasuvky 
        WHERE ID_zasuvky = ".$_POST[IDZasuvky1]." AND ID_uzivatele = ".$_SESSION['userID'];

$pocet = $m->pocetRadku($m->dotaz($sql));

if($pocet == 1){ 
$sql = "DELETE FROM zasuvky_data
        WHERE CHIP_ID = ".$_POST[IDZasuvky1];

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

$sql = "DELETE FROM zasuvky
        WHERE ID_zasuvky = ".$_POST[IDZasuvky1]." AND ID_uzivatele = ".$_SESSION['userID'];

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


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

?>
