Posts by Rodrigo Zem • 895 points
57 posts
-
0
votes1
answer23
viewsA: How to search records until the previous month?
... where DATEPART(m, _DATA_ ) = DATEPART(m, DATEADD(m, -1, getdate())) Extract the month of the date DATEPART(m, DATE ) and compares by decreasing one month from the current date DATEPART(m,…
-
2
votes3
answers389
viewsA: How to get the date of the first and last days of the current week with Javascript?
var data = new Date('2020-12-25T00:00:00'); // O primeiro dia é o dia do mês, menos o dia da semana var primeiro = data.getDate() - data.getDay(); …
-
-2
votes1
answer97
viewsA: Does anyone know how to translate the "copy" and "print" buttons of Datatables?
$(document).ready(function() { $('#example').DataTable( { dom: 'Bfrtip', "buttons": [ { "extend": "copyHtml5", "text": "COPIAR" }, …
answered Rodrigo Zem 895 -
2
votes1
answer46
viewsA: Save several values in the field of the mysql table
The best way would be to have three tables (consultation, veterinary and veterinary consultation ). The veterinary table_query would be n to n keeping the codes of consultation and veterinary N to N…
mysqlanswered Rodrigo Zem 895 -
0
votes3
answers98
viewsA: Declaring PHP variables from the keys of an array
http://php.net/manual/en/function.extract.php <?php $arr = array('primeiro' => '1', 'segundo' => '2', 'terceiro' => '3'); extract($arr); echo $primeiro; /* Imprimirá -> 1 */…
phpanswered Rodrigo Zem 895 -
1
votes1
answer149
viewsA: How to adjust the width of the jquery datatable to larger resolution screens
https://datatables.net/reference/api/columns.adjust() Ex: var table = $('#example').DataTable( ... ); setTimeout(function(){ table.columns.adjust().draw(); },2000)…
-
0
votes2
answers57
viewsA: How to create a checkbox that cannot be changed (readonly)
Through Javascript document.querySelectorAll('input[type="checkbox"]').forEach( node => node.onclick = function() { return false; } ) <input type="checkbox" name="chk1" id="chk"> <input…
-
0
votes2
answers116
viewsA: How do I show a <select> when selecting a <option> in the form?
Using Jquery var options = $("#d2").html(); $("#d1").change(function(e) { var selectedValue = $("#d1 :selected").val(); $("#d2").html(options); $('#d2 :not([value="'+selectedValue+'"])').remove();…
-
-1
votes1
answer41
viewsA: Pick up input values
var players = document.querySelectorAll('.inputPlayers'); var comecar = document.querySelector('.comecar'); comecar.addEventListener('click', function() { var a =…
javascriptanswered Rodrigo Zem 895 -
0
votes2
answers58
viewsA: SQL - Use Where value in another Where
If the database is ORACLE can use DEFINES https://docs.oracle.com/cd/E18283_01/server.112/e16604/ch_twelve017.htm Tool I use to manage DB http://www.sqltools.net/ Example: use v_cod where you need…
sqlanswered Rodrigo Zem 895 -
1
votes1
answer49
viewsA: Why doesn’t my modal show up?
Documentation on modal: https://getbootstrap.com/docs/4.5/components/modal/ Missing button to call the modal <button type="button" class="btn btn-primary" data-toggle="modal"…
-
0
votes2
answers52
viewsA: Arrow through the css
.arrow { background: #000; height: 1px; width: 180px; margin: 0 auto; position: relative; cursor: pointer;} .arrow:before, .arrow:after { content: ""; background: #000;…
-
3
votes2
answers44
viewsA: How to take the value typed in an input and then add it to a Javascript URL?
const solr = "http://localhost:8983/solr/csv_indexing"; document.getElementById('btn-buscar').onclick = function() { let q =…
-
0
votes1
answer19
viewsA: Change image link dynamically within <img src>
<?php include("classe/conecta.php"); $codigo = $_GET['codigo']; $consulta = "SELECT * FROM CadPessoas WHERE Cod='$codigo'"; $con =…
phpanswered Rodrigo Zem 895 -
0
votes2
answers85
viewsA: Select to create balance based on previous month’s value
You can use a Mysql variable Example in SQLFIDDLE: http://sqlfiddle.com/#! 9/5ed061/4 CREATE TABLE `operacoes` ( `id` bigint(20) NOT NULL PRIMARY KEY AUTO_INCREMENT, `mes` date NOT NULL, `valor`…
-
0
votes1
answer40
viewsA: Send variable with Jquery Autocomplete function
$("#nome").autocomplete({ source: "produtos.php?idusuario="+idusuario, minLength: 2, select: function (event, ui) { $('#idproduto' +…
-
2
votes2
answers93
viewsA: How do I get as much and as little as possible of a consult?
SELECT max(atraso) Min, min(atraso) Max from ( select DATEDIFF("D",DtVencimento,DtBaixa) as atraso from Entrada where Id='1' and DtEmissao >='01/01/2020' …
-
2
votes1
answer52
viewsA: Increment an array with PHP foreach
The total_quant_unit variable must be outside the foreach $total_quant_unidade = array(); foreach ($xml->NFe->infNFe->det as $itens){ $quantidade = round($itens->prod->qCom);…
-
0
votes1
answer99
viewsA: Seller javascript commission calculation
function calcular() { var comissao = (parseFloat($("#valorPorcentagem").val()) / 100) * parseFloat($("#valor_vendedor").val()); $("#comissao").val(comissao); …
-
2
votes2
answers44
viewsA: PHP repeating commands
You can use the plugin jQuery Loadingoverlay https://gasparesganga.com/labs/jquery-loading-overlay/ $('#btnsalvar').click(function(){ dados=$('#frmver').serialize(); caminho =…
-
1
votes1
answer65
viewsA: Creating a quiz game, how do I avoid code duplication in javascript?
let pos = 0, test, test_status, question, choice, choices, chA, chB, chC, chD, chE, chF, chG, chH, chI, correct = 0, wrong = 0; let questions = [ { …
javascriptanswered Rodrigo Zem 895 -
1
votes2
answers38
viewsA: Find an input value within an AJAX loop
$(function(){ $(".adicionar_carrinho").on('click', function(e){ e.preventDefault(); let i = $('.adicionar_carrinho').index(this); …
-
2
votes1
answer29
viewsA: Using case to match fields
https://firebirdsql.org/refdocs/langrefupd15-coalesce.html SELECT CP.DT_VENC, CP.VLR_CONTA, COALESCE(DT_QUIT, DT_VENC) AS DT_QUITACAO, CP.VLR_QUITACAO FROM CONTAS_PAGAR CP…
-
0
votes1
answer36
viewsA: Error in image transition effect
I added a $ in the fourth row. I was ('body') and now $('body') I also added the Jquery open command on the first and close on the last line. $(function(){ $(window).scroll(function(){ var $window =…
-
-1
votes2
answers39
viewsA: how to place the local date on the web page
Reference: https://www.w3schools.com/jsref/jsref_tolocaledatestring.asp var a = setInterval(myTimer); function myTimer() { var d = new Date(); var time = d.toLocaleTimeString(); var data =…
-
0
votes3
answers202
viewsA: Ways to take only the month of the dates recorded in the database
Use the date_format function https://www.w3schools.com/sql/func_mysql_date_format.asp select date_format(now(),'%m')…
-
0
votes1
answer43
viewsA: Problem with SQL return
select cli.nome, group_concat(solicitacoes_descricao_id) solicitacao_descricao from clientes cli, solicitacao_descricao sd, solitacoes sol where cli.id = sol.cliente_id and…
-
0
votes1
answer171
viewsA: Error: FROM keyword not found where expected
select e.num_exame as exame, a.num_amostra as amostra, e.data_hora_exame as dh_exame, a.tipo_amostra as tipo_amostra from exame e inner join amostra a on e.num_exame =…
-
1
votes1
answer186
viewsA: Sum PL SQL Lines
The RATIO_TO_REPORT function is native to Oracle, and aims to show the proportion of a given quantity in Relation to Total. SELECT NOME_SETOR, ROUND( ( (RATIO_TO_REPORT(QTDE) OVER())*100 ) ,2 ) FROM…
-
1
votes1
answer61
viewsA: database issue
The HAVING clause is used to specify filtering conditions in groups of records or aggregations. It is often used in conjunction with the GROUP BY clause to filter the grouped columns. SELECT…
mysqlanswered Rodrigo Zem 895 -
0
votes2
answers110
viewsA: Change page background as user chooses color
I added a Return false; after the onclick of the input function trocarcor() { //Seleciona o elemento do seletor de cores, pega o seu valor e registra em uma variável. let Cor =…
-
0
votes1
answer20
viewsA: Subtract a day on all dates within 5 months
USE THE DATE(expr FUNCTION) UPDATE floattablediario SET DateAndTime = DATE_SUB(DateAndTime, INTERVAL 1 DAY) WHERE DATE(DateAndTime) between '2020/01/01' AND '2020/05/26' AND TagIndex = 0…
mysqlanswered Rodrigo Zem 895 -
0
votes7
answers16899
viewsA: How to create a <select> with images in the options?
You can use the kendoui Combobox plugin https://demos.telerik.com/kendo-ui/combobox/template $(document).ready(function() { $("#customers").kendoComboBox({ filter:"startswith", dataTextField:…
-
0
votes2
answers91
viewsA: Query Mysql Time Range
You can use: SELECT * FROM docs WHERE data BETWEEN date(now())-20 AND data The select above returns amid the current date less 20 days and the current date. http://sqlfiddle.com/#! 9/6a03df/4/0…
mysqlanswered Rodrigo Zem 895 -
0
votes1
answer54
viewsQ: Problem comparing boleano value from javascript
I have a function validaSenha that I’m using that checks the amount of characters and returns true or false. In the action of the end button I execute a call in the function inside a if, but even…
-
0
votes1
answer58
viewsA: Merge 2 MYSQL query into same table
UNION combines the execution result of the two queries. $result = "SELECT DATE_FORMAT(data,'%m/%Y') as data, COUNT(quantidade) as qnt, SUM(quantidade) as soma FROM usuarios GROUP BY MONTH(data),…
mysqlanswered Rodrigo Zem 895 -
1
votes1
answer47
viewsA: Display of personal data in a table
Create another function to grab the user by ID. public function by_id($id_user){ $sql = $this->con->prepare("SELECT * FROM usuario WHERE id = ".$id_user); $sql->execute(); $row =…
phpanswered Rodrigo Zem 895 -
1
votes3
answers1081
viewsA: How to put a <p> on the same line as <hr>
hr{ margin-top:-25px; margin-left:213px; border-top: 1px solid red; } <p>Colocar a tag <b>hr</b> em frente do…
-
0
votes2
answers37
viewsA: Problem with using Else
if ($result = mysqli_query($conn, $comando)) { while ($row = mysqli_fetch_assoc($result)){ ?> <tr> <th scope="row"><?= $row['order_id'] ?></th> …
-
0
votes1
answer156
viewsA: How to catch click action in Year Calendar
It was missing to add the modal and the forms with the fields function editEvent(event) { $('#event-modal input[name="event-index"]').val(event ? event.id : ''); $('#event-modal…
-
2
votes1
answer66
viewsA: Ignore unfilled Mysql PHP fields
$(function(){ $('#propriedade').change(function(){ if( $(this).val() ) { $('#variedade').hide(); $('.carregando_variedades').show(); …
-
1
votes3
answers131
viewsA: Problem when trying to add elements ckeditor
I had the same problem also with the ckeditor opening in the modal using Bootstrap 4. I just found solution to solve for boostrap 3. After much research I found the solution. Goes below:…
-
1
votes1
answer31
viewsA: Return data within a period of time
If we are in month 12, will search between 26/10 and 25/11, as it will get the first date decreasing 2 months from the current and the second date 1 month from the current. SELECT…
mysqlanswered Rodrigo Zem 895 -
0
votes3
answers94
viewsA: HTML validating with javascript
Follow code using Jquery $(function(){ $("#checkresposta").on('click', function(){ var total = 0; if ( $("[name='questao1']:checked").val() == 'a' ) total += 1; if (…
-
0
votes1
answer278
viewsA: Filter of the month and year of a date via combobox
<?php $sql = "SELECT tb_processo.codigo_processo, tb_processo.numero_processo, tb_processo.data_processo, tb_processo.assunto FROM tb_processo WHERE 1 =…
-
0
votes2
answers1897
viewsA: How to get the last record of a table in Oracle
select distinct a.vl_recebido, b.vl_lancamento, b.nr_sequencia, a.dt_recebimento, a.dt_recebimento, b.nr_seq_baixa FROM TITULO_RECEBER_LIQ a JOIN pls_titulo_rec_liq_mens b on (a.nr_titulo =…
oracleanswered Rodrigo Zem 895 -
0
votes2
answers85
viewsA: html page does not interpret css class inserted on button at runtime
$(document).on('click','.addAssunto',function() { var tr = '<tr><td><input type="text" class="form-control no-border" name="AssuntosTopicos" id="assuntosTopicos" value=""…
-
1
votes2
answers432
viewsA: Select from multiple tables with the same ID in Mysql
select ( SELECT campo_desejado FROM `ax_det` a where a.`aw_token` = '834545') a, ( SELECT campo_desejado FROM `ax_det1` ar where ar.`ar_token` = '834545') ar, ( SELECT campo_desejado FROM `ax_det2`…
-
0
votes2
answers329
viewsA: Mask to only allow letters and letters to be inserted with accents
You can use this imaskjs plugin var regExpMask = IMask( document.getElementById('regexp-mask'), { mask: /^[a-zöüóőúéáàűíÖÜÓŐÚÉÁÀŰÍçÇ]{0,100}$/ }); <script…
-
0
votes4
answers3090
viewsA: Regex for Cifras site as Cifraclub
<?php /* A variável Cifra guarda a letra da música cifrada*/ $cifra = "E7 Amaj7 Antes de eu falar A9 Tu cantavas sobre mim C#m B4 Tu tens sido tão A9 Tão bom pra mim C#m B4 Antes de eu respirar…