Posts by Hugo Borges • 5,294 points
332 posts
-
1
votes3
answers1895
viewsQ: Progress bar with css
Well I’m trying to build a progress bar with css, and the progress value is 13.20% The problem is that this getting a degrade effect, and I want it to change from one color to another. .notification…
-
3
votes1
answer97
viewsQ: Expression nickname with SUM is not working
I’m trying to make a SUM in a query that performs some calculations. Follow the example: SELECT SUM ( (qtd - qtd_devolucao) * valor AS total) FROM produtos WHERE id_pedido = '47' I’m having the…
-
2
votes0
answers192
viewsQ: Slowness in generating reports
Well I’m having some bottlenecks in my application and I’m not identifying the problem. I will try to explain as much as possible what happens and the configuration I use. Server settings I use a…
-
1
votes2
answers791
viewsQ: Function to summarize string in php
Well I set up the following function to summarize a string in php. function resumo($string,$chars) { if (strlen($string) > $chars) { while (substr($string, $chars, 1) <> ' ' &&…
phpasked Hugo Borges 5,294 -
1
votes1
answer199
viewsQ: How to create a custom log in php
Bom wanted a help to be able to monitor a certain error on my site. I’ll explain the operation first. 1st - I have the following select $consulta = $conexao->query("select rua from endereco where…
phpasked Hugo Borges 5,294 -
1
votes2
answers1900
viewsQ: block access to a particular directory via htacess
Well I have a folder at the root of my site called logs. Inside it I will save the logs that custom bugs that mount. Good need to lock this folder not to be accessed by anyone, just by me via ftp.…
-
0
votes3
answers346
viewsQ: Redirect file access via htacess
Good when user type some file with the .txt I have to send it to an authentication file called download.php Example, if user type www.meusite.com.br/documento.txt I have to redirect him to the…
-
2
votes1
answer812
viewsQ: Redirect page after uploading file for download
I have a page that when uploaded sends a pdf file to download. How do I after the file is sent to the browser, redirect the page? I’m sending the file so do so: // Dados do arquivo $file =…
phpasked Hugo Borges 5,294 -
3
votes2
answers431
viewsQ: Get all the ID of the elected in jQuery
Well I remove CSS from a certain element like this: $('#menu' + this.id + '').removeClass('open'); What I need to do and remove from all elements #menu less that of the informed. I tried to do so:…
-
0
votes1
answer132
viewsQ: callback in function removeClass jQuery
I’m trying to use the callback in function removeClass but it’s not working, someone knows what’s wrong? I need to execute the removeAttr only after the removeClass.…
-
2
votes3
answers406
viewsQ: Disable input sequence with jQuery
Good in the example I posted I can disable the input valor1, vendedor1 and supervisor1 by checking the option recalcular1. The problem is that I have a form with several input, and to avoid a very…
-
0
votes1
answer23
viewsQ: Apply a class to the Selected tag
Well I have a very simple menu that I put together in css, I was wondering if you have how to identify the <li> that is tagged selected and apply the effect of the Hover that is in the class…
-
4
votes1
answer339
viewsQ: Use IN or multiple OR? Which one performs better?
I have the following queries in Mysql: 1º: Using multiple devices OR SELECT SUM(qtd) FROM produtos WHERE qtd > 10 and (status = '0' or status = '4' or status = '7') 2º: Using IN SELECT SUM(qtd)…
-
0
votes3
answers3465
viewsA: Hide text when it does not fit inside the div
Well I’m answering my own question, because based on the previous answers I managed to get the result I wanted. .container { left: 0; right: 0; margin: 10px auto 10px auto; width: 95%;…
-
1
votes3
answers3465
viewsQ: Hide text when it does not fit inside the div
Well I have a div with the following class c-txt, note that when the text does not fit inside it, the text is summarized with three points (...). I need to do this with the div txt to avoid breaking…
-
2
votes2
answers4463
viewsQ: Sum in sql update
I am running the following sql on my mysql: UPDATE `cadastro` SET `pontos`= 'pontos + 1' WHERE id = 102; I need it every time it is Update in the table register the field dots who’s kind int(11)…
mysqlasked Hugo Borges 5,294 -
0
votes1
answer77
viewsQ: Scrollbar bug in select nice plugin
Well I am customizing the plugin select nice, but I’m having a bug where the page scroll bar gets huge, being that the select is closed. Coo make it appear only when select is opened? (function($) {…
-
1
votes2
answers42
viewsQ: Create a name for a variable with php
Well I’m with a question where php itself has to create the variable name, I’ve used this feature several times. The problem I am now trying to use this in an array, as follows: // Cria o nome da…
phpasked Hugo Borges 5,294 -
0
votes1
answer69
viewsQ: Query data in different arrays for reporting
Good to avoid too much processing in my Mysql when generating a report, I prefer to make a simple select and put in an array, so I have more freedom to manipulate the data. But I came across a…
-
1
votes1
answer938
viewsQ: Use setlocale for date only
Well I’m using the setlocale for php to return me the name of the month in PT-BR. The problem is affecting the system calculations. php is putting a comma on the dot link. setlocale(LC_ALL, 'pt_BR',…
phpasked Hugo Borges 5,294 -
4
votes1
answer59
viewsQ: Select with YEAR and MONTH together
Good is possible together the year and the month, and spend a party like this 20017-06 for the select? SELECT SUM(valor) FROM contas where YEAR(data) = '2017' and MONTH(data) = '06'…
mysqlasked Hugo Borges 5,294 -
1
votes1
answer2830
viewsQ: Function date returning month in en
Has some form of function date return the current month in en? Example: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
phpasked Hugo Borges 5,294 -
1
votes4
answers251
viewsQ: substr only with string greater than 4 character
Use the substr thus: $conta = "ABCDE"; echo substr($conta, -1); He returns to me ABCD, wanted to know how to execute the substr only in a string that contains more than 4 characters.…
phpasked Hugo Borges 5,294 -
1
votes2
answers1403
viewsQ: Pick value after point
Well I have the following variable. $valor = "235.33333333333333"; I need to return the value with only 2 decimal places (235.33). How can I do this? Using the explode?…
phpasked Hugo Borges 5,294 -
2
votes2
answers2323
viewsQ: Disable button after jQuery click
Well I’m having the following problem. jQuery identifies the tag data-link to recover the link and redirect the page. Soon after this the boot has to be disabled. The problem is that by clicking the…
-
3
votes1
answer147
viewsQ: Margin conflict in css
Well, I have two classes: 1 - container who receives some information 2 - top_menu who receives the menu. I can’t explain how this happens, but every time I put a div with the class container the…
-
0
votes1
answer66
viewsQ: jQuery and css menu
The icone is not aligned with the text Good follows the code of the menu, I already thank the help. $(".top_menu ul").each(function() { alignMenu(this); var robj = this; $(window).resize(function()…
-
0
votes1
answer1560
viewsQ: change select values with jQuery
Well the problem I’m having is that by clicking the button and changing the values of select, the effect is lost. A new select appears and I need to change only the results and keep the style. Does…
-
0
votes3
answers401
viewsQ: Identify a <optgroup> with jQuery
Well I set up a select with jQuery, to identify a tag <optgroup> I have to wear a data-i, example: <optgroup label='PRODUTOS' data-i="1"> Do you have any way to identify the tag…
-
2
votes3
answers2080
viewsQ: avoid Ubmit of a form with barcode reader
Well I have the following form: <form name="produto" method="post" action="cadastra.php"> <input name="cod" type='text'> <button type='submit'>FINALIZAR</button>…
-
3
votes1
answer143
viewsA: Select with LIKE and POST
Friend tries to use a filter on GET to avoid injecting. Try it this way: $nome = addslashes(filter_input(INPUT_GET, 'nome', FILTER_SANITIZE_SPECIAL_CHARS)); $row=$db->prepare("SELECT * FROM…
-
1
votes1
answer122
viewsQ: effect with jQuery in select
Good am mounting a custom input with the style of the material google design. The effect is working on the input, but in select it’s not working. Does anyone know what I’m doing wrong? Note: The…
-
2
votes2
answers51
viewsQ: how to identify disable tag with jQuery
I have a input with class form_campos, need to make the jQuery identify when the input has the tag disabled and change the class to form_disabled .form_campos { height: 31px; width: 100%; color:…
-
2
votes2
answers42
viewsQ: IN() order in mysql
Well I’m making the following select: select * from pedidos where id IN (1,3,4,2) Have any way mysql return me the result in the same order it is in IN? With the select I’m making mysql is putting…
mysqlasked Hugo Borges 5,294 -
0
votes1
answer882
viewsQ: update input with jQuery
In each table row I have an input, I need to change the input value with the row position value. How can I do this? $(document).ready(function () { $('tbody').sortable({ axis: 'y', containment:…
-
2
votes1
answer62
viewsQ: doubts with sortable jquery
I’m having doubts about using jQuery’s sortable. 1º I have to block so that the user never puts a tr on the th 2º Note that when dragging a place row the data is all stuck together, how to keep the…
-
1
votes1
answer36
viewsQ: select goes blank when giving history.back()
I set up a system where I inform the state and jQuery loads the cities. The problem is that when I run a history.back() and back to the form page select city goes blank. How do I make it not lose…
-
2
votes1
answer243
viewsQ: Shoot event or press mouse button
I’m applying an event change in id #estado, this has to happen when I click on the id #cidade. I am working, but I noticed that only occurs when I click and release the button, how do I make it…
-
1
votes3
answers3386
viewsQ: Limit of input characters
I want to assemble a jQuery that applies a limit of 255 characters within the input. My idea and do something like that: $(".loading").on('input', function () { // aqui eu tenho que fazer o bloqueio…
-
0
votes2
answers306
viewsQ: Organize a json and write the results
I have the following json: { "result":[ { “COD”:[10,3,4,11,1], "DESCRICAO”:[mouse,teclado,monitor,webcam,celular], "ESTOQUE”:[10,2,5,1,0], "QUANT_UNID":[ UN,UN,UN,UN,CX] } ] } In each json field I…
phpasked Hugo Borges 5,294 -
3
votes2
answers336
viewsQ: How to recover the value of an array
Well I have the following array inside a variable $resultado: {"result":[{"fone":"","email":"","id":1,"nome":"GERAL","token":"BE5DEA91EB28E98F053466E98082908545E3DCA5"}]} I need to retrieve the…
phpasked Hugo Borges 5,294 -
0
votes1
answer500
viewsQ: effect on input with jQuery
Well I set up a system and very precise input with android, I used CSS and jQuery. But I wanted to put an accurate effect with the Google lite material. Follow the example link:…
-
1
votes2
answers755
viewsA: Pie div effect
The best way I could find was this: .box2 { background-color: #FF895B; position: relative; height: 500px; } .box2:after { background: inherit; bottom: 0; content: ''; display: block; height: 50%;…
-
0
votes2
answers755
viewsQ: Pie div effect
Well I have a div box2-1 who has the width 100%. I want to create a div box2-2 that has the width 100%, but keep the background with two colors, to have a pie div effect. Someone can help me? Follow…
-
0
votes1
answer48
viewsQ: Changes to the error log
By default when there is an error in my PHP, my server creates a log file, with the following information: [19-Apr-2017 16:20:12 America/Fortaleza] PHP Notice: Trying to get Property of non-object…
-
1
votes2
answers642
viewsQ: apply event to an input with jQuery
Well, I need to apply the event $(".margem").keyup(); only for input containing a value greater than 0. Note that when changing the cost value the system applies the event $(".margem").keyup();…
-
0
votes1
answer1424
viewsQ: How to calculate various input with jQuery
Well I mounted a calculation system with jQuery well yes, where I inform the cost of a product. When informing the sale value the system performs the margin calculation, if I inform the margin the…
-
1
votes2
answers1366
viewsQ: How to check if a DIV has an ID
Is there any way to check if a div has an id, using jQuery? I can check if he has an ID value, so: <div id="main">...</div> if ($("#main").length){ // resto do código aqui } But what I…
-
1
votes4
answers2005
viewsQ: Line break error in <textarea>
Well I have a field in Mysql database of type march 255. I set up a textarea like this: <textarea name="obs" maxlength="255"></textarea> If I put 255 character inside it, I can save…
-
2
votes2
answers50
viewsQ: Check type with jquery
Well I have two buttons on a form, being them: <button type='reset' onclick="history.back()">CANCELAR</button> <button type='submit'>ok</button> I have the following jquery…