Posts by Kenny Rafael • 6,698 points
139 posts
-
1
votes1
answer164
viewsA: Problems with a Select Codeigniter + PHP
If the relationship already exists between the tables, you do not need to make one query at a time, you should make one join in the consultation itself, which in this case should remain so: $status…
-
2
votes4
answers232
viewsA: How to change the date order of an implode from a jquery datepicker
Try the following: $v_datainicio=date_create($v_datainicio." 00:00:00.000"); $v_datafinal=date_create($v_datafinal." 00:00:00.000"); echo 'valor recebido: '. date_format($v_datafinal,"Y-d-m H:i:s");…
-
6
votes7
answers2833
viewsA: How to check if at least one item of the array has value equal to or greater than 2
According to your question, it is enough to know if there is any number greater than or equal to two, in this case, a single loop is sufficient... function checkArray(myArray) { for (i = 0; i <…
-
1
votes2
answers354
viewsA: Mouse events (when passing an x element) Jquery
The ideal is that you use the method mouseover in fact, in this case there in your PHP would be as follows: $('#<?php echo $x?>').mouseover(function(){ $('#<?php echo…
-
6
votes3
answers3050
viewsA: How to change the color of the input using jquery Validate?
Just use the callbacks highlight and unhighlight: <html> <head> <title>Como Validar um Formulário dinamicamente com jQuery</title> <script type="text/javascript"…
-
0
votes2
answers475
viewsA: Create arrays inside while
$urls = file_get_contents('https://www.google.com/#q=teste'); // teste é a palavra que vai pesquisar no google preg_match_all('/\b(?:(?:https?|http):\/\/|www\.)[-a-z]*.com.br/i', $urls,…
-
2
votes2
answers79
viewsA: Show items in jQuery, using internal loop
The problem is that you need to store the values in an array, and each time you do the calculation you are overwriting the value into a single variable, try this: var quantidade_dividida_acima = [];…
jqueryanswered Kenny Rafael 6,698 -
0
votes2
answers41
viewsA: How not to have Warning if I leave empty in the formula multiplication discount?
Just put a if before making the calculation: <ul class="deal-single-value"> <?php $deal_price = get_post_meta( get_the_ID(), 'deal_price', true); $deal_sale_price = get_post_meta(…
-
2
votes2
answers145
viewsA: avoid error logging with mysql connection
You can use a trycatch for any exception that occurs it falls into an area where you can customize the response: try { mysqli_connect($ip_bd_mysql, $login_bd_mysql, $senha_bd_mysql, $banco); } catch…
-
1
votes2
answers838
viewsA: Problems with Modal Bootstrap and Deletion of Records
This happens, because despite "hiding" the modal, you are doing the bind of the delete event on the confirm button each time you click on a delete link, as the button remains on the DOM, the event…
-
2
votes1
answer761
viewsA: Fix Header and Footer on each print page
body { width: 99%; height: 950px; } .brasao-umuarama { width: 99%; height: auto; } .logo-drz…
-
1
votes1
answer68
viewsA: Save value of a constant through a form
First point: In your form the field name cannot be MSSQL_Pass if you want to receive the value name; Second point: You need to use hardcode if you want to use this rule function write(){ $file =…
phpanswered Kenny Rafael 6,698 -
2
votes1
answer138
viewsA: php undefinex index
That’s just one Notice of PHP that is, does not impact the execution of the script, but for it does not occur, just use a isset before trying to use the variable: if(isset($_FILES["foto"])) $foto =…
-
2
votes2
answers397
viewsA: Sort according to database | PHP
Your logic is correct apparently, I seem to miss only "save" the reference data to each item: $this->db->select("coe_classificacao"); $this->db->where("set_base != ", 12); // conteudo…
-
3
votes4
answers1225
viewsA: How to block website and leave free only for some ips?
An option to block access would be via .htaccess: APACHE 2.4 <Limit GET POST> Require all denied Require ip 10.11.30.175 Require ip 10.11.30.182 </Limit> APACHE 2.2 <Limit GET…
-
1
votes1
answer219
viewsA: leave a responsive image horizontally, but not scaled, but cut horizontally
You need to put the image as background of some div: .img-responsive { background: url('http://i.imgur.com/xRxFRSY.jpg') top center; width: 100%; height: 250px; } <div class="img-responsive">…
-
0
votes2
answers812
viewsA: Check for repeated numbers between two php arrays
Using the function array_intersect of php: <?php $array1 = array("a" => "green", "red", "blue"); $array2 = array("b" => "green", "yellow", "red"); $result = array_intersect($array1,…
-
0
votes1
answer1666
viewsA: How to position the iframe below according to the position I want on the screen?
<div id="iframe"> <iframe width="1100" height="500" id="processoControleExterno" src="www.google.com" scrolling="no" > …
-
0
votes2
answers192
viewsA: Remove value "json header"
$array = json_decode('{"37":{"codigo":"37","firstname":"Aluno","lastname":"Toledo","atividade":"A","checklist":null},"1475":{"codigo":"1475","firstname":"Alzira","lastname":"…
-
0
votes4
answers1272
viewsA: Run command Ctrl+V "paste" with mouse click inside an input
That should work: function paste() { document.execCommand('paste') } $(function(){ $('input[type="text"]').focus(function(){ paste(); }); });
-
1
votes1
answer133
viewsA: How to order query using PDO?
Just add the clause ORDER BY in its query with the DESC: $Query = "SELECT DISTINCT(funcionarios.usuario), date_format(funcionarios.data,'%d/%m/%Y %H:%i:%s') as data , codigo, nome FROM…
-
1
votes1
answer289
viewsA: Edit html+php+jquery items
You can only assign one id to do the bind of click, for this reason its ajax only works in the first item, and as everyone has the same id every time you do the sending, no matter which line you…
-
3
votes1
answer914
viewsA: Join 3 forms in 1 Submit
Assuming you want to send all data in the same Ubmit and that you use jQuery, I will propose the following solution: <script…
-
1
votes6
answers9622
viewsA: Transform json array into php array
In order to access this way: $infor->Players->list; you need to remove the second parameter true: $infor = json_decode($lista); Otherwise, it will convert to an associative array, and will…
-
2
votes2
answers775
viewsA: Calculate values (R$) from quantity
You may not know it yet, but for this calculation there is a type of variable called float, which allows you to work with fractional numbers, without having to make this logic with the integer. Try…
phpanswered Kenny Rafael 6,698 -
1
votes4
answers86
viewsA: Hiding div by jQuery
Just put a return inside the first IF, so that the execution does not continue: $('#btnFiltros').click(function () { if ($('#divFiltros').css('visibility') === 'visible') {…
-
1
votes2
answers211
viewsA: Checking if element is visible with jQuery
You can use both: if(!$('.target').is(':hidden')) as if (!$('.target').css('visibility') == 'hidden')) or even if($('.target').is(':visible'))…
-
-1
votes2
answers317
viewsA: How do I use the same session in the Standard for all subdomains?
Capture the ID session Session::getId() in Domain A Send the ID captured via HTTP POST for Domain B Receive this value in Domain B $sessionid_from_domainA = \Input::get('ID'); Set in session ID in…
laravelanswered Kenny Rafael 6,698 -
2
votes1
answer1214
viewsA: View confirmation modal after sending email
In my view, the simplest way to build any front-end, including modals, is by using boostrap. In this case, you could do as follows: <?php function error($data) { foreach($data as $key => $val)…
-
3
votes2
answers213
viewsA: How to avoid excessive line breaks in a textarea
Use this: $html = "Seu conteúdo <br/><br/> quebras e mais quebras"; preg_replace("/(<br\s*\/?>\s*)+/", "<br/>", $html); Taken from: How to Convert Multiple br tag to a single…
-
3
votes2
answers2715
viewsA: Xdebug in Xampp
The standard path of php.ini of xampp is this: C:\xampp\php\php.ini Just access and edit it.
-
8
votes3
answers4603
viewsA: Check that the value is integer
The value 1.00 will always be considered a float, but you can validate it as follows: $value = "1.00"; return floor($value) != $value; If the value in float really be an "integer", the condition…
phpanswered Kenny Rafael 6,698 -
0
votes2
answers1304
viewsA: Catch event click on jQuery autocomplete value
Simply overwrite the original callback function: function AutoCompleteSelectHandler(event, ui) { $('#Campo2').val(ui.item.value); } or in this way by adding the callback select: API jQuery var…
-
2
votes2
answers93
viewsA: Embed link to search box redirect
Even though I already have a correct answer, I will post a suggestion with jQuery, as well as reminded his own friend who replied: HTML: <input type="text" id="link" /> <button…
-
6
votes2
answers1707
viewsA: Routes Laravel 5.3
Friend, to use several files, there are some options, one of them is to edit this service App\Providers\RouteServiceProvider, where the following methods are used: protected function mapWebRoutes()…
-
0
votes1
answer400
viewsA: Upload PHP and Mysql image array
I would save everything in a JSON, much faster to read and you can insert Keys to link to records also...staying at your discretion, but at first only savaria in JSON same: $file =…
-
1
votes1
answer160
viewsA: How to export and download EXCEL file?
Let me get this straight: $file_path = 'excel.xls'; $excel = new ExcelWriter($file_path); if ($excel == false) { echo $excel->error; } $myArr = array('NOME', 'EMAIL', 'TELEFONE', 'ACERTOS');…
-
1
votes3
answers1227
viewsA: Take the id of a database list, and use in another page to insert phones in PHP
Going through everything by get is not the best option, you have to pass only the ID and on the page insert the data you consult the record to know if it exists, if not, you can display some error…
-
3
votes1
answer644
viewsA: Get the Urls from the Google search result page
Google has a service for this: "https://www.googleapis.com/customsearch/v1?" "q=" + search (example "Star+Wars") "&Cx=" + your code CSE (Custom Search Engine) "&key=" + Key to your API…
-
1
votes3
answers758
viewsA: How do I know if a record has been added to the database?
Nicolas, from what I understand your need, do not exste a method that will do everything you need, so I will suggest what I would do in your situation: Alert insert in the database Read in a json…
-
1
votes1
answer851
viewsA: Error page 500 returned instead of Laravel error page
I was able to solve the problem, a user from another forum suggested that due to Laravel 5 still not stable (about 7 months before now), should have made the following change: bootstrap app.php Of:…
-
6
votes2
answers9932
viewsA: What is the difference between . prop() and . attr()?
Depending on the situation, actually . prop() brings the value, literally and . attr() the content, for example: <input type="checkbox" checked="checked"/> $('input').prop('checked');…
jqueryanswered Kenny Rafael 6,698 -
0
votes1
answer851
viewsQ: Error page 500 returned instead of Laravel error page
I don’t know why errors aren’t rendered in my project, it just doesn’t go through the Handler method. bootstrap/app.php <?php $app = new Illuminate\Foundation\Application( realpath(__DIR__ .…
-
1
votes0
answers51
viewsQ: Error enabling APC in local environment, using wamp 2.5, PHP 5.5.12, Apache 2.4.9 in windows 10
I’ve downloaded several Dlls but I can’t enable this extension, I’m working on an application where for N reasons I can’t give it up, usually it gives me the following Warning: Trying to use this…
-
12
votes6
answers12772
viewsQ: How to locate a value in an array with a specific structure
I need to locate the position of one array within another, in the following structure: array{ [0]=>{ ["id"]=>"5744" ["fk"]=>"7" ["nome"]=>"Nivel 1" ["created"]=>"2014-04-30 16:54:14"…
-
1
votes2
answers234
viewsA: Update on Zend 2
Try this: $sql = $this->tableGateway->getAdapter() ->createStatement( 'UPDATE notafiscal en INNER JOIN entrada e ON e.id_notafiscal = en.id_notafiscal and id_entrada=' . $idEntrada . ' SET…
-
2
votes1
answer193
viewsQ: How to check if a transaction was started in Zend
I have a method where a BEGIN TRANSACTION in Zend 1.12. As it is used in many places, it has occurred that a method that calls it already starts a BEGIN TRANSACTION, thus generating a Exception. I…
-
7
votes5
answers21918
viewsA: How to replace the <img src> of a small image with a large image?
The best thing you do is use some specific plugin for this, I recommend the colorbox, you don’t need to break your head by programming the javascript, besides other features, then just customize the…
-
2
votes2
answers1944
viewsA: Load Bootstrap Carousel
If you have an average carousel load time, you can hide it and display it only after loaded, +- like this: .carousel-inner { display: none; } then you insert a script: setTimeout(function(){…
-
2
votes4
answers7584
viewsA: How to use AJAX with Laravel?
I don’t understand of lavarel, work with the zend and I imagine that it works basically the same way, in ajax, you’re going to have to make some kind of request to have that return, ie in your…