-2
Next: when the user clicks on "apply", he goes to another page and there I will work with the id of the record he clicked, only there is born the problem, I do not know how to do it. code:
page_list:
foreach ($chamados as $chamado):
?>
<tr>
<td><?php echo $chamado['data_solicitado'] ?></td>
<td><?php echo $chamado['detalhes'] ?></td>
<td><?php echo $chamado['logradouro'] ?></td>
<td><?php echo $chamado['estado'] ?></td>
<td><?php echo $chamado['cidade'] ?></td>
<td><?php echo $chamado['bairro'] ?></td>
<td><?php echo $chamado['num'] ?></td>
<td><?php echo $chamado['complemento'] ?></td>
<td><?php echo $chamado['ddd'] ?></td>
<td><?php echo $chamado['numero'] ?></td>
<td><?php echo $chamado['nome'] ?></td>
<td><?php echo $chamado['sobrenome'] ?></td>
<td><a onclick="verificaAlistamento()">Candidatar-se</a></td>
<?php
$chamado['id_contrato'];
?>
</tr>
<?php
endforeach;
pag_verifies
$user = $_SESSION['nome'];
$idContrato = $_POST[$id_contrato];
$cpf = pegaCpfUsuarioLogado($conexao, $user);
if(verificaCandidatura($conexao, $cpf)){
?>
<script>deuRuim()</script>
<?php
candidatarSe($conexao, $cpf, $idContrato);
header("location: pag_menuTecnico.php");
} else {
?>
<script>deuBom()</script>
<?php
header("location: pag_menuTecnico.php");
}
I’ve tried to do so: https://forum.imasters.com.br/topic/307200-pegar-o-indice-do-array-em-um-foreach/
only that there stopped to bring the calls in open
Thanks!! Solved my problem.
– Leandro
Dispose, my friend ^^
– Alex Lupóz