<?php
require_once "auth.php";
$user = API_AUTH();

$id = $_GET['id'] ?? "";
if($id == ""){
    echo "ERR_ID_MISSING";
    exit;
}

$q = $conn->prepare("DELETE FROM connections WHERE user_id=? AND terminal_id=? LIMIT 1");
$q->bind_param("is", $user['id'], $id);
$q->execute();

echo "OK";
?>
