I developed a screen that shows the benefits granted to the citizen, a social assistance system, follow 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>
Solong,Iclickonthebuttontoloadthenecessaryfunctions,savethedateofdeliveryofthebenefitandgood.AfterthesuccessofajaxIwouldliketohidethebuttonandpresentthedate.
functiongerarDataEntrega(id){$.ajax({url:baseUrl+"/atendimentocras/beneficios-cidadao/data-entrega/",
type: "POST",
data: {id: id },
success: function(resultado){
}
});
}
Plus the problem is that everything is in a foreach making it difficult to present the delivery date if the citizen has more than one benefit. And another how can I keep this presentation fixed? .