Passar valores array de dois inputs
Boa tarde,
estou com o seguinte formulário:
<form class="form-horizontal" method="post" action="<?= base_url('colaborador/certificado/liberaCertificado'); ?>">
<table class="table table-hover">
<thead>
<tr>
<th>MATRICULA</th>
<th>NOME</th>
<th>CPF</th>
<th>E-MAIL</th>
<th>FONE1</th>
<th>FONE2</th>
<th>STATUS</th>
<th>LIBERAR CERTIFICADO</th>
</tr>
</thead>
<tbody>
<?
foreach ($cursosDadosExt as $row):{
if ($row->STATUSLAN == 0){
$status = 'NÃO PAGO';
$certificar = "<input type='checkbox' disabled />";
}
if ($row->STATUSLAN == 1){
$status='PAGO';
if($row->resultado == 0 or $row->resultado == 'NULL'){
$certificar = "<input type='checkbox' name='certificar[]' id='certificar' value='0' />";
}
if($row->resultado == 1){
$certificar = "<input type='checkbox' name='certificar[]' id='certificar' value='1' checked />";
}
}
//if ($row->STATUSLAN == 2){$status='CANCELADO';}
if ($row->STATUSLAN == 3){
$status='ACORDO';
$certificar = '';
}
echo "
<tr class='active'>
<td>$row->matricula</td>
<td>$row->nome</td>
<td>$row->cpf</td>
<td>$row->email</td>
<td>$row->telefone</td>
<td>$row->celular</td>
<td>$status</td>
<td>$certificar</td>
</tr>
";
?>
<input type="hidden" name="matricula" id="matricula" value="<?=$row->matricula?>">
<input type="hidden" name="codcusto" value="<?=$row->CODCUSTO?>">
<input type="hidden" name="perletivo" value="<?=$row->Perletivo?>">
<?
}
endforeach;
?>
</tbody>
</table>
<p align="right"><button type="submit" class="btn btn-primary">LIBERAR CERTIFICADOS SELECIONADOS</button></p>
</form>
preciso pegar todos os campos $certificar e $matricula para fazer um upadate
public function liberaCertificado() {
$_checkbox = $_POST['certificar'];
$mat = $_POST['matricula'];
$codcusto = $_POST['codcusto'];
$perletivo = $_POST['perletivo'];
foreach(array($mat) as $matricula)
foreach(array($_checkbox) as $_valor)
/*foreach($_checkbox as $_valor){
print ($_valor.'-'.$matricula.'-'.$codcusto.'-'.$perletivo.'<br/>');
}*/
for($i = 0; $i < count($matricula); $i++) {
print ($_valor[$i].'-'.$matricula[$i].'-'.$codcusto.'-'.$perletivo.'<br/>');
}
}
só que só aparece um unico valor ex:
1-1-000382-2018.1
E deveria aparecer todos os selecionados.Discussão (1)
Carregando comentários...