Posts by KaduAmaral • 11,472 points
313 posts
-
0
votes2
answers151
viewsA: How to center a text on the image side example below
You can use css vertical-align .vertical-align { vertical-align: middle; } .contact-container { color: #666; text-align: center; } .margin-right-10 { margin-right: 10px; } .margin-left-30 {…
-
1
votes1
answer181
viewsQ: How to avoid access to the database?
The perfect world would be that no user (company employees) had access to the production bank and this is my goal, only I do not know what the steps to get to this point. Today the devs have a…
-
1
votes1
answer46
viewsA: Which operator should I use in Javascript c:if when I want to be between two variables?
There is an excellent Javascript library called Momentjs to work with dates, follow an example: var input = document.getElementById('dataInput'); var div = document.getElementById('minhaDiv'); var…
-
0
votes1
answer188
viewsA: Angularjs route does not open on page loading
I managed to solve by creating a state Abstract: $stateProvider.state('clean', { abstract: true, templateUrl: 'path/para/template.html' }).state('clean.quickRegister', { url: '/quick-register',…
angularjsanswered KaduAmaral 11,472 -
0
votes1
answer188
viewsQ: Angularjs route does not open on page loading
I have a template and two routes, none open on page loading (or F5), but if I make a $state.go('nameDaRota'), it is loaded correctly. // routes.js angular.module('app').config([ '$stateProvider',…
angularjsasked KaduAmaral 11,472 -
2
votes1
answer831
viewsA: How do I send notifications (push) to a specific user (from the application) from Firebase?
There are two ways you can do this. The first is by using the groups from Firebase. The group is a set of a user’s devices. (I haven’t used this Firebase feature yet, so I don’t know if it’s easy to…
-
2
votes2
answers629
viewsA: Firebase Cloud Messaging does not send sound in notification
I’m not sure, but this could be happening because of the type of message, you’re sending a notification like "Notification", It makes her is delivered directly to the "tray" of push Android and does…
-
0
votes1
answer248
viewsA: Send Object array as Ajax parameter
Give a JSON.stringify in the data. function uploadFiles(formData) { const email = "blablablabla"; $.ajax({ url: '/admin/foto', type: 'POST', data: JSON.stringify(arrayObj), // <<-- Stringify…
-
2
votes3
answers299
viewsA: Search filtering error (PHP)
The message says Call to undefined function mysqli_result in [...]filtro.php:15. That is the function mysqli_result there is no. This happened because there is not even the function mysql_result. In…
phpanswered KaduAmaral 11,472 -
8
votes3
answers38304
viewsA: Position DIV in the center of the page
Modern times It is currently possible to do this much more simply using flex-box, example: .flex-box { display: flex; align-items: center; justify-content: center; } .container-box {…
-
2
votes2
answers142
viewsA: How to delete a certain line of code warning?
The correct thing is to always treat the mistakes, for a better performance of your script, but how the question is about suppress: Suppressing throughout the System <?php // Desliga o report de…
phpanswered KaduAmaral 11,472 -
0
votes1
answer26
viewsQ: Aurelia bindable and jQuery plugins
I have a problem with bindable variables and jQuery plugins that manipulate input value. I tested the following code and found that Aurelia does not listen to the changes of values made by $.fn.val:…
jqueryasked KaduAmaral 11,472 -
0
votes1
answer450
viewsQ: How to send multiple folders using SSH (SCP)
I have a "deploy.sh" file that has the following command: scp -r ./public_html [email protected] -p 9922 But the command keeps giving error: No such file or directory But the…
-
3
votes1
answer80
viewsQ: Log storage/indexing tools
I need to create a system to store logs of various user actions (this system will create millions of weekly data). So what tools are available for this kind of need? PS.: It is extremely necessary…
logasked KaduAmaral 11,472 -
3
votes1
answer83
viewsQ: Make getopt ignore first argument
I’m creating a PHP CLI, and wanted to run something like this php console.php comando -a foo -b bar -d But with the function getopt I can’t get past the comando if not the Buga function and do not…
-
2
votes1
answer339
viewsA: How to print the value of a button in a text box using javascript
The problem with your code is that part b+i.addEventListener, you are trying to concatenate a variable that does not exist b, with the value of i and trying to add a "this" event. You need to take…
javascriptanswered KaduAmaral 11,472 -
2
votes1
answer674
viewsA: Node JS, Socket.IO Rooms and namespaces
This is what namespaces and Rooms has in common (socket.io v0.9.8 - note that v1.0 has been completely rewritten, so some things may have changed): Both namespaces io.of('/nsp') and Rooms…
-
1
votes2
answers95
viewsA: Page does not recognize href=" "as if there was no href=" ", nothing happens - PHP
The problem is that you put a z-index negative value: .faixaCinza { position: relative; z-index: -1; /* <<-- Problema */ height: 120px; width: 100%; background: #1a7ed4; /* ... */ } With this…
-
0
votes1
answer139
viewsA: Line break with different image height, Bootstrap
You can do thumbnails. You can do "manually" by cutting the images and saving the Thumbs, or you can do "virtual" that would be at runtime, an excellent library to do this is the Smartcrop.…
bootstrap-3answered KaduAmaral 11,472 -
1
votes2
answers1195
viewsA: Validating Javascript fields
You are using the attribute pattern to validate the data of input. Removing it will be all right, and validation will occur only via Javascript: <div class="campo"> <label…
-
1
votes1
answer57
viewsA: Foreach does not carry marked fields
You’re clearing the value of checkbox with the line novoCampo.find("input").val(""); When you go checkbox you must change your state via prop and not its value val. Do the following:…
-
1
votes3
answers922
viewsA: Check external file loading with JS
One way to do this with video, more rustically, is to keep checking its status, and when the status is 4, means he was fully charged: var video = document.getElementById('video'); var interval =…
-
5
votes3
answers9438
viewsA: Delete confirmation with bootstrap
There is a plugin called Bootbox with it you can display Alerts, confirms, prompts and custom dialogs in any way. Example: bootbox.confirm({ message:'Confirma a exclusão do registro?', callback:…
-
3
votes4
answers1152
viewsA: How to transform a string into an object?
Just as James Light answered, eval would do well in your case, since you are handling the string to receive only allowed characters and believe that you create the string with the objects yourself,…
phpanswered KaduAmaral 11,472 -
5
votes1
answer1377
viewsQ: How to implement a Route System in MVC?
I am creating an MVC Framework (more for studies), and I am trying to implement a route system, but I’m not sure how/where to run the routes. So I’d like to know if there’s any flow of execution of…
-
1
votes1
answer73
viewsQ: Authentication of Facebook
I’m creating an API and I’m trying to implement authentication with Faceboook. Here’s the scenario, there are 2 environments front-end and the back-end, both are in different domains. Ex: Front:…
-
1
votes1
answer91
viewsQ: What is the C++ vector
The college professor asked to research the ordering scripts and perform tests with them, determining which is better in which situation. I found the scripts, though on the site the guy does not…
-
1
votes1
answer165
viewsQ: How to Implement Plugins in an MVC Framework
I’m creating my own Framework MVC, mainly for studies, and would like to implement plugins but I have no idea how to do it. I would like to know some points, such as: Control of plugins installed?…
-
1
votes1
answer166
viewsA: Problems with spaces between li’s
The problem is that inline-block do not declare when you need to use the full width with several elements, because of the already mentioned white-Spaces or blank space. One of the possible solutions…
-
3
votes2
answers916
viewsA: Sum of table fields with PHP and Codeigniter
You can do this using the function SUM and grouping the records by the field you want with GROUP BY. Example: SELECT `customer_id`, SUM(`amount`) AS `amount` FROM `tb_customer_credit` GROUP BY…
-
3
votes2
answers547
viewsA: PHP Works Local (XAMPP - PHP 5.5.33) but does not work on Server (PHP 5.5.31)
After several tests I found that redirecting does not work with Ajax requests, probably for some security reason, when the browser gets the code 301 redirect it already stops the request. The…
-
2
votes1
answer773
viewsQ: Redirect AJAX Cross-Domain Request in PHP
I have a code that redirects an AJAX request and it works normally on localhost, but on the hosting server cross-browser the request is not redirected. header('Location:…
-
2
votes2
answers547
viewsQ: PHP Works Local (XAMPP - PHP 5.5.33) but does not work on Server (PHP 5.5.31)
I’m making an API, and locally it’s perfect. The problem is when I test it on the server. I created it in a subdomain, example: http://api.dominio.com And I’m testing in another subdomain:…
-
5
votes3
answers5281
viewsA: take the value of a <td> by clicking on a checkbox of the same <tr> jquery line
The problem is you’re getting all the td's table with the expression $('#tableTime tr td'). You must take the tr where the checkbox is, so use the this. The this represents the element referring to…
-
3
votes3
answers1396
viewsA: Check that the mouse is not in the element
You can use the is jQuery, as parameter can pass selectors, functions, elements and selection, more details in documentation. Example: $(document).on('click', '.executa', function(event){ // Obs:…
-
4
votes4
answers79
viewsA: Dar Selected at a given value received in the JS function
Use the val similar to inputs: $('#etapa_id').val(etapa_id); Example: $(document).on('click', '.setval', function(event){ var etapa_id = $(this).data('val'); $('#etapa_id').val(etapa_id); });…
-
2
votes1
answer267
viewsA: Add a value to while in php
The value being passed to while is not a number n as you are thinking, so it is not possible to do the +1 that you wanted. while($row = mysqli_fetch_array($result)) The variable $row of the…
-
1
votes2
answers1498
viewsA: How to preview file . Md during editing?
There is also a plugin for Google Chrome called Markviewer, very good and simple. Just open the file in the browser (with the plugin installed) that it already recognizes and formats. There is no…
-
0
votes5
answers156
viewsA: Type induction for any type of object
In addition to the methods presented in the other answers, you can create a class encompassing the others you want to pass in this parameter: Code: abstract class FooBar { public $name; } class Foo…
-
4
votes1
answer2947
viewsA: How to change primary key referencing foreign key to auto increment
You need to remove the Fk reference before changing the column in the other table, try this way: -- Desabilita as verificações de FKs SET FOREIGN_KEY_CHECKS = 0; -- Deleta a referência de FK da…
mysqlanswered KaduAmaral 11,472 -
1
votes3
answers785
viewsA: How to treat the logged-in user in a MVC system?
I have a file attached to the application folders that is called appsconfig.php, in this file I added the following data: 'authentication' => [ 'controller' => 'Auth', 'action' => 'logged',…
-
3
votes3
answers785
viewsQ: How to treat the logged-in user in a MVC system?
I’m creating a MVC framework a few weeks (developing it and using it at the same time), I arrived at the part of creating the authentication system. So I’d like to create a way for me to configure…
-
1
votes5
answers3697
viewsA: How to import a variable within a function of a class?
Only complementing the other answers and also exemplifying the comment from @Erloncharles, which is not recommended for all cases (as already mentioned) and almost always the best option is to pass…
-
1
votes2
answers4056
viewsA: File exists but does not include (require_once)
I used a string to check if the file exists, but I used another to do the require: if (file_exists($path)){ $file = $lib.$class.$ext; break; } Solution: if (file_exists($path)){ $file = $path;…
-
1
votes2
answers4056
viewsQ: File exists but does not include (require_once)
I have a lodging (of dubious quality), I am making a require_once where I check if the file exists, and is giving error: Warning: require_once(/home//base/Core Application.class.php): failed to open…
-
2
votes1
answer27
viewsQ: Is it possible to use IGNORE based on a field that is not PK, it is only a Single Index?
Taking into account the following modeling: ID INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY PONTO INT (10) NOT NULL UNIQUE ENDEREÇO INT (10) NOT NULL (FOREIGN KEY) Where the field ID is a Auto…
-
10
votes2
answers28732
viewsA: Personalize an Alert
There is no way to personalize a alert, but you can use some modal, an excellent that I recommend is the Bootbox.js based on Bootstrap. Example: bootbox.alert("Hello World");…
-
3
votes2
answers1590
viewsA: How to make a progress bar?
The simplest way to do this would be to add a loading icon... jQuery(document).ready(function($) { $("#carregar").on('click', function(){ $("#loading").fadeIn('fast'); setTimeout(function(){…
-
7
votes3
answers2024
viewsQ: Keep application (Windows Form) open in icon tray with C#
How to do that when closing the application (either by close button, ALT F4, or any method other than the process manager), the application continues running in the Windows icon tray: And it is very…
-
1
votes1
answer894
viewsA: Foreign key registration query with multiple occurrences
I’m not sure I quite understand your problem due to the complexity of query that you posted, but fetch posts where all the tags researched should appear do something similar to the following: SELECT…