-1
< script >
function verificaChecks() {}
var aChk = document.getElementsByName("verifica");
for (var i = 0; i < aChk.length; i++) {
if (aChk[i].checked == true) {
if (aChk[i].value == "<?php echo $check?>") {
<?php
$status= mysqli_query($conn,"UPDATE bloqueios SET ESTADO = 'Desconsiderado' where id= $check");
?>
}
} else {
<?php echo ("nenhum marcado"); ?>
// CheckBox Não Marcado... Faça alguma outra coisa...
}
}
} <
/script>
<?php
$dbname = mysqli_select_db($conn,"bloqueio-cartao") or die("Não foi possível selecionar o Banco");
// Exibe o bloqueio e a multa
$sql2 = mysqli_query($conn,"SELECT * FROM bloqueios WHERE NOME LIKE '%".$nome."%' ");
$numRegistros2=mysqli_num_rows($sql2);
if ($numRegistros2 !=0) {
echo '<tr>'."<td>";
//echo ("<button id='r'>Recurso</button></td>");
echo '<td>';
echo ("<button> Desconsiderar</button>").'</td>';
echo "<td>". ("<input type='button' value='Desconsiderar' onclick='verificaChecks();'></td>");
echo "<td>". ("<button> imprimir </button>")."</td>"."</tr>";
while ($bloqueio = mysqli_fetch_object($sql2)) {
$check= $bloqueio->id;
echo '<tr>'."<td>";
echo ("<input type='checkbox' id='verifica' name='checkbox' value='<?php echo $check;?>'/>"); echo '
<td>'; echo $bloqueio->HORA. '-' .$bloqueio->LINHA. '-' .$check.'</td>'.'</tr>'; echo '
<td></td>'; } } // Se não houver registros else { echo "Nenhum bloqueio foi encontrado com esse nome ".$nome.""; } ?>
</table>
</div>
Thanks, but still not solved my problem =( I wanted to mark the checkbox, the same took the id of the corresponding record and thus record a status for this record as "disregarded" ....
– Bruna Mello
You want to do this one by one? For example: click a checkbox and automatically already trigger an event and then save some information in the bank, or just show to the customer?
– Taffarel Xavier
save at the bank
– Bruna Mello
select some checkboxs, automatically picks up the ids. Then press the disregard button and save "disregarded" in the bank on those ids that are in check..
– Bruna Mello
I will edit here as I understood.
– Taffarel Xavier
each line containing the check gets an id on the bank, wanted the check to get that value...
– Bruna Mello
OK I see... =)
– Bruna Mello
I saw your post, I do not want to record the check id in the bank. No bank has the columns: id , student, benefit, Cpf , misuse, status. I wanted the check to get this bank id so I could add in the status column "disregarded" ...
– Bruna Mello
wanted to leave it like this:
– Bruna Mello
id=1 student=Bruna Cpf=0000000 usage= xxxxxx status= disregarded
– Bruna Mello
but for now the state column fields are blank, I need to update there by taking the id
– Bruna Mello
Like this? [ { "id": "my_id_2", "status": "disregarded" } ] [ { "id": "my_id_1", "status": "disregarded" }, { "id": "my_id_2", "status": "disregarded" }, { "id": "my_id_3", "status": " } ]
– Taffarel Xavier
Yes, but I don’t need to put the id on the check manually you understand? pq are many uses and the check is in a loop... as soon as it generated the use check I took the bank id and this id recorded disregarded...
– Bruna Mello