Posts by Duque • 655 points
35 posts
-
0
votes1
answer31
viewsQ: Problem with scope of variables in child class
I created an interface with Tkinter to use as Environment for my studies with reinforcement learning. My goal is to run the class that creates Nvironment and with an external loop, send actions to…
-
-1
votes1
answer432
viewsQ: Docker: Upload large sql file
People are having problems with Docker. I’m using Docker and the docker-compose to create and configure a web environment quickly and practically. I’ve been using Docker for a while, but I’ve never…
-
1
votes1
answer37
viewsA: Component is printed 2 times in browser
I managed to solve the problem. I removed the router-outlet tag from home.html and created an appComponent to launch the application. That’s how you solved the problem.
-
0
votes2
answers216
viewsA: Sort the largest on request
There’s your solution, my friend. select cliente_id, desconto, pedidos_detalhes.pedido_id, cliente_tipo from pedidos_detalhes inner join pedidos on pedidos_detalhes.pedido_id = pedidos.pedido_id…
-
2
votes1
answer37
viewsQ: Component is printed 2 times in browser
Good guys, I’m developing an app with angular2 final version using routes. I created some files and then came across a problem of routes. My Component Home is printed 2 times in the browser. In the…
-
0
votes1
answer198
viewsA: Iterating on a multidimensional array
Friend, the index of the array that contains the alternatives needs to start at 0, as well as the indexes that contain the questions, so the iteration of the array between the questions and answers,…
-
2
votes2
answers1084
viewsA: Upload Multiple Codeigniter
Friend, I have a class for this purpose. Create a library in your project and add the class code. class Files { private $Files = null; private $SaveTo = null; private $Length = null; private…
-
2
votes1
answer153
viewsA: Extract values from an array and mount one or the other
Friend, I developed your solution, but you need to deal with the mistakes that will appear, because I noticed that the indexes are not common. It is up to you to deal with these exceptions. $data =…
-
14
votes5
answers10575
viewsA: Subtraction of hours in php
You can use the Datetime() class to find out the difference between two dates. /** * @param $dateStart - Data inicial * @param $dateEnd - Data final * @param $format - Formato esperado de saida */…
-
0
votes2
answers3510
viewsA: send email to codigneter using SMTP GMAIL LOCALHOST
Friend, your gmail host settings are incorrect. Follow the correct setup, try this one. $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' =>…
codeigniteranswered Duque 655 -
1
votes2
answers117
viewsA: take the input field value of a gridview with jquery
Friend you need to treat the values that comes from the inputs. For this, follows the solution.. function numberFormat( num ) { var nFormat = num.replace(/\./g, ''); nFormat = nFormat.replace(/\,/g,…
-
1
votes1
answer252
viewsA: Count characters in a string from a search made in the string itself
you can use the function strpos() php, it finds the position of the first occurrence of a substring in the string. If no occurrence is found, this function returns false. The solution for you is…
-
1
votes2
answers544
viewsA: How to add options to a drop-down list using jQuery?
has two forms, using a tie each or for. I’ll demonstrate using the for for(var i = 0; i < data.length; i++) { var id = data[i]['ID']; var name = data[i]['NOME']; var $option = $( '<option…
-
0
votes2
answers198
viewsA: Problem with AJAX Jquery
Buddy, in the onclick() event you sweat in the tag <a>, you pass 4 parameters, but in the checkData() method, you pass none. Try this: function checkData(arg1, arg2, arg3, arg4, arg5 ) { var…
-
0
votes2
answers392
viewsA: Function does not enter ajax success with jquery
Friend your problem is here: url: '/CadastroAcesso/CarregaDadosPagina', You need to pass the full url, example: url: 'http://www.seusite.com.br/CadastroAcesso/CarregaDadosPagina', Also make sure…
-
0
votes2
answers783
viewsA: How to execute method by clicking a button type
The best way is to make an Ajax call, for that: var sendEmail = function () { $.ajax({ type: 'POST', url: 'http://www.seusite.com.br/metodo', //Aqui é a URL até o método onde está a instrução de…
-
0
votes3
answers436
viewsA: Assign dynamic value to a variable in Jquery
Friend, Jquery has a function called attr(). The syntax of the command is: $( seletor ).attr( 'nome_atributo' ); Now to solve your problem, do: $(document).ready(function() { var sts1 = ''; $( 'a'…
-
1
votes1
answer87
viewsA: Reverse the order of fwrite
You want to enter the data at the beginning of the file, you can use this function. function prepend($string, $filename) { $context = stream_context_create(); $fp = fopen($filename, 'r', 1,…
-
0
votes1
answer70
viewsA: PHP - Sessions and cookies
You can use the PHP header function header("Location: http://www.seusite.com.br"); More details here: php header function…
-
1
votes1
answer138
viewsA: I can’t place a new column inside a table
Your code is playing the tag <tr></tr> designating the lines. Aesthetically it is ugly, you can improve this by adding another field in this table where you will put a button on the same…
-
0
votes2
answers68
viewsA: find() is not searching for all input’s
See, in this line you will get an object with inputs of type radio and text var __thisElement =__thisQuestao.find(":input"); In order for you to verify all, you need to iterate this object into one…
-
3
votes1
answer3022
viewsA: Scroll bar in a select
select{ overflow-y:auto; } <select size='3'> <option>a</option> <option>b</option> <option>c</option> <option>d</option>…
-
1
votes1
answer962
viewsA: How to send data from a dynamic HTML table via json
you can try like this: var dados = []; var i = 0; var table = $('#tblContato'); table.find('tr').each(function () { dados[i]['id'] = $( this ).find( 'td:nth-child(1)' ).text(); dados[i]['nome'] = $(…
-
0
votes2
answers206
viewsA: Sum int with date - PHP
do so: echo date('d/m/Y', strtotime("+" . $ultima_frequencia . " days",strtotime($ultima_data))); Concatenating, your code becomes more readable.
-
0
votes2
answers1288
viewsA: How do I make the file sending field invisible?
Friend, to style the countryside input[type=file] I use the Jquery Filestyle plugin. You can do a lot of nice things with him. More information here: http://markusslima.github.io/jquery-filestyle/…
-
5
votes5
answers32695
viewsA: Read and manipulate json data using jquery
Friend you have an object in hand. To manipulate the object you use the syntax: *object[key] ou object.key* In your case you’ll stay: console.log( data[0]['id'] ); To insert this data into a DIV or…
-
0
votes5
answers3267
viewsA: Php returns null JSON when it has accent in Mysql
Friend, you can use the mb_convert_encoding function to convert the encoding //In this case, assuming the standard is in ISO-8859-1 and you want UTF-8 mb_convert_encoding($utf8, 'UTF-8',…
-
0
votes4
answers912
viewsA: Add variables to obtain end date
//Obtem a data atual. $date = date('Y-m-d'); //Data atual 29-03-2016 //Quantidade em meses para somar a data $qtdMes = 6 //"quebra" a data em 3 partes usando como delimitador o "-" list($year,…
-
0
votes1
answer95
viewsA: Split form to insert into rows other than Database (codeigniter)
As I see it, your problem is one of logic. If your form is dynamic, there is certainly a button to add a new question, even if a previous one has not yet been saved, correct ? I had a similar…
-
0
votes2
answers740
viewsA: Codeigniter media upload error
You have write permission in the directory where the files will be saved? $config['upload_path'] = './uploads/';
-
0
votes3
answers428
viewsA: Test equal values (data) in PHP
You can use the strtotime function to generate an integer and then compare, see: $dateIni = '01/08/2014'; $dateFim = '30/08/2014'; echo strtotime($dateIni) == strtotime($dateFim) ? true : false;…
-
1
votes1
answer913
viewsQ: Generate PDF from selector on current page with CSS
I would like to know how to generate a PDF from a selector that I define and that all the formatting of this selector comes correctly in PDF? I want to make client-server. Example: Imagine that I…
-
0
votes1
answer539
viewsQ: Oracle Database 11G R2 Start Service
How do I start the Oracle database service? I installed 11G R2 for DESKTOP on the machine on Windows.
-
0
votes2
answers3089
viewsA: How to filter results and reload the/view page in Codeigniter?
From what I understand, you’re passing values between views to keep the selected one and then doing the filtering, right? Why not use a little Jquery and use the Ajax function to bring the data…
-
3
votes2
answers171
viewsA: Generate a search url?
You mean: Pass parameters via URL? If so, check your configuration file at application/config/config.php if the query strings option is enabled. $config['enable_query_strings'] = FALSE; If you are…