Skip to content

Commit

Permalink
Resolução da issue #646
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielPintoSouza committed Jul 19, 2024
1 parent 6bb4c51 commit 436ecbc
Showing 1 changed file with 1 addition and 68 deletions.
69 changes: 1 addition & 68 deletions html/socio/sistema/controller/import_conteudo_socios.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,73 +269,6 @@
</div>
</aside>
</section>
</body>
<script>
function gerarCargo(){
url = '../../dao/exibir_cargo.php';
$.ajax({
data: '',
type: "POST",
url: url,
success: function(response){
var cargo = response;
$('#cargo').empty();
$('#cargo').append('<option selected disabled>Selecionar</option>');
$.each(cargo,function(i,item){
$('#cargo').append('<option value="' + item.id_cargo + '">' + item.cargo + '</option>');
});
},
dataType: 'json'
});
}

function adicionar_cargo(){
url = '../../dao/adicionar_cargo.php';
var cargo = window.prompt("Cadastre um Novo Cargo:");
if(!cargo){return}
situacao = cargo.trim();
if(cargo == ''){return}

data = 'cargo=' +cargo;
console.log(data);
$.ajax({
type: "POST",
url: url,
data: data,
success: function(response){
gerarCargo();
},
dataType: 'text'
})
}

function verificar_recursos_cargo(cargo_id){
url = '../../dao/verificar_recursos_cargo.php';
data = 'cargo=' +cargo_id;
console.log(data);
$.ajax({
type: "POST",
url: url,
data: data,
success: function(response){
var recursos = JSON.parse(response);
console.log(response);
$(".recurso").prop("checked",false ).attr("disabled", false);
for(recurso of recursos){
$("#recurso_"+recurso).prop("checked",true ).attr("disabled", true);
}
},
dataType: 'text'
})
}

$(document).ready(function(){
$("#cargo").change(function(){
verificar_recursos_cargo($(this).val());
});
});
</script>


</body>
<!-- /.box-body -->

0 comments on commit 436ecbc

Please sign in to comment.