<?php
session_start();
require_once 'db/config.php';

if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['id'])) {
    $id = $_POST['id'];
    $nombre = $_POST['nombre'];

    $db = db();
    $stmt = $db->prepare("UPDATE kanban_columns SET name = ? WHERE id = ?");
    $stmt->bind_param('si', $nombre, $id);
    $stmt->execute();

    $_SESSION['success_message'] = "Columna actualizada exitosamente.";
    header('Location: info_producto.php');
    exit;
}
?>