Posts by Willian • 763 points
51 posts
-
0
votes3
answers342
viewsA: Function that adds/removes element of the array by clicking checkbox at the angle
front html <input (click)="adicionaProdutoSelecionado(produto, $event.target.checked, i)" type="checkbox" class="custom-control-input" id="defaultUnchecked{{i}}"> back ts…
-
1
votes1
answer4038
viewsA: Cannot read Property 'id' of Undefined
Statement bug: any; Correction const bug = bugDetails[i]; //para this.bug = bugDetails[i]; as you stated as a constant the template cannot reference…
-
0
votes1
answer17
viewsA: Isn’t repeating structure checking for null elements?
this.variacaoForm.value.variacoes[i]. attribute[j]. idatributo == 'null'
-
0
votes2
answers475
viewsA: Form group does not update angular template
patchValue Mutile values this.produtoForm.patchValue({nomeproduto: 'Test'}); setValue unique value this.produtoForm.nomeproduto.setValue('Test');…
-
2
votes1
answer358
viewsA: PHP - Create cookie with multiple values
Multipolos cookies with the same index json_encode() does the transformation of the php array to string, thus being able to be saved in the cookie that has as a requirement a parameter string…
-
0
votes2
answers177
viewsA: How to send the password already with the hash to the database
hash $PDO = db_connect(); $sql = "INSERT INTO users(nome, login, password, email,linkfb) VALUES(:name, :login, :senha, :email, :linkfb)"; $senha = hash('ripemd160', $senha); $stmt =…
-
1
votes1
answer35
viewsA: How to search a mysql table with two filters?
Simple search caso um condição dependa da outra $sqli = "SELECT * FROM table WHERE column = '$busca1' AND column3 = '$busca3' "; caso seja idependentes uma da outra $sqli = "SELECT * FROM table…
-
3
votes2
answers96
viewsA: Remove array elements that are not in 2 PHP arrays
Comparison of object array $array1 = array( (object) array("id" => 1), (object) array("id" => 3), (object) array("id" => 5), (object) array("id" => 6), (object) array("id" => 7) );…
-
0
votes1
answer239
viewsA: How to delete complete HTML content?
Erase $var = date('H:i:s'); if (strtotime($var) < strtotime('09:34:00') && strtotime($var) > strtotime('15:00:00')) { $fp = fopen("log.html", 'w'); fwrite($fp, ""); fclose($fp); } that…
-
-1
votes2
answers665
viewsA: How to add percentage to a PHP value?
Percentage $valor_acrescido = (($data->sell*30)/100)+$data->sell;
-
0
votes3
answers144
viewsA: Doubt - Array php return
In a given item $teste[0]['indice'] = 'valor'; foreach to save on all foreach ($teste as $key => $value){ $value['indice'] = 'valor'; } more questions for foreach php foreach php.net…
-
2
votes1
answer236
viewsA: Sum returns NAN even when converting the number to angular
App this.qtdeEstoque = 0; for(let i=0;i<this.variacaoForm.value.variacoes.length;i++){ this.qtdeEstoque+= this.variacaoForm.value.variacoes[i].estoque_variacao } console.log(this.qtdeEstoque);…
-
1
votes1
answer356
viewsA: How to handle DIV with angular 2
app.componentts. public div: boolean = true; app.component.html <a (click)="div = 1">div1 show</a> <div *ngIf="div"> div 1 </div> <br> <a (click)="div = 0">div2…
-
0
votes1
answer67
viewsA: How do I update the amount of socket.io messages in an Angular Ionic3 app to a particular endpoint?
Next, why do they talk chat? For the reason that it is basically required socket because the user needs to receive the information without the "refresh", another way you put a timer for it, more…
-
1
votes2
answers3399
viewsA: Add a new literal object to an object array!
The push increments a new item to your array: this.products.push({prodName: 'product 1'}); Maybe you have to declare it that way to work: public products: any = [{prodName: 'product 1'}];…
-
0
votes2
answers77
viewsA: View foreach result out of it
this.MetaService.CheckOrderGet().subscribe( data => { const pesquisa = (data as any) this.check = JSON.parse(pesquisa._body) this.new = []; for (var key in this.check) { if (this.check[key].FI ==…
-
1
votes1
answer732
viewsQ: Send angular form
Good I’m sending a form via angular, but the data is not getting updated in the backend? <form [formGroup]="categoriaForm" (ngSubmit)="salvarCategoria()"> <tr *ngFor="let data of config;…
-
1
votes1
answer60
viewsQ: Search unica mysql
I’m doing a db search that needs to resume the sum of a field and the last corresponding value, and grouping them to an index Query $stmt = getConn()->query("SELECT senha,movi,SUM(entrada) as…
-
1
votes2
answers145
viewsA: Problem when calculating percentage using parseFloat and toFixed
function to swap characters function replaceAll(str, find, replace) { return str.replace(new RegExp(find, 'g'), replace); } how to call function replaceAll('20,00',',','.'); another simple way…
-
2
votes2
answers50
viewsQ: Organizing the response array
How to organize the index of the 2nd dimension array? Seeking $stmt = getConn()->query("SELECT hash,id,quantidade FROM pergaminhos"); $resp =…
-
0
votes1
answer233
viewsQ: Organize array
Good how I can organize this array without using a loop Original array ["Entrada" => 4, "Prato principal" => 1] Desired array [["Entrada",4],["Prato principal",1]] ok I understood what you…
-
2
votes1
answer318
viewsQ: Remove indexes from the array
How to remove indexes from an array? Original array ["Torrada" => 4,"Cachorro quente" => 1] for [4,1]
-
0
votes1
answer62
viewsQ: Mysql above 5mil lines
Good people I am developing a code only that I came across the following problem, when I performed performance test with 5,000 lines he exceeded the limit of 30 sec... what can be wrong?…
-
0
votes2
answers206
viewsA: Variable losing value in php
class VisualizarDados { public function requestDados() { $idBusca = $_POST['idBusca']; require_once("inc/database.php"); //SQL Carrega os dados pessoais do paciente $selectDados = $pdo->prepare("…
-
0
votes1
answer40
viewsA: Select Mutiplos Mysql
Solution SELECT * FROM agendatelefone bro INNER JOIN bairro usr ON (bro.bairro = usr.nome)
-
0
votes1
answer40
viewsQ: Select Mutiplos Mysql
I need to search data from one table and complete with data from another table... Main table: agendaphone Secondary table: neighborhood principal:…
-
0
votes0
answers109
viewsQ: Angular2 Send and receive information
Good people I’m learning to use the Angular 2 but I have a doubt. I’ve been looking on the Internet and I was told that it would be good to create a server NodeJs to receive and send data to the…
-
0
votes2
answers45
viewsA: Hide a certain amount of items
jquery $(".divIDClass").hide(); javascrpt document.getElementByClass("divIDClass").style.display = 'none'; both selected by class…
-
1
votes1
answer167
viewsQ: Error with http.post and http.get with Angular 2
Well, I’m having a problem sending and retrieving data with Angular 2. Auth.ts import {Observable} from 'rxjs/Observable'; import {Injectable} from "angular2/core"; import {Http, Response} from…
-
1
votes1
answer121
viewsA: Parceling js
function checarDatas(data_parcelamento,data_final) { var data_1 = new Date(data_parcelamento); var data_2 = new Date(data_final); if (data_1 < data_2) { console.log('atrasada'); } else if (data_1…
-
0
votes1
answer121
viewsQ: Parceling js
Well created a system of installment of accounts... would like to know how to filter... [{"tipo":0,"classe":"Saída","nome":"a…
-
1
votes1
answer582
viewsQ: Comparing Angularjs arrays
I’m creating a device for Cell... only I had the following problem: I need to compare if an account has not been paid, and send a warning... q accounts must be paid every month.. if you do not find…
-
1
votes4
answers4570
viewsA: How to avoid multiple access with the same login and password
guy 2 option puts a function on the login page that if you are already logged in sends to restricted page your.... or put in the database a new status field and have it checked when logging in... if…
-
4
votes1
answer1642
viewsQ: Problem with Session and Nodejs
I’m creating a chat with Node and Session, but I have the following problem: the user identifies and enters the room until then everything right. I am testing on 2 different computers. When I give a…
-
1
votes1
answer250
viewsQ: Chat with nodejs and mysql
I created a chat with nodejs and Mysql to search for information from user... but I have a following problem: when the connection drops or restart the server nodejs, do not go back logging user and…
-
11
votes2
answers277
viewsQ: How do I use the jsondiffpatch library?
I’m having doubts about how to manipulate the data with the library jsondiffpatch The array original: [ {"id":1004,"idproduto":3,"forma":"Alface","preco":1,"quantidade":1},…
-
0
votes1
answer583
viewsQ: Trolley with dynamic options with Angularjs
Personal I have the following problem: how to subtract 2 arrays with Angularjs. I’ve tried several ways and I couldn’t make that subtraction. I am creating a product cart with dynamic optional in…
-
6
votes3
answers1954
viewsQ: Problems adding item to array with Angularjs
I’m putting together a shopping cart with dynamic options with Angularjs. The problem is here: { "14": [ { "id": 3, "forma": "Alface", "preco": 1 }, { "3": 1 } ], "15": [ { "id": 3, "forma":…
-
0
votes1
answer607
viewsQ: Pick up complete array with Angularjs
Template <input type="text" data-ng-model="item.title" list="comicstitle"> <datalist id="comicstitle"> <option data-ng-repeat="ttl in titles" value="{{ttl.name}}">…
-
0
votes2
answers85
viewsQ: Rescue 2 arrays with Angularjs
angular query app.controller('recipedetails', function($rootScope, $routeParams, $http) { $http.get('app/querys/receita_item.php?id='+$routeParams.id).success(function(data) {…
-
3
votes1
answer785
viewsQ: Angularjs with Socket.io and Mysql data
The following query in cidade.php search how many requests are open in a given city, which blocks a link. If 0, the sum of query releases the link. If it is larger than 1 blocks the link. Controller…
-
-1
votes2
answers911
viewsQ: Refresh-free browsing
the problem and when editing "in the browser url bar" I have to press 2x enter to load the desired page... and it should only be with 1x enter the other problem is that it has since error:0 when…
-
-1
votes1
answer146
viewsQ: Distinct values
SELECT `forma`,`id_produto`,`id_lanche`,`qtd_max`, if(`id_lanche` in (select `id_lanche` from `produtos` where `id_lanche` = {$id_produto}),'checked','') as marca FROM `formas` db product = products…
-
2
votes1
answer532
viewsQ: Stock control
Guys I’m developing a shopping cart... I arrived at a part that ended up gone wrong... the next cart consists of product recipe is additional and removal of ingredients tabela produtos id nome…
-
2
votes1
answer11363
viewsQ: Convert string to function array
I need a function that converts this string into an array as follows 3:2,4:1,5:1 //string array ( [3] = 2 [4] = 1 [5] = 1 )
-
3
votes1
answer136
viewsQ: String array conversion
I have the following array as I turn it into a string. This string would be used to save the products from the shopping cart in Mysql. So they have various snacks and products: products 5,2,5 use…
-
-1
votes2
answers184
viewsQ: Optional shopping cart
Positive added / Negative removed ([1] => 3 [6] => -2 ) Next customer can change all snack settings contains a default amount (recipe) It can pull out 2x and can add 1x 2x 3x lettuce in case…
-
1
votes2
answers1483
viewsQ: How should I subtract arrays
array_intersect_ukey($result1, $result2, 'key_compare_func2') // primeiro array array_intersect_ukey($result2, $result1, 'key_compare_func2') // segundo array Upshot: Array ( [bife] => 3 ) Array…
-
0
votes2
answers1523
viewsA: Group keys from an array
<?php $array3[] = ''; $array3[] = array("bola", "quadrado", "triangulo"); $array3[] = array("esfera", "quadrado", "triangulo"); $result1 = array_diff($array3[1],…
-
-1
votes1
answer74
viewsQ: How to organize matrix
a comparison is being made: this way $result3 = array_diff($fetchForm, $items['form_id']); print_r($result3); Array ( [0] => 1 [2] => 3 ) $result2 = array_diff($items['form_id'], $fetchForm);…