Esempio n. 1
0
     }
     $query = "UPDATE e_PEDIDO SET TIFR_ID_TIPO_FRETE = " . $tipoFrete . ", VALOR_FRETE = " . $valorFrete . ", FRETE_GRATIS = " . $freteGratis . ", USUARIO_UPDATE = '" . USUARIO_LOGADO . "', DATA_UPDATE = now()\r\n\t\t\t\t  WHERE ID_PEDIDO = " . $idPedido . "";
     //printr($query);
     $resultQuery = $mysqli->ExecutarSQL($query);
     if ($resultQuery) {
         $retorno = '{ "cod": "sucesso", "mensagem": "' . EDITADO_COM_SUCESSO . '" }';
     } else {
         $retorno = '{ "cod": "erro", "mensagem": "' . ERRO_AO_EDITAR . '" }';
     }
     echo $retorno;
     break;
 case "cadastrarPedidoPagamento":
     $nroParcelas = sqlvalue($_POST["nroParcelas"], true);
     $formaPagamento = sqlvalue($_POST["formaPagamento"], false);
     $tipoLancamento = sqlvalue($_POST["tipoLancamento"], true);
     $valorPagamento = sqlvalue(formataValorInsert($_POST["valorPagamento"]), false);
     $idPedido = sqlvalue($_POST["idPedido"], false);
     $query = "INSERT INTO e_PEDIDO_PAGAMENTO\r\n\t\t\t\t           (FOPA_ID_FORMA_PAGAMENTO\r\n\t\t\t\t           ,PEDI_ID_PEDIDO\r\n\t\t\t\t           ,FINAL_CARTAO\r\n\t\t\t\t           ,NUMERO_CARTAO\r\n\t\t\t\t           ,CODIGO_SEGURANCA\r\n\t\t\t\t           ,DATA_VALIDADE_CARTAO\r\n\t\t\t\t           ,NOME_TITULAR_CARTAO\r\n\t\t\t\t           ,CPF_TITULAR_CARTAO\r\n\t\t\t\t           ,TRANSACAO_AUTORIZADA\r\n\t\t\t\t           ,DATA_AUTORIZACAO\r\n\t\t\t\t           ,USUARIO_AUTORIZACAO\r\n\t\t\t\t           ,ATIVO\r\n\t\t\t\t           ,VALOR_TOTAL_PAGAMENTO\r\n\t\t\t\t           ,NUMERO_PARCELAS\r\n\t\t\t\t           ,TIPO_LANCAMENTO\r\n\t\t\t\t           ,USUARIO_INSERT\r\n\t\t\t\t           ,DATA_INSERT)\r\n\t\t\t\t     VALUES\r\n\t\t\t\t           (" . $formaPagamento . "\r\n\t\t\t\t           ," . $idPedido . "\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,NULL\r\n\t\t\t\t           ,'S'\r\n\t\t\t\t           ," . $valorPagamento . "\r\n\t\t\t\t           ," . $nroParcelas . "\r\n\t\t\t\t           ," . $tipoLancamento . "\r\n\t\t\t\t           ,'" . USUARIO_LOGADO . "'\r\n\t\t\t\t           ,now())";
     //printr($query);
     $resultQuery = $mysqli->ExecutarSQL($query);
     if ($resultQuery) {
         $retorno = '{ "cod": "sucesso", "mensagem": "' . CADASTRO_REALIZADO . '", "redirect": "pedido-visualiza&idPedido=' . $idPedido . '#pedidoPagamentoTable" }';
     } else {
         $retorno = '{ "cod": "erro", "mensagem": "' . ERRO_AO_CADASTRAR . '" }';
     }
     echo $retorno;
     break;
 case "cadastrarProdutoPedido":
     $idPedido = sqlvalue($_POST["idPedido"], false);
     $arrayProduto = explode("|", $_POST["listaEstoqueProduto"]);
     $idProdutoAtributoValor = sqlvalue($arrayProduto[1], false);
Esempio n. 2
0
         $retorno = '{ "cod": "erro", "mensagem": "' . ERRO_AO_GRAVAR . '" }';
     }
     echo $retorno;
     break;
 case "cadastrarProduto":
     //printr($_POST);
     //$idProduto 							= sqlvalue($_POST["idProduto"],false);
     $situacaoProduto = sqlvalue($_POST["situacaoProduto"], false);
     $nomeProduto = sqlvalue($_POST["nomeProduto"], true);
     $referenciaProduto = sqlvalue($_POST["referenciaProduto"], true);
     $ncmProduto = sqlvalue($_POST["ncmProduto"], true);
     $codeanProduto = sqlvalue($_POST["codeanProduto"], true);
     $pesoProduto = sqlvalue(formataValorInsert($_POST["pesoProduto"]), false);
     $alturaProduto = sqlvalue(formataValorInsert($_POST["alturaProduto"]), false);
     $larguraProduto = sqlvalue(formataValorInsert($_POST["larguraProduto"]), false);
     $profundidadeProduto = sqlvalue(formataValorInsert($_POST["profundidadeProduto"]), false);
     $videoProduto = sqlvalue(formataVideo($_POST['videoProduto']), true);
     $nivelAuxProduto = $_POST['nivelAuxProduto'];
     if ($_POST["fabricanteProduto"] > 0) {
         $fabricanteProduto = sqlvalue($_POST["fabricanteProduto"], false);
     } else {
         $fabricanteProduto = sqlvalue(NULL, true);
     }
     if (isset($_POST["dataInicialLancamentoProduto"])) {
         $dataInicialLancamentoProduduto = sqlvalue(formataDataInsert($_POST["dataInicialLancamentoProduto"]), true);
     } else {
         $dataInicialLancamentoProduduto = sqlvalue(NULL, true);
     }
     if (isset($_POST["dataFinalLancamentoProduto"])) {
         $dataFinalLancamentoProduduto = sqlvalue(formataDataInsert($_POST["dataFinalLancamentoProduto"]), true);
     } else {