Posts by lucasbento • 856 points
94 posts
-
0
votes1
answer64
viewsA: Capture, in PHP page, the value of an input that was changed at runtime
The solution was as follows: Pass as argument the value of input, at first request $.post: var val_num = $("[name='num-nfe']").val(); $.post("actions/autosalvar.php", {'val_num':…
-
0
votes1
answer64
viewsQ: Capture, in PHP page, the value of an input that was changed at runtime
The JS below captures the URL value and assigns to the value of input. var valor_num = /num_nfe=([^&]+)/.exec(window.location.href)[1]; //console.debug("Num. NFe: "+$("[name='num-nfe']").val());…
-
0
votes2
answers94
viewsQ: PHP data sync with Javascript
When the page is loaded through the URL index.php?num=58 initially the page autosalvar.php does not recognise the value of the input name="num-edit" (which contains the number 58), however when…
-
0
votes0
answers96
viewsQ: How to capture parameter passed via Angular JS Factory in PHP page
How to capture [on a PHP page] the value of input below using factory angularjs? HTML: <input type="text" name="edicao" ng-model="edicao" value="<?php if(isset($_GET['edicao'])){echo…
-
4
votes2
answers1028
viewsQ: How to perform an Insert or update of a JSON object
JSON object $postdata: { "0": { "codigo": "1", "descricao": "Bobina", "preco": "10.0000" }, "1": { "codigo": "2", "descricao": "Capa", "preco": "20.0000" } } Using Mysql, how to perform insert if…
-
0
votes1
answer631
viewsQ: How to fill in Angularjs fields from JSON return
How do I fill in selects and inputs, of each item, from a JSON return? The fields are: produtoAtrib.codigo, produtoAtrib.descricao and produtoTrib.estado. Javascript: <!-- Capturar dados do BD e…
-
0
votes1
answer243
viewsQ: How to insert and restate a list of items in the database
The code below allows the insertion of n items in the array $scope.items[]: var app = angular.module('app', []); app.controller('controlador', function($scope, $http) { $scope.user = {};…
-
1
votes2
answers387
viewsA: Save atomatic in PHP does not work with Success and serialization
[COMPLEMENT to Antonio’s response]: The capture of data serializados on the PHP page, using the structure below [problem presented in the question], it is not possible because, only $_POST['dados']…
-
0
votes2
answers91
viewsQ: How to change option from JSON return
How do I change the option below, based on JSON return: <select name="modalidade-frete" id="modalidade-frete"> <option value="0">0 - Por conta do emitente</option> <option…
-
0
votes1
answer62
viewsQ: How to take string values by reference using PHP
The way it is: var dados = $('#form').serialize(); // title=titulo&body=corpo $.post("autosave.php", dados); In PHP I can take the values by reference as follows: $title = &$_POST['title'];…
-
0
votes1
answer32
viewsQ: How to access, in PHP, values passed as parameter using jQuery.post()
How to individually access string values cores and array filmes on a PHP page? var filmes = ["Mad Max", "Assassin's Creed"]; var cores = "cor_um=Azul&cor_dois=Preto"; $.post("autosave.php",…
-
-4
votes2
answers387
viewsQ: Save atomatic in PHP does not work with Success and serialization
A code that performs the autosave of data on a form works so: autosave.php <?php require_once '../multiinjet/web/includes/configuracao.php'; try { /*Pegar valores postados no formulário*/…
-
2
votes2
answers107
viewsQ: SQL query returning null value
BD simulation in SQL Fiddle: http://sqlfiddle.com/#! 9/3f62be/1 Javascript: // Auto-salvar $(function () { $.post("actions/autosalvar.php", function (data) { console.log(data);…
-
1
votes2
answers585
viewsA: Listing error in paginated search system
<!-- Inicio do Sistema de Busca Interna --> <?php $pag = (isset($_GET['pag'])) ? (int)$_GET['pag'] : 1; //Se 'pag' não está DEFINIDA, 'pag' recebe o valor '1' …
-
0
votes2
answers28857
viewsQ: How to pass input value to Javascript function
How to pass values of other inputs (as a parameter) for a function that will only be executed on a given input? <input id="nome" type="text" value="LocalHost"/> <input id="email"…
-
4
votes2
answers1054
viewsQ: How to identify changed value in input
How to identify if a determining value has been changed in input? I have the prototype below, however alert will be displayed according to the number of times the class="ultimo-valor" appears in the…
-
9
votes2
answers10069
viewsQ: When and why use session_start?
Certain that, in short, session_start() "starts a new session or summarizes an existing session", but some questions: The function should only be called once, after the login user’s? Why to start a…
-
2
votes1
answer185
viewsQ: How to use the Nfephp API without the server having to support Curl 7.22.2
Is there any possibility of using the Nfephp API without the need for server endure cURL 7.22.2? Any settings I can perform, an alternative lib, etc?…
-
1
votes2
answers164
viewsQ: How to verify, for each item inserted in $Scope.items[], whether fields have been filled in
How to verify, for each item inserted in $Scope.items[], if Telephone and CPF were completed? Intended scenario: The user must enter at least 1 item, if negative, when clicking "Send" displays an…
-
2
votes2
answers736
viewsA: Empty nRec upon receiving return from SEFAZ
The variable $indSinc was set to value '1', or SYNCHRONOUS SERVICE, then simply change to '0'. a) Synchronous services - the processing of the service request is completed on the same connection,…
-
2
votes2
answers736
viewsQ: Empty nRec upon receiving return from SEFAZ
Using the Nfephp project API, through the function: $retorno = $nfe->sefazEnviaLote($aXml, $tpAmb, $idLote, $aResposta, $indSinc, $flagZip); get the array $aResposta. However this array is…
-
0
votes4
answers469
viewsA: json_encode returning HTML tags
With the help of @Allanandrade, via chat, we were able to discover that the problem was in variáveis não inicializadas and in the chamada de outras funções/bibliotecas que estavam utilizando…
-
1
votes2
answers308
viewsQ: How to store AJAX return to use as a parameter of another function
Main function, which will return the value chave = data.chave: var chave = ''; $scope.submitForm = function() { $http({ method : 'POST', url : 'validar.php', dataType: 'json', data : dados, headers…
-
-1
votes4
answers469
viewsQ: json_encode returning HTML tags
In performing echo json_encode($data);, I am receiving ,via console.debug(data), the following: <br /> <font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1'…
-
0
votes1
answer52
viewsA: How to capture and display errors using Angular and AJAX
Solution: 1st Capture of values: $x = $dados['valor_x']; $y = $dados['valor_y']; 2nd Inclusion of the following line at the end of the file calcular.php: echo json_encode($data); 3º calcular.php…
-
0
votes1
answer52
viewsQ: How to capture and display errors using Angular and AJAX
I’m trying to receive the return via Ajax and display using Angular JS, but without success, follows below the code: HTML: <body ng-app="app" ng-controller="controlador"> <form…
-
1
votes1
answer620
viewsQ: How to express date and time in "Y-m-d TH:i:sp" format, with UTC zone 03:00
Following the documentation, I am trying to represent the date in the following format: 2017-01-07T11:20:00-03:00 Code: $dt = $_POST['data-emissao']; $date = new DateTime($dt, new…
phpasked lucasbento 856 -
1
votes1
answer374
viewsQ: How to create nested array from information received via POST
Given the array below: $aDup = array( array('35342-1','2016-06-20','300.00'), array('35342-2','2016-07-20','300.00'), array('35342-3','2016-08-20','300.00'), array('35342-4','2016-09-20','300.00')…
-
1
votes1
answer159
viewsQ: How to pass multiple arrays to PHP page
→ $scope.items = []; → dados = $('#meu_form').serialize(); I wonder: how to send/receive/read the arrays above to a PHP page? Javascript: app = angular.module("app",[]);…
-
0
votes1
answer495
viewsQ: Typeerror: $http is not a Function
Script: app = angular.module("app",[]); app.controller("controlador", ["$scope", function($scope, $http){ $scope.items = []; $scope.submitForm = function() { // Posting data to php file $http({…
-
0
votes0
answers244
viewsQ: How to display/hide, individually, replicated div in Angularjs, using jQuery?
[SIMULATION using Jsfiddle at the end of the problem description] The following function performs the insertion of some elements using Angularjs: $scope.addItem = function (user){…
-
3
votes1
answer787
viewsQ: How to update fields in Angularjs?
When inserting items in the list using the following code snippet: $scope.items.push({ codigo: $scope.s.codigo, ncm: $scope.s.ncm, descricao: $scope.s.descricao, preco: $scope.s.preco, quantidade:…
-
3
votes2
answers545
viewsQ: How to update $Scope.items after push run?
Javascript: var app = angular.module('app', []); app.controller('controlador', function($scope, $http) { $scope.user = {}; $scope.items = []; var sum = 1; $scope.submitForm = function() { $http({…
-
3
votes2
answers1260
viewsQ: How to insert all array values and avoid $query->execute() with each foreach run?
How to insert all array values and avoid $query->execute() to each execution of the foreach? $_POST = json_decode(file_get_contents('php://input'), true); $sql = "INSERT INTO teste(nome, email)…
-
0
votes2
answers297
viewsA: How to list array values (Angularjs) using PHP?
Dynamic size array insertion into Mysql database and response complement: $_POST = json_decode(file_get_contents('php://input'), true); $sql = "INSERT INTO teste(nome, email) VALUES (:nome,…
-
0
votes2
answers297
viewsQ: How to list array values (Angularjs) using PHP?
I would like to know how to do the listing ("foreach") of my array $scope.items within PHP, so I can work individually with each entered value. Javascript: var app = angular.module('app', []);…
-
6
votes2
answers3233
viewsQ: How to calculate parcels (R$) and fill in inputs?
I would like help to implement the plot calculation and fill/create inputs according to the number of plots. Code below and in https://jsfiddle.net/wnm3jhr7/: $(document).ready(function(e) {…
-
0
votes3
answers1936
viewsA: How to pass dynamically changed value to function, in Angularjs
Good afternoon @virgilionovic, I got a "makeshift" solution, taking the values as follows: $scope.items.push({ codigo: $("input[name='codigo']").val(), descricao: $("input[name='descricao']").val(),…
-
5
votes3
answers1936
viewsQ: How to pass dynamically changed value to function, in Angularjs
The fields itemCodigo, itemDescription, itemPreco and itemQuantidade are filled dynamically (at runtime, without refresh) from a query performed in the database. However, these values, when passed…
-
0
votes0
answers115
viewsQ: How to perform sub-discharge with auto-fill
Code that performed the consultation: $parametro = (isset($_GET['parametro'])) ? $_GET['parametro'] : ''; if($acao == 'consulta'): $sql = "SELECT codigo,preco FROM produtos "; $sql .= "WHERE…
-
3
votes2
answers12233
viewsQ: How to display/hide fields according to selection?
Follows the code: function exibir_ocultar(val){ var cpf = document.getElementById('cpf'); var nome = document.getElementById('nome'); var cnpj = document.getElementById('cnpj'); var razao =…
-
0
votes1
answer270
viewsA: Change required field message
Good afternoon gentlemen, [SOLVED] Below is the solution available in another forum: var requiredCheckboxes = $('.periodicidade :checkbox[required]');…
-
0
votes1
answer270
viewsQ: Change required field message
How to change the message below and stay with the simplicity and coherence I need? I have the following code: $(function() { var requiredCheckboxes = $('.periodicidade :checkbox[required]');…
-
7
votes2
answers585
viewsQ: Listing error in paginated search system
When I do the query I get the following result [imagem1] By clicking to go to page 2, I get the following result [imagem2] That is, on page "1" everything working with the total results displayed…