

kenio Junio
Members-
Content count
22 -
Joined
-
Last visited
Community Reputation
0 ComumAbout kenio Junio

Contato
-
Hangouts
ClickBait
-
php Alterar a ordem de exibição das linha e salvar ordem no BD
kenio Junio replied to kenio Junio's topic in PHP
Ok, ai esta o problema! A rotina não faço a minima ideia de como criar ela kk- 3 replies
-
- javascript
- mysql
-
(and 1 more)
Tagged with:
-
Estou com um serio problema é não achei artigos ou posts sobre o assunto. Bem, queria saber como consigo fazer um draggable que ao alterar a posição das linhas ele altere no banco de dados. Exemplo: tenho um lista, cada item da lista tem um id que vem do banco de dados, ai altero o item 6 (que tem id = 6) para o lugar do 5 (que tem id = 5), ai o 5 consequentemente vai para o lugar do 6 certo? ai apos eu alterar queria que modificasse no banco de dados o id deles para que continue na posição alterada
- 3 replies
-
- javascript
- mysql
-
(and 1 more)
Tagged with:
-
Estou desenvolvendo um sistema com PHP e AJAX adiciono em uma tabela uma linha ate ai tudo normal, mas depois que adicionei a linha na tabela quero apagar. estou usando o on(), mas parece não esta funcionando. JAVASCRIPT $('.extList').on('click', function(){ var idPordEx = $(this).attr('id'); $(".addStatus").html('<span class="add"><i class="fa fa-spinner fa-spin fa-3x fa-fw" style=""></i> Excluindo... <span></span></span>'); $.ajax({ type: "POST", url: "sys/excluirPreco.php", data: 'id='+idPordEx+'', success: function( data ) { var dadosOb = JSON.parse(data); var segundos = 7; if (dadosOb.excluiu == 'sim') { $(".addStatus").html('<span class="checkVeri"><i class="fa fa-check-circle" aria-hidden="true"></i> Excluido com sucesso! </span>'); setTimeout(function(){ $('.checkVeri').hide(); }, segundos*1000); $('#consu_'+dadosOb.idList).remove(); }else if(dadosOb.excluiu == 'sim' || dadosOb.erro == 'sim'){ $(".addStatus").html('<span class="FailVeri"><i class="fa fa-times-circle" aria-hidden="true"></i> Erro ao excluir! </span>'); setTimeout(function(){ $('.FailVeri').hide(); }, segundos*1000); } }, error: function(){ } }); }); PHP <?php include_once "../../../config.php"; include_once "../../../classes/BD.class.php"; if (isset($_POST['id'])) { $id = $_POST['id']; $DeletProd = BD::conn()->prepare("DELETE FROM `preco_estado` WHERE id = ?"); if($DeletProd->execute(array($id))){ die(json_encode(array('excluiu' => 'sim','idList' => $id))); }else{ die(json_encode(array('excluiu' => 'nao'))); } }else{ die(json_encode(array('erro' => 'sim'))); } ?> E O HTML <tr id="consu_<?php echo $finalization->id; ?>"> <td><?php echo $finalization->id; ?></td> <td><?php echo $finalization->estado; ?></td> <td><span class="badge bg-light-blue">R$ <?php echo number_format($finalization->preco,2,',','.'); ?></span></td> <td><div class="extList" id="<?php echo $finalization->id;?>"><i class="fa fa-times lixo" aria-hidden="true"></i></a></td> </tr>
- 1 reply
-
- jquey
- javascript
-
(and 1 more)
Tagged with:
-
Tem um tópico no fórum. espero que te ajude :D
-
Editei o post. o erro se localiza na linha 153 citada no post ou seja creio eu que o erro não esteja no fechamento do foreach OBS: Estou começando a estudar PHP e tenho apenas 15 anos kkk espero que tenha um pouco de paciência se eu não enteder oque voçê falar
-
vou tentar aqui
-
Olá, esta dando erro no foreach dessa variavel $Mailer->Body = ' <div style="float:left;width: 100%;"> <h3 style="margin: 14px 0px 0px 0px;padding: 10px 0px 7px 13px;background: #D2D2D2;color: #404040;">Dados de Quem fez o pedido</h3> <table border="0" cellpadding="0" cellspacing="0" style="float:left; width:100%;border: 1px solid #cccccc;"> <tr> <td style="padding: 10px;">Nome:</td> <td>'.$nome.' '.$sobrenome.'<td> <tr> <tr> <td style="padding: 10px;">CPF:</td> <td>'.$cpf.'<td> <tr> <tr> <td style="padding: 10px;">CPF:</td> <td>'.$email.'<td> <tr> <tr> <td style="padding: 10px;">CPF:</td> <td>'.$numero.'<td> <tr> <tr> <td style="padding: 10px;">CPF:</td> <td>'.$complmento.'<td> <tr> <tr> <td style="padding: 10px;">CPF:</td> <td>'.$bairro.'<td> <tr> <tr> <td style="padding: 10px;">CPF:</td> <td>'.$cidade.'<td> <tr> <tr> <td style="padding: 10px;">CPF:</td> <td>'.$estado.'<td> <tr> <tr> <td style="padding: 10px;">CPF:</td> <td>'.$cep.'<td> <tr> </table> <table style="width: 100%;float: left;" border="0" cellpadding="0" cellspacing="0"> <thead style="background: #555;"> <tr> <th style="padding: 11px 9px;color: rgba(255, 255, 255, 0.87);font-weight: 300;"> Imagem </th> <th style="padding: 11px 9px;color: rgba(255, 255, 255, 0.87);font-weight: 300;"> Produto </th> <th style="padding: 11px 9px;color: rgba(255, 255, 255, 0.87);font-weight: 300;"> Valor(Unidade) </th> <th style="padding: 11px 9px;color: rgba(255, 255, 255, 0.87);font-weight: 300;"> SubTotal </th> <th style="padding: 11px 9px;color: rgba(255, 255, 255, 0.87);font-weight: 300;"> Quantidade </th> <th style="padding: 11px 9px;color: rgba(255, 255, 255, 0.87);font-weight: 300;"> Peso </th> <th style="padding: 11px 9px;color: rgba(255, 255, 255, 0.87);font-weight: 300;"> Tamanho </th> <th style="padding: 11px 9px;color: rgba(255, 255, 255, 0.87);font-weight: 300;"> Cor </th> </tr> </thead> <tbody>' 153 foreach ($produtos as $indice => $dados) { list($id, $opcoes) = explode(':', $indice); $qtd = $dados['qtd'];' <tr> <td style="padding: 8px!important;"> <img src="'echo PATCH.'/produto/'.$dados['imagem'];'" width="60"> </td> <td> <span style="text-align: left;padding: 0 0 0 19px;overflow: hidden;width: 105px;text-overflow: ellipsis;white-space: nowrap;float: left;" title="'echo $dados['titulo'];'"> 'echo $dados['titulo'];' </span> <td> <td style="width: 113px;">'.$dados['preco'].'</td> <td style="width: 113px;">'.$dados['subtotal'].'</td> <td style="width: 87px;">'.$dados['qtd'].;'</td> <td style="width: 79px;">'.$dados['peso'].' g</td> <td style="width: 78px;">'.$dados['tamanho'].'</td> <td style="width: 65px;">'.$dados['cor'].'</td> </tr> '.}.' </tbody> </table> </div>'; Parse error: syntax error, unexpected T_FOREACH in gostaria de sabe como corrigir o erro OBRIGADO PELA ATENÇÃO