Good afternoon everyone,
I'm implementing an edit form (modal) that has an 'Edit' link and which when clicked opens a modal form. The big problem is that I am not able to assimilate the 'Edit' link and bring each BD line to the modal form to be edited. Thank you in advance.
<h1 class="title"><i class="fa fa-gears fa-2x"></i> PAINEL ADMINISTRATIVO / PRODUTOS </h1>
<table class="table table-hover">
<thead>
<tr>
<th>Produto</th>
<th>Tipo</th>
<th>R$ Preço</th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<?php foreach($prod as $get_prods): ?>
<td><?php echo $get_prods->produto; ?></td>
<td><?php echo $get_prods->tipo; ?></td>
<td><?php echo $get_prods->preco; ?></td>
<td><a href="#box-editar" data-toggle="modal" data-target="#box-editar"><i class="fa fa-pencil "></i> Editar</a></td>
</tr>
<?php endforeach; ?>
</tbody>
</table><br />
<!-- Modal editar -->
<div class="modal fade" id="box-editar" tabindex="-1" role="dialog" aria-labelledby="boxLabel" aria-hidden="true">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="boxLabel"><i class="fa fa-pencil "></i> Editar Produto</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick='' data-dismiss="modal">Salvar alterações</button>
</div>
</div>
</div>
</div>