I'm developing in PHP a basic system, and on the home screen I'm listing all registered users. For each user, I have a checkbox that gets the value of the user code. I would like to check if the checkbox is correct and how would I go about sending the array to another page that performs, for example, deleting the selected users? This through the click of a button ...
//Botões
<div class="span4" style="margin-left: 0;width:470px;text-align: right;">
<a href="cadastroUsuario.php"><button class="btn btn-danger" type="button">Novo Usuário</button></a>
<div class="btn-group">
<a class="btn btn-inverse"><i class="icon-th-list icon-white"></i> Opções</a>
<a class="btn btn-danger dropdown-toggle" data-toggle="dropdown" ><span class="caret"></span></a>
<ul class="dropdown-menu" style="text-align: left;">
<li><a href="#"><i class="icon-eye-open"></i> Visualizar Tudo</a></li>
<li><a href="#"><i class="icon-pencil"></i> Editar Usuário</a></li>
<li><a href="#"><i class="icon-trash"></i> Apagar Usuário</a></li>
<li class="divider"></li>
<li><a href="#"><i class="icon-check"></i> Ativar Usuário</a></li>
<li><a href="#"><i class="icon-ban-circle"></i> Desativar Usuário</a></li>
</ul>
</div>
</div>
//Tabela com os dados dos usuários
<table width="100%" border="0" class="table table-striped table-hover table-bordered">
<tr>
<th nowrap="nowrap">#</th>
<th nowrap="nowrap">Codigo</th>
<th nowrap="nowrap">Empresa</th>
<th nowrap="nowrap">Cidade</th>
<th nowrap="nowrap">UF</th>
<th nowrap="nowrap">Telefone</th>
<th nowrap="nowrap">CPF/CPNJ</th>
<th nowrap="nowrap">E-Mail</th>
<th nowrap="nowrap">Status</th>
<th colspan="2" nowrap="nowrap">Ações</th>
</tr>
<?php
if ($resultadoBusca != null){
foreach($resultadoBusca as $escrever){
//checkbox recebedo cod_user
echo "<tr><td><input type=checkbox name=\"check_idUser[]\" value=\"".$escrever['cod_user']."\"></td>
<td>" . $escrever['cod_votoran'] . "</td>
<td>" . utf8_encode($escrever['empresa_user']) . "</td>
<td>" . utf8_encode($escrever['cidade_user']) . "</td>
<td>" . $escrever['estado_user'] . "</td>
<td>" . $escrever['fone_user'] . "</td>
<td>" . $escrever['cpfcnpj_user'] . "</td>
<td>" . $escrever['email_user'] . "</td>
<td>" . $escrever['status_user'] . "</td>
<td>";
echo "<a href=\"visualizarUsuario.php?cod=".$escrever['cod_user']."\"><i class=\"icon-eye-open\" title=\"Visualizar Todos os Dados do Usuário!\"></i></a>";
if($escrever['status_user']=='ativo'|| $escrever['status_user']=='Ativo')
{
echo "<a href=\"desativarUsuario.php?cod=".$escrever['cod_user']."\"> <i class=\"icon-ban-circle\" title=\"Desativar Usuário!\"></i></a>";
}else{
echo "<a href=\"ativarUsuario.php?cod=".$escrever['cod_user']."\"> <i class=\"icon-check\" title=\"Ativar Usuário!\"></i></a>";
}
echo "<a href=\"editarUsuario.php?cod=".$escrever['cod_user']."\"> <i class=\"icon-edit\" title=\"Editar Usuário!\"></i></a>";
echo "<a href=\"excluirUsuario.php?cod=".$escrever['cod_user']."\"> <i class=\"icon-remove\" title=\"Remover Usuário!\"></i></a></td>
</tr>";
}
}else{
echo '<table style="width:100%; background: none repeat scroll 0% 0% rgb(242, 222, 222);"><div align="center"><strong><tr><td>Desculpe! Não Existe Nenhum Usuário Cadastrado</td></tr></strong></div></table>';
}
echo "</table>";
?>