0
My doubt consists in the following, I have the following form
<form name="frm_warning" id="box-register" method="POST" action="controllerWarning.php">
<h2 class="m-t-0 m-b-15">Warning</h2>
<div class="card">
<div class="card-body">
<div class="table-responsive">
<table id="data-table" class="table">
<thead>
<tr>
<th>Chamado Numero</th>
<th>Nome</th>
<th>Telefone</th>
<th>Numero de tentativas</th>
<th>Ultima Tentativa</th>
<th>Zerar Tentativas?</th>
</tr>
</thead>
<tbody>
<?php
$query = sprintf("select * from ivr_contatos, ivr_campanha,ivr_business where ivr_contatos.campanha = ivr_campanha.id and ivr_business.idvisita = ivr_contatos.codigo and ivr_contatos.status = 0 and tentativas >= qtdtentativas" );
$result = Populator::ConsultaDB($query);
while ($resultado = pg_fetch_array($result) ) {
$chamado = $resultado['numerochamado'];
$nome = $resultado['nome'];
$telefone = $resultado['telefone'];
$tentativa = $resultado['tentativas'];
$lastAttempt = $resultado['atualizado'];
$dataconvertida = date('d/m/Y H:i:s', strtotime($lastAttempt));
$codigo = $resultado['codigo'];
echo '
<tr>
<td align="center">'.$chamado.'</td>
<td>'.$nome.'</td>
<td>'.$telefone.'</td>
<td align="center">'.$tentativa.'</td>
<td>'.$dataconvertida.'</td>
<td><input type="checkbox" class="marcar" id="check" value='.$codigo.' name="check[]"/></td>
</tr>
';
}
?>
</tbody>
</table>
</div>
</div>
</div>
<input type="button" value="Salvar" onclick="Confirma()" class="btn btn-sm m-r-5" />
<p id="demo"></p>
</form>
where I call a confirmation message via javascript:
<script type="text/javascript">
function Confirma(){
var txt;
if(confirm("Deseja zerar as tentativas dos contatos selecionados?")){
txt = "Zerou as tentativas";
}else{
txt = "Não zerou as tentativas";
}
document.getElementById("demo").innerHTML = txt;
}
</script>
where is the field txt = "Reset attempts"; I would like to send to the controllerwarning.php action which is where I do the inclusion in the action database I am performing.
You want to send the string to php?
– Costamilam
Not necessarily, the idea is after the guy confirms, that he called my controllerWarning.php which is where I run the actions in the database
– Willian Lima
But what exactly will pass to controllerWarning.php ?
– user60252
it already passes the combobox data, I just wanted to know to give the javascript Ubmit for the controllerWarning.Pgp
– Willian Lima
then is already well answered by @Guilhermecostamilam
– user60252