}
    } else {
        //si cambio a aprobado
        if ($_POST['opcion'] === 'cambiarAprobado') {
            $OK = $clsCNDoc->ModificarEstadoDocumento($_POST['id'], '2');
            if ($OK === true) {
                echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=../vista/exito.php?Id=Se ha aprobado correctamente el documento">';
                die;
            } else {
                echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=../vista/error.php?id=NO se ha aprobado correctamente el documento">';
                die;
            }
        } else {
            //anular
            if ($_POST['opcion'] === 'Anular') {
                $OK = $clsCNDoc->AnularDocumento($_POST['id']);
                if ($OK === true) {
                    echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=../vista/exito.php?Id=Se ha anulado correctamente el documento">';
                    die;
                } else {
                    echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=../vista/error.php?id=NO se ha anulado correctamente el documento">';
                    die;
                }
            }
        }
    }
}
//y se presenta el listado
?>
<!DOCTYPE html>
<html>