Posts by Diego Souza • 16,524 points
642 posts
-
0
votes4
answers2897
viewsA: Verifies which variable is with higher value returning the variable not the value
See how this function works. <?php function ShowVar($var) { foreach($GLOBALS as $varName => $value) { if ($value === $var) { return $varName; } } return false; } $valor_01 = 6; $valor_02 = 4;…
phpanswered Diego Souza 16,524 -
2
votes2
answers2558
viewsA: How to force download via remote url to any File type
You can do with HTML only, using the attribute download on the tag <a>. <a href="http://www.anistream.ga/videos/1352868579.mp4"…
phpanswered Diego Souza 16,524 -
1
votes1
answer408
viewsQ: Class Not Found in Laravel 5
I have this Controller in the Laravel 5. Homecontroller.php <?php namespace App\Http\Controllers; use View; use App\Portfolio; use App\Cliente; class HomeController extends Controller { public…
-
0
votes4
answers824
viewsA: Regular Expression to get what’s outside of brackets
See working on Regex. https://regex101.com/r/vD2kN9/1 $re = "/([A-Za-zÀ-ú0-9]+)([.,]?)/"; $str = "Itaú [123.456,89]"; preg_match_all($re, $str, $matches);…
regexanswered Diego Souza 16,524 -
0
votes1
answer80
viewsQ: Animation with Problem in Safari
A while ago I realized that in Safari animations work in a different way. For example, if we have a text inside a span and we want the hover the letters of this text diminish 1px, we put…
-
5
votes1
answer86
viewsA: PHP and Mysql session
You need to make a Inner Join to select the data from the other table taking into account the user code. SELECT LOGIN, EMAIL, SENHA, NOME, ENDEREÇO, TELEFONE FROM USERS INNER JOIN USERS_ENDERECO ON…
-
3
votes2
answers335
viewsA: How to verify that the document markup is HTML5?
Already tried to turn the object into a string ? var objSerializer = new XMLSerializer(); var doctypeName = objSerializer.serializeToString(document.doctype); console.log(doctypeName); Then you can…
-
1
votes2
answers49
viewsA: Open Direct Center Page
I decided as follows: $(document).scrollTop($(window).height() / 2); My document will open in the center of the page, making screen size divided by 2. Finally, mosquei.…
-
1
votes2
answers49
viewsQ: Open Direct Center Page
It is possible when opening the page to direct click in the center of it without anchor and also without scroll ? Everything I research relates to window.open(). I haven’t found anything specific…
-
0
votes0
answers192
viewsQ: CSS Animation Is Repeating
I have a img on my page applying an animation when opening the page. Attr &.fundo-menu{ position: absolute; left: 0; right: 0; top: -500px; opacity: 0; margin: auto; width: 312px;…
-
5
votes2
answers1905
viewsQ: How do I get the browser user’s language?
I have a website in 3 languages, EN, EN and ES. But on some distinct machines when accessing the site by the browser is directing to page on English. This happens because of the code below which I…
-
1
votes4
answers9200
viewsA: Query using like operator
If I understand what you need, try this query. SELECT * FROM despesas WHERE palavraChave LIKE '%escola%' AND Month(Data) = 8 AND Year(Data) = 2015 I’ve never seen it do LIKE in date field unless…
sqlanswered Diego Souza 16,524 -
5
votes1
answer52
viewsA: How to show a thumbnail of a circular wodpress post?
Through CSS. If you are allowed to use the file, change the class imgwrap that surrounds the image. Put a: .imgwrap{ border-radius: 50%; }…
-
2
votes1
answer93
viewsA: How to extract numbers by preserving their formatting of a PHP string?
$re = "/([0-9\\/])/"; $str = "Paga. ref. a nota fiscal número 8888, com o cheque número 9999 em 14/08/2015"; preg_match_all($re, $str, $matches); Check in the Regex. https://regex101.com/r/tV7eY9/1…
phpanswered Diego Souza 16,524 -
0
votes3
answers3464
viewsA: Average between 3 direct dates in sqlserver bank?
See if with the AVG (Average - Medium) works. SELECT TOP 3 CONVERT(DATETIME, AVG(CONVERT(FLOAT, data))) as [MediaData] FROM dbo.tab_venda ven INNER JOIN dbo.tab_item_venda iven ON iven.num_venda =…
sql-server sql-server-2012 sql-server-2008 sql-server-2014 sql-server-2005answered Diego Souza 16,524 -
0
votes1
answer24
viewsA: Fadein as the browser descends
Try that logic. $('.j_show').each(function(){ var fade = $(this).offset().top; var topOfWindow = $(window).scrollTop(); if (fade < topOfWindow + 650) { $(this).delay(1000).fadeIn(2000); } });…
-
1
votes1
answer79
viewsA: Cluster difficulty and Where clause in Mysql
SELECT * FROM exa_exameresultado WHERE exr_exa_id IN (18,19,20,71) AND exr_pac_id = 2128 GROUP BY exr_exa_id ORDER BY exr_data DESC, exr_exa_id ASC LIMIT 4 The only change I made was putting one…
-
2
votes1
answer357
viewsQ: Doubt Laravel 5 - Libraries and Functions
<?php namespace App\Http\Controllers; use App\Http\Requests; use App\Http\Controllers\Controller; use App\ListaProduto; use App\Produto; use Input; use Illuminate\Support\Facades\Request; use…
-
4
votes1
answer2502
viewsA: How to use Laravel Excel Library
I managed to solve. In my case I need to put header in the file .csv with the name of the columns. In this case they were Code and Product. Then I read the documentation to implement in the code and…
-
1
votes5
answers3537
viewsA: Make div disappear
If you’re using jQuery. $('#sua-div').css('visibility', 'hidden'); If you’re using Javascript. document.getElementById('sua-div').style.visibility = 'hidden';…
-
2
votes1
answer148
viewsA: value of select in array
With while. $sql = mysql_query("select A, B, C, D from table"); while($res = mysql_fetch_assoc($sql)){ $arrData[] = $res['A']; } echo '<pre>'; print_r($arrData); echo '</pre>'…
-
2
votes1
answer207
viewsA: Treat JSON for Facebook API query
Use the function json_decode($var). When receiving the data just make a foreach to print them out. See a question related to your and Sérgio’s fourth answer. /a/4413/23919…
-
2
votes1
answer2502
viewsQ: How to use Laravel Excel Library
I have a .csv where I need to import your data into the database. I am using an Laravel library to import it. What is this one: https://github.com/Maatwebsite/Laravel-Excel In the code I’m doing…
-
2
votes3
answers96
viewsA: Doubt how to use a Less class with RAZOR
Look at it this way. Creates a class that calls its function with the param value. .tamanhoColuna(@x){ min-width: @x; } .chamaFuncao { .tamanhoColuna(10px); } <p class="chamaFuncao"> Teste :D…
-
1
votes5
answers1015
viewsA: Line with image in the middle
With only one hr You won’t be able to do that. Other elements must be used. Look at this example I did: #linha { height: 400px; position: relative; width: 50%; margin: auto; top: 100px; } hr {…
-
0
votes1
answer181
viewsA: Align Divs Correctly
Bro, I gave a CTRL C CTRL V on the fields. But you will understand the schemes: HTML <div class="control-group"> <div class="controls" style="float:left; margin-left: 5px;"> <div…
-
1
votes2
answers2457
viewsA: Loading page with Jquery
Put a .hide() is the same as you do display:none. And display does not work in animations. Put in your class CSS a property: visibility:hidden It does the same function as display, but does not…
-
0
votes3
answers2116
viewsA: How to get the index of the button clicked?
jQuery $('.btn').on('click', function(){ alert(($this).val()); }); Use the this for this. In the click function you have to put the selector as the button class, since there will be several. In your…
-
0
votes1
answer96
viewsA: Animation and Transition in CSS Together Don’t Work
I discovered the problem. The transition does not work when I determine a value auto on the property. In my case I had a width: auto. I switched to the real value of the image and the transition…
-
1
votes1
answer96
viewsQ: Animation and Transition in CSS Together Don’t Work
I am writing the code below and is not working the part of transition. The class .menu-fixed i apply it via javascript. The animation when you open the site. The animation works, but when I apply…
-
2
votes1
answer376
viewsA: Load page via load with problem
Yes. When you put $('.carrega').val() in the parameter it will take the first element that contains this class. In your case it will always be blue. Place $(this).val(), that it will catch what you…
-
-1
votes3
answers70
viewsA: Strange behavior when displaying an attribute using click();
Use the attribute .data() jQuery. It is the most suitable to work with data-attr in HTML. $(function(){ $('.hidden').on('click', function(){ console.log($(this).data('s')); alert($(this).data('s'));…
jqueryanswered Diego Souza 16,524 -
2
votes1
answer891
viewsA: Make a select in a varchar column as if it were SQL datetime
If it is SQL you can use the function convert. https://msdn.microsoft.com/pt-br/library/ms187928(v=SQL.120). aspx SQL SELECT data FROM lista WHERE data BETWEEN convert(datetime,'01/08/2015', 103)…
-
2
votes1
answer118
viewsQ: Mobile Page in Chrome Simulator
The sites I am developing have presented some problems. I believe it is because of my inexperience in mobile pages - responsive. I make my websites in Mobile First. And to test the site I use the…
-
2
votes0
answers375
viewsQ: How do bar get responsive?
I’m trying to make this HTML5 video player icons responsive. <div id="video-controls"> <div class="play-video"> {!! Html::image('img/video/play.png', 'Play / Pause Video', ['class' =>…
-
1
votes2
answers452
viewsA: How to get the sum of three tables in sql
Try that consult you’re doing. But so... you can improve the structure of your tables. The table school does not need two primary keys unless required. On the table students does not need the column…
-
1
votes2
answers1751
viewsA: How to center a slide?
I didn’t put it on an interface to test. But the logic is that the div father of all must have margin:auto, making her stand in the middle of the screen. Inside is two div's who are with…
-
-1
votes2
answers211
viewsA: Block text in textbox
If you use the readonly in the input text will not allow editing, read only as the attribute itself says. <input type="text" readonly name="texto">…
javascriptanswered Diego Souza 16,524 -
1
votes2
answers211
viewsA: PHP - Bring the result of a table according to the most recent message from another table?
Pedro, try this query below. However, I don’t know what you need. I needed to create a temporary bank to test better. If you want to use the Sqlfiddle to create a temporary bank and give us the LINK…
-
0
votes1
answer49
viewsA: Facebook API - Secure Canvas URL
I managed to resolve that issue. Facebook in this field accepts only the protocol HTTPS. That is, if we want to put some page of the site in a TAB (Tab) on Facebook we need to hire the hosting SSL…
facebook-apianswered Diego Souza 16,524 -
2
votes1
answer239
viewsA: Catch Cover Facebook API SDK JS
I got it. I put cover (cover) in the Parameter. But there is no Doc. Or I read it wrong. FB.api('/'+idUser+'/?fields=cover', function(resp){ console.log(resp); return false; });…
-
1
votes1
answer209
viewsA: Click on page area and close MENU
I got. // Clicar em alguma área do site e fechar MENU $('body').on('tap click', function(e){ if(e.target !== $('nav.menu')[0] && $(e.target).closest('nav.menu').attr('class') != 'menu…
jqueryanswered Diego Souza 16,524 -
1
votes1
answer209
viewsQ: Click on page area and close MENU
I’m trying to make this script that closes the MENU when I click on any area of main. The MENU opens the left of the mobile page. But as you can see MENU is out of the main. So I couldn’t make that…
jqueryasked Diego Souza 16,524 -
0
votes0
answers271
viewsQ: Play function does not work in iOS browser
These functions below are from the Youtube API for viewing videos. It’s working on all browsers. But when I open the site on iPhone and click on PLAY to start the video, it doesn’t perform the…
-
0
votes4
answers6129
viewsA: Grab <a> tag link with javascript. For active menu script
If you are using a server side language... PHP, for example, can be used like this. # http://localhost/meusite/pagina.php $Url = $_SERVER['SCRIPT_NAME']; # pagina.php ?> <ul> <li…
-
2
votes3
answers5503
viewsQ: Disable Function . click on DIV
I am making a game and need a routine that disables the click at least until the function finishes. The function is this below. When I click on the element and run this function with touchstart and…
-
3
votes1
answer80
viewsQ: Verification of Browser Versions
I am making a website and would like to put a browser check that the user is using. I don’t want the site to be used in IE 6, 7 and 8. In addition to some versions of old Firefox that you have in…
cross-browserasked Diego Souza 16,524 -
0
votes0
answers49
viewsQ: Print Popup Interfering with Main Document
I am using a plugin to make certain page print. Is the jQueryPrintElement.js. http://projects.erikzaadi.com/jQueryPlugins/jQuery.printElement/ When I click the print button, it opens the popup (from…
-
2
votes1
answer57
viewsQ: Pseudo Class in CSS Does Not Apply Rule
I’m making a CSS to control the printing of a page. The only thing I’m going to show in print is an image that’s on the page. So in CSS I did like this: *:not(#imagem-draw){ display: none; } But the…
cssasked Diego Souza 16,524 -
1
votes1
answer316
viewsA: I cannot redirect to a new tab within the same url
Take a look at this Jsfiddle. https://jsfiddle.net/o47v8La9/ I made a flap system that you can understand. HTML <div id="tabs"> <span class="tab" id="#php"> PHP </span> <span…
phpanswered Diego Souza 16,524