Posts by Ivan Ferrer • 12,096 points
772 posts
-
0
votes1
answer45
viewsQ: Modal does not result from updated validation error when submitting a $http() request
Strange problem, with $uibModal Angularjs, when using JSON.stringify(object, null, ' '), it does not show the full return in the modal result: { "permission": true, "title": "ALUNO: aDSadaD",…
-
0
votes3
answers43
viewsA: Registering form in the Database
Create a connection file: class Connection { private $localhost; private $username; private $password; private $database; public function __construct() { $this->username = 'root';…
-
4
votes2
answers1072
viewsQ: How to make the business logo icon appear in outlook message box
I have an email trigger code using Zend. $mailTransport = new Zend_Mail_Transport_Smtp($this->smtp_host, $config); $mail = new Zend_Mail('UTF-8'); $mail->setFrom($from['email'],…
-
2
votes1
answer48
viewsQ: How to capture a jquery element and leave it changed in a new variable without changing in the view?
For example, I want to take the DOM element, and then change, without it changing the behavior in the view: //aqui pego o conteúdo da html var content = $('.content').get(0); //aqui eu reescrevo,…
-
2
votes3
answers374
viewsQ: Store CSS in string
.ql-snow .ql-tooltip{background-color:#fff;border:1px solid #ccc;box-shadow:0 0 5px #ddd;color:#444;padding:5px 12px;white-space:nowrap}.ql-snow .ql-tooltip::before{content:"Visit…
-
0
votes1
answer333
viewsQ: HTTP Access Control (CORS) for multiple domains
How to free HTTP Access Control (CORS) of images using Xmlhttprequest for all domains below on . htaccess and not using global permission with "*": Access-Control-Allow-Origin:…
-
1
votes1
answer57
viewsQ: Filter for a multidimensional matrix
How could I do to bring everything in the view and filter in a combobox by the class option? $scope.dadosUserAndTurma = [ { idUser:20, nome: "Carlos", turmas: [ {turma: "Turma 1", value: 1}, {turma:…
-
0
votes1
answer104
viewsQ: Pass $Scope.variavel for a javascript rating at home
How to pass content within config to global variables: //meu config app.run(function(editableOptions, $rootScope, $filter) { editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2',…
-
1
votes0
answers32
viewsQ: How to return a closure method out of scope when there is ajax response
I did the following method using the library xeditable: $('[data-id]').on('click',function(e) { e.stopPropagation(); var _self = $(this); var id = _self.data('id'); var editableElement =…
-
2
votes1
answer103
viewsQ: How could I merge the ties below?
This is the spreadsheet: This is the code: public function loadExcel($file, $dir) { $objReader = PHPExcel_IOFactory::createReader('Excel2007'); $filterValidation = new…
-
3
votes1
answer168
viewsQ: How to organize an array of a list
An array that looks like this: Array ( [nome_e_sobrenome] => Array ( [0] => Luiz Felipe Machado [1] => Maria Rita de Cássia ) [usuario] => Array ( [0] => luizf [1] => mariar )…
-
3
votes1
answer151
viewsA: Take the last id generated in the Insert with jquery and redirect to another page
Okay, to return, try this: if ($query->execute()) { $UltId = $db_con->lastInsertId(); echo json_encode(array('id' => $UltId, 'status'=>'1')); } else { echo json_encode(array('id' =>…
-
2
votes0
answers149
viewsQ: How to remove obsolete Warning message for $HTTP_RAW_POST_DATA?
We are using php://input in the requests in Angularjs: //método public function putData() { $params = file_get_contents("php://input"); return json_decode($params); } How it’s being used: $postData…
-
6
votes2
answers1395
viewsQ: What is the difference between ~0.0.1 and 0.0.1 in package.json version control?
This code is an example: { "dependencies": { "gulp": "~0.0.1", "browser-sync": "^0.0.1" } }
-
1
votes1
answer35
viewsA: How to register user with editable mode disabled using Angularjs and xeditable?
I figured out how to make it work: Just put that in the form tag: <form shown="false">
-
1
votes1
answer35
viewsQ: How to register user with editable mode disabled using Angularjs and xeditable?
I wish the dice had already made a Rigger in "save", or something like that, at the time of including the user, it appear without being in edit mode. See my example on FIDDLE. How could I fix this?…
-
0
votes1
answer131
viewsQ: How to find the sum of two numbers in an array that matches the input value
How to do this without the need to make two bonds. Sample method: function getPairNumbers($array, $valor) { //aqui viria o método }
-
0
votes1
answer131
viewsA: How to find the sum of two numbers in an array that matches the input value
You can test each position, start and end of the array, and test each position, and increase as you find the desired value: <?php function getPairNumbers($numbers, $target) { $result = array();…
-
1
votes1
answer74
viewsQ: How to avoid rewriting redirects?
I have the following rule at the root: RewriteEngine On RewriteRule ^webapp/(.*)$ ./sistema/public/v1/webapp/$1 [L,R=301] The problem is that when I type in the browser:…
-
0
votes2
answers568
viewsA: Query creation with Union ALL to join tables with indexing by table name
The way I did it worked, I just had to change that line: $select = $this->dbTable->select() ->setIntegrityCheck(false) ->from(new Zend_Db_Expr($sql).' AS mb', array( 'mb.ID',…
-
0
votes2
answers568
viewsQ: Query creation with Union ALL to join tables with indexing by table name
There’s a problem that they did in a database, which I need to solve temporarily, they created several tables with index in the table name, where the system creates a new table for each new user...…
-
0
votes2
answers199
viewsA: Error request with jquery-autocomplete?
I solved using another library, which works perfectly: http://easyautocomplete.com/guide#sec-data-remote function highlightText(data, term) { term =…
-
0
votes2
answers199
viewsQ: Error request with jquery-autocomplete?
I have the following file gulpfile.js build, to generate the files css and js. He’s generating me two files: $('#instituicao').autocomplete({ source: function (request, response) {…
-
1
votes0
answers167
viewsQ: Error connecting to pdo_mysql when using Docker with apache and mysql
I’m using Docker with apache 5.6 + mysql: Mysql Oficial Docker PHP Official PHP - Version 5.6 I first ran the mysql image, then ran the following command line to run the apache image, linking the…
-
3
votes1
answer93
viewsQ: How to convert number into billions for a smaller comparison chain?
Imagine you have an exercise in the following aspect, I need to take from an array with random integers, the largest number that is between the intervals. For example, I have an array: array(2, 8,…
-
1
votes2
answers53
viewsA: How to give an echo in the sport?
Your question is not very coherent, because there are two keys with the name "modality", besides, you did not specify if you want to print the value or the key, but if your desire is to get the…
-
1
votes1
answer614
viewsA: Lock the body scroll to a certain height
One way to solve the problem is by removing the scroll of the desired page or element, until the bearing height reaches the mark, however, you will need to inform that this rule only works for the…
-
5
votes1
answer141
viewsA: Equal mention system Twitter and Facebook
Picks up data via regular expression: $texto = '@Felipe @luizao @Patronaltacao abobrinha @hashtag @ textoxyz @NomeAqui'; preg_match_all('/(^|\s)(@\w+)/', $texto, $result); $data = $result[2]; $data…
phpanswered Ivan Ferrer 12,096 -
3
votes4
answers1467
viewsA: Show and hide div
Has, 2 problems in your method: if has to be "==", when you use a single "=", you are adding value within the condition. you need to inform the correct element that will make the loop In case it’s…
-
2
votes2
answers1090
viewsA: Send value from a radio input to php
To work with the frm.serialize() form, try this way: <?php if ($_POST) { echo $_POST['seguro']; die(); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8">…
phpanswered Ivan Ferrer 12,096 -
0
votes1
answer217
viewsA: How to get Promise in Service and only send the uploaded data to control?
I solved the problem at service, using $rootScope to preserve the "Collection" of the first consultation, and $q.defer(), to delay the return until the "Collection" of "Promise" is answered":…
-
0
votes1
answer217
viewsQ: How to get Promise in Service and only send the uploaded data to control?
I have a json file with the following sample structure:…
-
0
votes3
answers137
viewsA: How to parse the return of the __getFunctions() class Soapclient method
By the model presented, your query would be something like this: $parametro = 'Sua consulta'; $client = new SoapClient('http://path/seuwebservice.wsdl');…
phpanswered Ivan Ferrer 12,096 -
1
votes2
answers5168
viewsA: Relational database model with SKU
The model you have made should meet the current needs of your project, should not worry so much about what may occur in the future, the most important is that it meets the needs of now and that is…
-
0
votes2
answers707
viewsA: Query Mysql returns no error or result
The problem may be in the format of the date field, as you did not pass the table structure, it is difficult to identify the problem, see if this would solve your case: SELECT…
-
1
votes2
answers134
viewsA: Count only from visible cells
You can do this after the execution of for(), for the other elements, as you are aggregating the 'Visible' in the element with .css(): var total = $('.notification-badge[style="visibility:…
-
1
votes4
answers560
viewsA: How to return correctly the values of calculations with decimals in javascript?
The use of the comma is wrong, when using number, no comma is used, the comma is represented by the dot in Javascript. the use of the parseFloat(), is parsing what he considers number, ie the value…
javascriptanswered Ivan Ferrer 12,096 -
0
votes2
answers295
viewsA: wp_pagenavi does not work in Category.php
See if this sets the limit you want in line 5: <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array('posts_per_page' => '8'); query_posts($args . $query_strings…
-
2
votes3
answers5179
viewsA: Format decimal places in PHP using point and comma
In case, what you need is very simple, remove any value other than number: $entrada = '100,30'; echo preg_replace('/[^0-9]+/','',$entrada); Example in IDEONE…
-
3
votes3
answers7194
viewsA: What is a method " __contruct()"?
Not every class needs a constructor method. The constructor is basically for you to start a class, eventually it is possible to set input parameters for this initialization, as well as to call…
-
6
votes2
answers410
viewsA: Form only submits with the Enter key
I solved the problem as follows: .bootstrap .btn.btn-default i { color:#555, pointer-events:none; /* aqui retiro qualquer evento no ícone */ }
-
1
votes1
answer122
viewsA: Problem with icon overlay on commit button
I solved the problem as follows: .bootstrap .btn.btn-default i { color:#555, pointer-events:none; }
-
1
votes1
answer122
viewsQ: Problem with icon overlay on commit button
In a store based on Prestashop, in the backoffice, there is a button that has an icon inside that is preventing the submission of a button, as could cause the icon to be ignored when clicking this…
-
2
votes2
answers410
viewsQ: Form only submits with the Enter key
Inside the backoffice of a Prestashop-based store V.1.6.1.3. When I try to register a product, it happens very strange problem that does not present error in anything even using debug mode on:…
-
1
votes1
answer267
viewsA: Sequential number in a dynamic form
To do this, simply create a counter in the event: Jquery: $(function() { $('#remove').on('click', function() { var bt = $(this); ($('.history').length == 2) ? bt.hide() : bt.show();…
-
2
votes1
answer2600
viewsA: Delete button with modal mysql/php
Using the modal, you should think about front-end first, the back-end part should be thought about later: HTML: <div id="status" class="alert"></div> <table class="table">…
-
2
votes4
answers232
viewsA: How to change the date order of an implode from a jquery datepicker
The Datepicker has input formatting: var date = $('#datepicker').datepicker({ dateFormat: 'yy-mm-dd' }).val(); Look in the documentation. But if you want to invert only in php, just format the…
-
6
votes2
answers7136
viewsA: Find duplicate values in an array
Actually you don’t need one foreach to identify duplicate values: $courses = array('teste', 'teste2', 'teste3', 'teste'); function getDuplicates( $array ) { return array_unique( array_diff_assoc(…
phpanswered Ivan Ferrer 12,096 -
5
votes7
answers2833
viewsA: How to check if at least one item of the array has value equal to or greater than 2
Here’s a simple way to know indexes: function checkIndexTwoOrLarger(arr) { var achou = false; arr.forEach(function(v, i) { if (i >= 2) achou = true; }); return achou; }…
-
1
votes5
answers3011
viewsA: How to run a PHP function multiple times?
The best way to do this is by creating a task scheduler to run your script every 2 seconds. To do this, it will depend on which server is windows or linux, and a certain configuration in apache. For…
phpanswered Ivan Ferrer 12,096