Posts by Alvaro Alves • 1,065 points
61 posts
-
-1
votes1
answer50
viewsQ: Upgrade from Laravel 5.7 to 5.8
Good morning dear friends, I am making the migration of my personal project from Laravel 5.7 to 5.8, but there is a part in the documentation that I didn’t understand very well, it may be a silly…
laravelasked Alvaro Alves 1,065 -
1
votes1
answer175
viewsQ: Concept of delegate in Flutter
I saw that there is no support for delegate in flutter, is there any way to implement something like that? I believe that a callback work, I tried to formulate some examples but I’m not able to…
-
2
votes2
answers67
viewsA: Unifying values of an array
Do the following: $res = call_user_func_array('array_merge',$arrayExcluir);
phpanswered Alvaro Alves 1,065 -
0
votes1
answer44
viewsA: Make Div content appear only when I click a button
So I believe you’ll get what you need function Conteudo(el){ var display = document.getElementById(el).style.display; if(display == "none") document.getElementById(el).style.display = 'block'; else…
-
4
votes1
answer289
viewsQ: Chr$ equivalent function in C#
I’m migrating a chunk of code in Visual Basic 6 and came across the following call: variavel = Chr$(27) & Chr(15) 1 - What would be the equivalent functions in C#? 2 - What is the difference…
-
0
votes2
answers23
viewsA: Can I create a model responsible for more than one table in Laravel?
First it is worth mentioning that each model is responsible for a table in Laravel. There are ways you can do this but with different tools, you can see here in this link from S.O itself(In…
-
1
votes1
answer193
viewsA: AJAX. How to pick up with PHP the data sent by "username" and "password" when set in ajax?
let’s "refactor" your code: var strObjeto = JSON.stringify({ username: $('#username').val(), password: $('#password').val(), }); function salvaRegistroAdicional(){ $.ajax({ type: "POST", url:…
-
0
votes1
answer296
viewsQ: Select all textbox text
I have the following code: Private Sub nct_focus(sender As Object, e As EventArgs) Handles nCT.GotFocus, nCT.Click sender.SelectAll() End Sub what happens is this, it works well, however I have some…
vb.netasked Alvaro Alves 1,065 -
0
votes4
answers487
viewsA: IF condition according to option field selection
You can do it like this: function teste(a) { var micro = (a.value || a.options[a.selectedIndex].value); var tipo1 = 0; if (micro == "Micro Inversores"){ tipo1 = 1; }else if(micro == "Inversor…
-
3
votes0
answers45
viewsQ: Behavior of Math.Round
I have a project in VB.Net that I use the Round Function, but see the strange behavior: System.Console.WriteLine(math.round(32.625,2)) '32.62 System.Console.WriteLine(math.round(32.635,2)) '32.64…
-
0
votes1
answer30
viewsQ: Is there any way to use self Execute functions in vb6?
In javascript we can write this in several ways: (function () { console.log("Olá"); })(); (function () { console.log("Olá"); }()); ! function () { console.log("Olá"); }(); void function () {…
-
1
votes1
answer83
viewsA: Something wrong with if in Laravel controller
just you change your if: of if($pageCount->folhasnew > 0){ $printerChange->folhasnew = $request->folhas - $oldsheet; }else{ $printerChange->folhasnew = $request->folhas; } for…
-
2
votes1
answer38
viewsA: Doubts in the PHP float function
First, by answering your question: Floating point numbers (also known as "floats", "doubles" or "real numbers") can be specified using any of the following syntaxes:: <?php $a = 1.234; $b =…
-
2
votes2
answers558
viewsQ: Hover effect on child element with CSS
I have the following code, which is the menu of my application: <div class="mainmenu-area" data-spy="affix" data-offset-top="100"> <div class="container"> <!--Logo--> <div…
-
1
votes1
answer1411
viewsA: High 5.6 - global and dynamic variable
You can do using view Composer. The Composer view runs when the view is loaded, this way you can pass in a Closure with additional features for a particular view. To determine a Composer for all…
-
1
votes1
answer67
viewsA: Count characters from an input without spaces between words
Give a replace in the spaces: $quantidade_car = strlen(trim(str_replace(" ","",$nome))); function str_replace php Edit: counting values per word $nome = $_POST['nome']; $data = $_POST['data'];…
phpanswered Alvaro Alves 1,065 -
1
votes0
answers30
viewsQ: Return 302 status in form Submit
I did the migration of my project Aravel 5.4 pro 5.6, but in a new form I am having the return 302 when giving the Submit in the form, it is a normal form like the many others in my system, however…
laravel-5.6asked Alvaro Alves 1,065 -
1
votes2
answers413
viewsA: Get text from a select inside a javascript foreach
You can do it like this: '<td>'+ '<select name="idcentrocusto[]" onchange="getSelect(this);">'+ '<option value="">Selecione Centro Custos...</option>'+ '<?php foreach…
javascriptanswered Alvaro Alves 1,065 -
2
votes2
answers826
viewsQ: How to make a div appear by following the cursor?
Good afternoon, you guys. My question is the following, I am creating a payment form, I have the following code: $(".spanhover").hover(function(event) { var divid = "#popup1" $(divid).css({top:…
-
0
votes1
answer121
viewsA: Determine route according to the url that called the request
I solved it in a very simple way: I took responsibility for rerouting the routes and I played this on my controller, in short my middleware was like this: Validity.php <?php namespace…
-
0
votes1
answer121
viewsQ: Determine route according to the url that called the request
My situation is as follows, I am using a form of charging that makes the entire online subscription system, the system when performing the registration of a customer and validate the payment of the…
-
0
votes1
answer26
viewsA: Danfe procedure error! [-2146233036] The type initializer for '<Module>' threw an Exception
The problem found here was that the . NET installed on my client’s machine, it was version 4.7 installed on an updated SP1 windows 7, I downloaded the version to 4.6 and it worked perfectly, but…
vb.netanswered Alvaro Alves 1,065 -
0
votes2
answers851
viewsA: Sharing variables between functions in the controller
Look, you can set global variables in your controller: class TestController extends Controller { private $arrayLogradourosA; private $arrayLogradourosB; public function funcao1($cidade, $cidade2) {…
-
2
votes1
answer345
viewsA: How to return relegated records between Laravel tables
Let’s go to the trivial: turn the following commands: php artisan make:model Estado -crm php artisan make:model Cidade -crm This way you will make the model, Migration and the controller in just one…
-
1
votes1
answer170
viewsA: Select <TD> javascript
Well, come on: let’s go in pieces... When entering the order number and giving a 'TAB' for this point you can use the event onBlur, after creating its function. the system gives a select in the…
-
0
votes1
answer224
viewsA: Help in Javascript contact list program
Below is an example I took from here, will not work here for security reasons because it is a sandbox, but if you put in a local file will work perfectly. Take a look at the code, I know the example…
-
0
votes1
answer210
viewsA: How to use "break" in Blade template?
I put as an answer because it would not fit in the comment: from what I understand, if you don’t have the id it has to break, you do so: @foreach($arrayItens as $item) <tr> <td><input…
-
3
votes1
answer163
viewsA: Transform 2 php array into a single array
Good afternoon, let’s start: first you can use the Array_merge to join the 2 arrays, taking the example you gave you have the 2 arrays: $val = [ "0" => "2", "1" => "4", "2" => "6", "3"…
-
0
votes1
answer26
viewsQ: Danfe procedure error! [-2146233036] The type initializer for '<Module>' threw an Exception
Good afternoon guys, I have a system that performs the impression of Danfes in vb.net, but in a specific client he is making the following mistake: Danfe procedure error! [-2146233036] The type…
vb.netasked Alvaro Alves 1,065 -
-1
votes2
answers89
viewsQ: Closure and Magical Methods
Talk guys, it’s okay? I am developing a note sending system, but as we learn something new every day I came across the following doubt: I have a closure that treats some settings before calling the…
phpasked Alvaro Alves 1,065 -
1
votes1
answer41
viewsQ: Optimization of php code (NF key generation)
Dear colleagues, currently I am working on a project that carries out the sending of tax coupons, in it I arrived at a function that generates the key of the nfe, in it I receive the following data:…
-
2
votes2
answers482
viewsA: Calculation of interest and fines in PHP
Validate if the due date is less than the current date: $databx = new DateTime(); $datavc = new DateTime($bxgst->getDatavencto()); //2018-10-30 $diasatraso =…
-
0
votes1
answer212
viewsA: How to put an if inside the Javascript append
Good morning friend: try the following: var imgTeste = data.dados[i].img ? data.dados[i].img : "caminho/imagem.jpg"; $("#cardAnuncios").append('<div class="anunciosJson">' +'<a…
-
0
votes1
answer40
viewsA: How do I change a data table line when selecting it?
I don’t know the structure of your chart, but it must be something like this you’re looking for: $(document).ready(function () { var oTable = $('#tableproduct'); $('#tableproduct tbody').on('click',…
-
0
votes3
answers149
viewsA: How to open a message screen in all the views the user logs in? + Laravel
Including sub-views The directive @include Blade allows you to include a view of Blade inside another view. All variables that are available for viewing in Parent will be made available for viewing.…
-
4
votes1
answer64
viewsA: Difference between property declaration in C#
NO C# 3.0 has been implemented the self implemented properties this gives us the power to declare the properties of a class of no additional logic in the assessors (get and set) of the properties.…
-
1
votes2
answers1015
viewsA: Why margin-top affects the father div
You can do it like this: body{ background-color: #aaaaaa; } .topo{ width: 100%; height: 200px; display: flex; background-color: #000; } .topo_caixa{ margin: auto; text-align:center;…
-
0
votes2
answers2604
viewsA: How to Trade Icon Bookmark Google Maps API V3
Friend, I changed the location icon on the page of the company where I work, you can see working here, Just click on "we’re here," good.. without further delay we’ll go to the code: <script>…
javascriptanswered Alvaro Alves 1,065 -
0
votes2
answers457
viewsA: How to take out the white space in this html
I put your same code in a snippet and removed the margin, at first it is without the space above which you mentioned. body, .body { font-family: Roboto; /*padding: 10px;*/ text-align: justify;…
-
2
votes2
answers233
viewsA: Web Service may be active, or only passive (always receive a request)
Apparently by the description of your doubt this is done with a webhook; What Are Webhooks? Every time an event happens in your application, it is responsible for how this information is received in…
web-serviceanswered Alvaro Alves 1,065 -
0
votes1
answer219
viewsA: Open a minimized browser in Windows Forms
This is a very specific problem. Since you can pass some arguments to the application, it is only the product developer who decides what is possible or not to be done with these arguments. It is…
-
1
votes2
answers562
viewsA: How to catch a Parent element from a child with id?
you can do the following: x = document.getElementsByClassName("minhaClasse"); this will return all the elements that have this class, then you just iterate and perform the process you want: for (var…
-
3
votes3
answers645
viewsA: With CSS to cut text? Type a cut text effect or broken font?
I believe this is what you need: html, body { height: 100%; overflow: hidden; } body { -webkit-transform: rotate(-5deg); -moz-transform: rotate(-5deg); -o-transform: rotate(-5deg); -ms-transform:…
-
1
votes1
answer44
viewsA: Difficulty Positioning Background Image
Try the following: .jumbo{ background-image: url(../Images/metaVendedores.png"); background-repeat: no-repeat; <--não repete a imagem background-position: 0% 0%; <-- Posição da imagem…
htmlanswered Alvaro Alves 1,065 -
1
votes1
answer31
viewsA: How to create a functional post history?
Try using the insertBefore Syntax var elementoInserido = elementoPai.insertBefore(novoElemento, elementoDeReferencia); If elementDeference for null, new element will be inserted at the end of child…
-
1
votes1
answer144
viewsA: Search with date in Laravel
Try to use Binding: DB:RAW('SELECT SUM(N.primeiro_turno + N.segundo_turno + N.terceiro_turno) ,SUB.* FROM notes N, (SELECT SUM(NS.total_dia) AS TOTAL_DIA ,NS.sequencing_id FROM notes NS WHERE…
-
4
votes1
answer129
viewsA: preg_match returning 0
Explaining the preg_match: The function preg_match() accepts 5 parameters, the first two being mandatory. The first parameter is the regular expression ($Pattern). The second parameter is the string…
-
1
votes1
answer181
viewsA: Check if websites are working, php
Try the following function function get_http_response_code($domain1) { $headers = get_headers($domain1); return substr($headers[0], 9, 3); } function url_existe($domain1){ $get_http_response_code =…
-
0
votes1
answer71
viewsA: Doubt to count records in a Mysql database query
I found a solution to your problem: I made a test database to which I added the records and made a test, below follows what you need: SELECT curso1, CASE WHEN COALESCE(curso1, '"')='"' THEN 0 ELSE…
-
0
votes2
answers52
viewsA: Check if file exists at runtime
You can use file_exists: $filename = '/caminho/para/arquivo.txt'; $teste = file_exists($filename) And exit function using break if (!$teste) { break; } Below are links to study: break file_exists…