<?php
include("conex.php");

if (isset($_POST['id'])) {
    $id = $_POST['id'];

    // Actualizar la condición a 0 (deshabilitar)
    $sql = "UPDATE tbr_cifras SET condicion = 0 WHERE idcifras = ?";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param('i', $id);
    $stmt->execute();

    if ($stmt->affected_rows > 0) {
        echo json_encode(['success' => true]);
    } else {
        echo json_encode(['success' => false]);
    }
} else {
    echo json_encode(['success' => false]);
}
?>
