Posts by Diego Souza • 16,524 points
642 posts
-
0
votes0
answers789
viewsQ: Geolocation by Kilometer Radius from a Central Point
I’m looking for how to make a geolocation script to find cities within a radius of X Km from a central point. How so ? For example, in a combobox I choose a city - Rio Claro/SP - from there I want…
-
1
votes2
answers2555
viewsA: How to Type in a Select?
I put in the Snippet just to organize. The JS is simple, in the selector #q which is the field, each letter I type is searched in the database and success I show these results by means of a append.…
-
0
votes3
answers50
viewsA: comma between the arrays
Place variables in an array and do the implode. Example <?php $arr = ['Segunda', 'Terça', 'Quarta', 'Sexta']; echo implode(',', $arr);…
phpanswered Diego Souza 16,524 -
1
votes1
answer123
viewsA: System to identify the user owns the PHP + Mysql topic
In the if are two signs of = for comparison. You didn’t get the result of yours query, for that I used the mysql_fetch_array(). <?php $connect = mysql_connect('localhost','root',''); $db =…
-
27
votes1
answer10250
viewsA: What is REPLACE INTO for in MYSQL?
The REPLACE INTO is interesting. Let’s imagine a table: ID NOME 1 Diego 2 José I want to update José’s name to José Pedro. REPLACE INTO USUARIOS (ID, NOME) VALUES (2, 'José Pedro') Command will do…
mysqlanswered Diego Souza 16,524 -
4
votes2
answers707
viewsA: How to limit display of records to 30 days from today’s date
In MySQL one SELECT can do this: SELECT * FROM tabela_x WHERE Data BETWEEN DATE_ADD(NOW(), INTERVAL -30 DAY) AND NOW();…
-
1
votes3
answers1382
viewsA: How to put a submenu, on a menu I already have?
Just add these two classes to your CSS: /* SUBMENU */ header nav ul li > ul{ /* esse último "ul" seria o submenu */ display: none; } header nav ul li:hover > ul{ display: block; } The first…
-
-1
votes1
answer379
viewsA: Laravel 5.2 Include Field for Authentication
In the model User.php, change the row below with the columns you want: protected $fillable = ['nome', 'email', 'password']; Being email and password responsible for login on the system.…
laravel-5answered Diego Souza 16,524 -
3
votes1
answer1417
viewsA: Icon next to input
div{ width: 400px; background-color: #E7E7E7; border:1px solid #C7C7C7; } i{ background:…
-
0
votes2
answers1059
viewsA: I cannot return the authenticated user in Laravel
I don’t know what happened to your Laravel, or if it’s like that, but the function postLogin() that’s in that file AuthenticatesAndRegistersUsers.php should be like this: public function…
-
1
votes2
answers522
viewsA: Search by data php Pdo
To make a search easier I use a way when it comes to single search. For example, do a search that searches everything of the day 26/01/2016. Then in the SELECT I do like this: SELECT * FROM TABELA…
-
0
votes5
answers100
viewsA: Copy a word from a column to the end
You can do that with the two-function junction: substring_index(string, delimitador, número da ocorrência do delimitador) that searches for the string you want and makes the split. and…
-
-2
votes1
answer1132
viewsA: HTML does not load font style located in remote folders
Lowers the Source in ttf, goes on this website: http://www.fontsquirrel.com/tools/webfont-generator, click Upload, select the file ttf. Then click on the option expert, choose which types of source…
-
2
votes1
answer68
viewsA: Why do Divs move after inserting content?
Just put: vertical-align: top or overflow: hidden. In class box. Using the vertical-align: top, elements will be at the top regardless of their content that can change the parent element due to its…
-
1
votes2
answers6097
viewsA: How do I put Hover in an image?
The Father element would be the div that contains the image. That one div must be position: relative. Inside it I put a span with a text. This span must be position: absolute which will be under…
css3answered Diego Souza 16,524 -
1
votes3
answers167
viewsA: How to know if at the beginning of a <p> they have "x" character?
$(document).ready(function() { var str = $("p"); $(str).each(function(index, value) { if(str[index].innerHTML.chartAr(0) == '>' || str[index].innerHTML.chartAr(0) == '>'){…
-
2
votes1
answer877
viewsQ: How can I replace multiple words without using STR_REPLACE?
For example, I want to take bad words out of a text. How can I do using the substitution method ? Something that is faster. Use the str_replace() is not very fast.
phpasked Diego Souza 16,524 -
0
votes4
answers1768
viewsA: What is the difference between ; and & in a URL?
Briefly that’s what: If you use & or ; in query string generated by the code itself (HTML, or JS) for parameter separation. However, the & can be used also in query string generated by a…
-
1
votes1
answer211
viewsA: Sorting the results of a query - Laravel 5.1
You can bring all the reports in one SELECT: <?php use DB; ... $relatorios = DB::table('CgrtInfo') ->join('empresa', 'empresa.id', '=', 'CgrtInfo.id_empresa') ->orderBy('empresa.id')…
-
4
votes5
answers6065
viewsA: Get input array value
Define a class on input. <input value="<?=$fs_value?>" name="valor" type="button" data-toggle="modal" data-target="#delSession" class="pegarValor"> Done this, call the jQuery function by…
-
1
votes2
answers959
viewsA: Jquery hover function in dynamic elements
The first term is the event, the second is the element. But it is not enough just for the class, it has to put the element too, concatenated with the class or not. If it is a a, if it’s a div, at…
-
0
votes1
answer209
viewsA: Group JS and PHP Array
I did it. But I don’t know if that can be considered a RTA or POG. As you can see in the montage of array in PHP, I put in the key a p when it is product, concatenating with the id of the same. And…
-
0
votes1
answer209
viewsQ: Group JS and PHP Array
I’m doing an information query in the database like Google Instant, where you type and already appears the results below. I managed to do this, but I want these results to come together. I’m doing…
-
3
votes4
answers728
viewsA: Dynamically assign function
See if this meets your need; var closestByClass = function(el, clazz) { while (el.className != clazz) { el = el.parentNode; if (!el) { return null; } } return el; } document.onclick = function(e) {…
-
5
votes2
answers513
viewsA: Database search with value of <select>
HTML <select class="form-control" id="inputUnidade" name="inputUnidade"> <option>Selecione</option> <option>*GCOI</option> <option>ESC - RJ</option>…
-
9
votes3
answers596
viewsA: Round a number to Top 4023.8599999999997€
PHP <?php $var = 4023.8599999999997; echo round($var, 2).'<br>'; // 4023.86 echo ceil($var).'<br>'; // 4024 echo floor($var); // 4023 round() - Automatically round, makes the…
javascriptanswered Diego Souza 16,524 -
1
votes2
answers189
viewsA: Always top image when receiving the Hover effect
Define a z-index, down below: .hvr-grow:hover, .hvr-grow:focus, .hvr-grow:active { -webkit-transform: scale(1.8); transform: scale(1.8); position: relative; z-index: 10; }…
-
2
votes1
answer37
viewsA: Masonry - load it again after applying filters on the result
Puts this inside a function: function chamaMasonry(){ var $container = $('#container-masonry'); // initialize $container.imagesLoaded( function() { $container.masonry({ columnWidth: 540,…
javascriptanswered Diego Souza 16,524 -
1
votes1
answer2094
viewsA: How to put a SECTION next to each other?
.principal { background-color: #000000; height: 270px; width: 100%; } div.wrapper{ position:…
-
7
votes2
answers156
viewsA: Syntax error in SELECT, in PHP
WHERE comes before ORDER BY SELECT * FROM tabela WHERE ROWNUM = 5 ORDER BY coluna
-
3
votes3
answers1955
viewsA: Ajax works locally, but does not work on the server
In his <body> of Masterpage put it like this: <body data-base="http://www.dominio.com.br/"> In data-base would be your main LINK. Then create a global variable (or not) in JS: var…
-
3
votes3
answers2107
viewsA: Route access control - Laravel 5.1
You can’t use just one Route and only one Middleware ? Route::group(['middleware' => 'auth', 'middleware' => 'admin'], function(){ Route::get('inicio', ['as' => 'inicio','uses' =>…
-
3
votes1
answer226
viewsA: Clear field after X time
function LimpaCracha(){ document.getElementById('cracha').value = ''; } setInterval(function(){ LimpaCracha(); }, 10 * 1000); where 10 is the number of seconds. Cleans every 10 seconds.…
-
7
votes1
answer492
viewsA: Hover over div and open larger
So you refer to ? div.content { position: relative; padding: 20px; width: 880px; } div.blocos { width: 200px; height: 200px; margin: 5px; float: left; border: 1px solid black; cursor: pointer;…
-
5
votes3
answers11090
viewsA: SQLSTATE[42S02]: Base table or view not found: 1146 Table
Is not in the Migration who does this, is in Model. Open the created Model. Probably, Providers.php. Puts: protected $table = "fornecedores"; And forehead. Documentation…
-
1
votes1
answer1372
viewsA: Scroll bar does not descend until the end
Define a padding-bottom in the ul inside the sidebar-wrapper. Probably the parent element of your Links. So the scroll bar will go down a bit more to be able to see all the Links from the MENU.…
-
1
votes1
answer504
viewsA: Arrow in menu with CSS and apparent when clicked
First, you have to have a CSS like this: .dropdown.current { width: 0; height: 0; position: absolute; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 10px…
cssanswered Diego Souza 16,524 -
13
votes2
answers6309
viewsA: How to remove a CSS attribute with jQuery?
Remove a CSS attribute: $(el).css("color", ""); Remove multiple CSS attributes: $(el).css({ "color": "", "background-color": "", "outline": "", });…
jqueryanswered Diego Souza 16,524 -
2
votes4
answers2091
viewsA: How to send variables via ajax/php
That’s the way it is: $.ajax({ url:'colPasta.php', type:'GET', data: { col: <?php print $colar; ?>, col_2: <?php print $colar2; ?>, col3: <?php print $colar3; ?> }…
-
0
votes2
answers216
viewsA: Error in php data return in Ionic
Takes the die() as function return and uses itself return. if(isset($_GET['cep'])){ $correios = Correios::cep($_GET['cep']); $correios = json_encode($correios[0]);…
-
3
votes2
answers4705
viewsA: Laravel database connection error
You can do it two ways: To first is edit the file .env that comes in the project root folder when you create the project in Laravel. In the archive .env you’ll find something like this: DB_HOST=…
-
1
votes1
answer110
viewsA: Error with CSS application
In his second image, which would be the archive main css. has a tag that doesn’t exist: <stily></stily> Take her out of the code. Also, when the file is .css you don’t have to put that…
-
5
votes1
answer986
viewsQ: Is loading PHP into JS a good practice?
I see quite often in some questions here Sopt some codes that have PHP variables within scripts in JS. Let’s assume the file below is index.php. <?php $var = "Me mostre"; ?> <script>…
-
2
votes1
answer1123
viewsA: I cannot open modal (dialog)
First of all... You can only have one ID of a value on a page. How are you working with multiple records will not work you having one ID open the modal for all lines. You will need to use class...…
-
5
votes1
answer128
viewsA: Make query not showing some results
Use the NOT IN (). SELECT * FROM cpf WHERE cpf_id NOT IN ( '111.111.111.11' ,'222.222.222.22' ,'333.333.333.33');…
-
1
votes1
answer237
viewsA: $.getScript Jquery Javascript replacement
Using Javascript pure yes, by means of a requisition Ajax. Returns a json. var request = new XMLHttpRequest(); request.open('GET',…
javascriptanswered Diego Souza 16,524 -
2
votes2
answers412
viewsA: Reset the button text via Javascript
Before the success: function (msg) may place a: beforeSend: function(){ // Ou seja, 'antes de enviar' $('#btn_entrar').html('Carregando...'); }, success: function(msg){…
javascriptanswered Diego Souza 16,524 -
1
votes1
answer878
viewsA: Recover ajax response value
The code is commented. var userstocreate = [ { username: '' + usuario + '', password: 'E@d123456', firstname: '' + primeiro +'', lastname: '' + lastname + '', email: '' + email + '' }]; var params =…
-
1
votes3
answers5281
viewsA: take the value of a <td> by clicking on a checkbox of the same <tr> jquery line
Why don’t you put that id in the fourth TD also ? Then just do it using closest. $('.iStatusVerde').click(function() { var teste = $(this).closest('td').attr('id'); console.log(teste);…
-
4
votes2
answers42
viewsA: Files not used on the site are uploaded?
Do not load or interfere with anything on the site.