<?php
include 'db.php';

$tip = $_GET['tip']; // 'placa' ili 'godisnji'
$id = intval($_GET['id']);
$did = intval($_GET['djelatnik_id']);

if ($tip === 'placa') {
    $conn->query("DELETE FROM place WHERE id = $id");
} elseif ($tip === 'godisnji') {
    $conn->query("DELETE FROM godisnji WHERE id = $id");
}

header("Location: index.php?id=$did");
?>
