<?php
ini_set('display_errors', 0);
error_reporting(E_ALL);

$db = new SQLite3('./a/.eggziedb.db');

if(isset($_GET['id'])) {
    $id = (int)$_GET['id'];
    
    if($id > 0) {
        $stmt = $db->prepare("DELETE FROM ibo WHERE id = :id");
        $stmt->bindValue(':id', $id, SQLITE3_INTEGER);
        if($stmt->execute()) {
            // Também deletar links associados se houver
            $stmt_links = $db->prepare("DELETE FROM client_links WHERE ibo_id = :id");
            $stmt_links->bindValue(':id', $id, SQLITE3_INTEGER);
            $stmt_links->execute();
        }
    }
}

header('Location: users.php');
exit;
?>
