0
I developed a screen that presents the benefits granted to the citizen, system aimed at social assistance, follows the view :
<!--onblur ="validaNomeCidadaoGeral('dcbe_usu_codigo','dcbe_usu_nome','dcbealert_usu_nome')" -->
<div class="conteudo" >
<legend>Itens benefício eventual</legend>
<p class="msgAviso" id="beneficios-msg" <?=(count($this->dadosBenItens)>0 ? "style='display: none;'" : "style='display: show;'")?>>
</p>
<div class="msgAviso" id="dcbealert_exc_bei" style="display: none;"></div>
<table class="table table-bordered" id="beneficios_inseridos"
<?=(count($this->dadosBenItens)>0 ? "style='display: show;'" : "style='display: none;'")?>>
<thead>
<tr>
<th>Benefício</th>
<th>Tipo de benefício</th>
<th>Quantidade</th>
<th>Valor</th>
<th>Benefício concedido</th>
<th>Data Prevista</th>
<th>Data Entrega</th>
<th>Finaliza Entrega</th>
</tr>
</thead>
<tbody>
<?php
if (count($this->dadosBenItens)>0) {
// die('sdsadas')
foreach($this->dadosBenItens as $ite) { ?>
<tr id='beneficio_inserido<?=$ite->asbdi_codigo?>'>
<td class="center">
<?=$ite->beneficio?>
</td>
<td class="center">
Tipo de benefício
</td>
<td class="center">
<?=$ite->asbdi_qtd?>
</td>
<td class="center">
<?=$ite->asbdi_valor?>
</td>
<td class="center">
<?=($ite->asbdi_concedido == 1 ? 'Sim' : 'Não')?>
</td>
<td class="center">
<?=($ite->asbdi_data_entrega)?>
</td>
<td class="center">
<p id = "" style="display: none"><?=($ite->asbdi_entrega)?></p>
</td>
<td>
<div>
<button onclick="gerarDataEntrega(<?=$ite->asbdi_codigo?>)">Finliza Entrega</button>
</div>
</td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
Until then all right I click on the button it load the necessary functions , saves the date of delivery of the benefit and good. After the ajax Success I would like to hide the button and present the date .
function gerarDataEntrega (id){
$.ajax({
url: baseUrl + "/atendimentocras/beneficios-cidadao/data-entrega/",
type: "POST",
data: {id: id },
success: function(resultado){
}
});
}
The problem is that everything is in a foreach making it difficult to present the delivery date if the citizen has more of a benefit . And how else can I keep this presentation fixed ? .
A use of the modal itself would be the easiest solution ?
– Lucas Alves
I was using the result with a console.log just to check if it was getting the answer, have some feed in the process just that.
– Lucas Alves
No, I click the button and the change does not happen , I need to close and open the modal.
– Lucas Alves
So. You said in the answer below that when you close the modal and open again, the button appears again. So it seems to me that this list that appears in the modal is loaded dynamically, otherwise the button would not appear again, right?
– Sam