Skip to content

Commit

Permalink
Resolução da issue #609
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielPintoSouza committed Jun 20, 2024
1 parent d88dee1 commit 79377d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion html/socio/sistema/controller/script/socio.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function gerarTags(){
$('#tags').append('<option selected disabled>Selecionar Grupo</option>');
$.each(tags,function(i,item){
$('#tags').append('<option value="' + item.id_sociotag + '">' + item.tag + '</option>');
$('#tagsT').append(`<tr><td>${item.id_sociotag}</td><td><input id='${item.id_sociotag}' type='text' value='${item.tag}'></td><td><a id='a_${item.id_sociotag}' class='btn btn-primary' href='salvar_tag.php?id_tag=${item.id_sociotag}&value='>Salvar</a><td><a class='btn btn-danger' href='deletar_tag.php?id_tag=${item.id_sociotag}'>Deletar</a></td></tr>`);
$('#tagsT').append(`<tr><td>${item.id_sociotag}</td><td><input id='${item.id_sociotag}' type='text' value='${item.tag}'></td><td><a id='a_${item.id_sociotag}' class='btn btn-primary' href='salvar_tag.php?id_tag=${item.id_sociotag}&value=${item.tag}' disabled>Salvar</a><td><a class='btn btn-danger' href='deletar_tag.php?id_tag=${item.id_sociotag}'>Deletar</a></td></tr>`);
});
},
dataType: 'json'
Expand Down
8 changes: 5 additions & 3 deletions html/socio/sistema/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function adicionar_cargo(){
{
$id_tag = $row['id_sociotag'];
$tag = $row['tag'];
echo "<tr><td>$id_tag</td><td><input id='$id_tag' type='text' value='$tag'></td><td><a id='a_$id_tag' class='btn btn-primary' href='salvar_tag.php?id_tag=$id_tag&value='>Salvar</a><td><a class='btn btn-danger' href='deletar_tag.php?id_tag=$id_tag'>Deletar</a></td></tr>";
echo "<tr><td>$id_tag</td><td><input id='$id_tag' type='text' value='$tag'></td><td><a id='a_$id_tag' class='btn btn-primary' href='salvar_tag.php?id_tag=$id_tag&value=$tag' disabled>Salvar</a><td><a class='btn btn-danger' href='deletar_tag.php?id_tag=$id_tag'>Deletar</a></td></tr>";
}
?>
</tbody>
Expand Down Expand Up @@ -257,14 +257,16 @@ function atualiza(){
$("input").change(function(){
console.log($(this).val());
var id = this.id;
$("#a_"+id).attr("href", `salvar_tag.php?id_tag=${id}&value=${$(this).val()}`)
$("#a_"+id).attr("href", `salvar_tag.php?id_tag=${id}&value=${$(this).val()}`);
$("#a_"+id).attr("disabled", false);
})

setInterval(function(){
$("input").change(function(){
console.log($(this).val());
var id = this.id;
$("#a_"+id).attr("href", `salvar_tag.php?id_tag=${id}&value=${$(this).val()}`)
$("#a_"+id).attr("href", `salvar_tag.php?id_tag=${id}&value=${$(this).val()}`);
$("#a_"+id).attr("disabled", false);
})
}, 300)
})
Expand Down

0 comments on commit 79377d9

Please sign in to comment.