2
I have a function to change records in the database and use a modal to show success or error message in the change.
The point is I can delete, but I would like after this function to be completed the page automatically gives a refresh.
elseif(isset($_GET['Acao']) && $_GET['Acao'] == 'Alterar') {
$Id = $_GET['Id'];
$sql = mysql_query("UPDATE vendas SET Mostrar = '0' WHERE Id = '$Id' ");
if ($sql){
echo '<script>modal({type: "inverted", title: "INFORMAÇÃO!", text: "Aterado com Sucesso!"});
</script>';}
else {
echo '<script>modal({type: "error", title: "Ops!", text: "Erro ao Alterar!"});</script>';
}
<table class="lista-clientes" width="100%"">
<tbody>
<tr>
<td align="center"></td>
<td>
<select class="select_styled">
<option value="">'.$dados['Pessoa'].' </option>
<option value="">'.$dados['Venda'].'</option>
</select>
<center>
<a href="?Id='.$dados['Id'].'&Acao=Alterar" class="btn btn-follow" style="text-decoration:none;">
<span>Remover!</span>
</a>
</center>
</td>
</tr>
</tbody>
</table>
Hi Leo, while I believe that the response of Rafael solve your problem (you can use
location.reload();
on the Javascript side as a function of callback modal) the fact that you need to do this seems strange to me. If you already have theid
from the sale, why not simply remove the page information using Javascript? Maybe you’re looking to do something with Ajax...– Anthony Accioly