Posts by Alan PS • 2,511 points
151 posts
-
0
votes1
answer273
viewsQ: Wordpress and Laravel in same server and same domain
I have a Wordpress configured in a root folder on the server and created a subfolder with a Laravel, WP works normally, but Laravel opens only index, when I try to open the routes open a WP error…
-
1
votes1
answer13
viewsA: Increment a "Property path" in an ajax
I managed to solve, follows example: for (var i = 1; i <= 5; i++) { var p = "genero"+i; console.log(p); console.log(data.data[0][p]); }
-
-1
votes1
answer13
viewsQ: Increment a "Property path" in an ajax
I need to increment a property path in a ajax, I need to add numbers in front of the property in a for and receive its value, follow example: data.data[0].genero1 I need to get the genero2 now, I…
-
0
votes1
answer43
viewsA: Return model function in controller
I got something similar to what I need but without using populate, follow example: Using the library Mongoose-Fill Model: var mongoose = require('mongoose-fill'); schema.fill('teste',…
-
0
votes1
answer43
viewsQ: Return model function in controller
I need to return a model function in my controller as if it were a "virtual" from Mongoose, actually in the controller I would specify via "populate" the function name and return the function in the…
-
2
votes1
answer101
viewsQ: How do I make appends on Mongoose models?
I have a model in Mongoose that references another model, and I need to bring the data of this other model in my controller, follow code: Model Empresa.js: 'use strict'; const mongoose =…
-
3
votes1
answer276
viewsQ: Webservice error on Laravel 5.7
I’m trying to create a WebService for Laravel using the symfony/process, if I run it in windows command it fills the log successfully (php artisan gerar:arquivo 12 param1 1000), but when I try to…
-
0
votes1
answer155
viewsQ: Transform Mysql query into Eloquent (Laravel)
I have a simple query on MySQL, the query lists all the data of a table making a Group By in the field grupo_id and listing the latest data from Group By based on the created_at. In short, he lists…
-
4
votes2
answers583
viewsQ: What makes "group by 1" and why it causes errors in Laravel
I wonder what the group by 1 does in the MySQL ? I’m curious because I have a very complex query on MySQL and it works great, only I’m trying to use it in Laravel and I get an error in the return.…
-
1
votes1
answer206
viewsQ: How to use mysql zerofill in Laravel Migrations?
I’m trying to add the zerofill of MySQL in the Migrations of Laravel but I’m not succeeding. Can you tell me how to do this ? Follow my sample code by editing a table by adding this tinyint field…
-
1
votes1
answer317
viewsQ: JSON formatting created in PHP
I am creating a JSON that needs a specific formatting in PHP, the problem is that I can’t make it look like my JSON template, follow template and my PHP: Model: { "success":true, "message":"",…
-
0
votes2
answers419
viewsA: How to upload an Laravel project to the server
Problem solved! It was a simple thing, I had to change my version of PHP on the Dreamhost server, I was with PHP 7.0 and I switched to PHP 7.2!
-
0
votes2
answers419
viewsQ: How to upload an Laravel project to the server
I did some things to test Laravel, I did everything on my localhost with Xampp and Composer, now I need to go up to Dreamhost and I’m not getting it, when I try to access the project on Dreamhost I…
-
0
votes3
answers75
viewsQ: How to calculate a FOR for 6 in 6 increments it give an echo?
I have a simple FOR that I need that every 6 increments it sends an echo with a message, follows code: $carros = array("Volvo", "BMW", "Toyota", "Alfa Romeu", "WV", "Teste", "test2", "Teste4",…
-
1
votes0
answers81
viewsQ: Curl inside another Url to save images
I have an api in Slim Framework, within the "Service A" of the api I am using a Curl to call the "Service B" of the api, this "Service B" downloads images by their url using another Curl, it runs…
-
4
votes1
answer384
viewsQ: Send GET parameters to a php using the exec command
I am trying to send GET parameters to a php using the exec php command, but when I put the parameters the script does not run, it does not reach the other php, follows my code: exec.php: $cmd = 'php…
-
1
votes2
answers2122
viewsQ: Access-Control-Allow-Origin jQuery Ajax
I am trying to access the mail api to calculate freight and get the following msg: Failed to load http://ws.correios.com.br/calculador/CalcPrecoPrazo.asmx/CalcPrecoPrazo: No…
-
0
votes1
answer51
viewsQ: Click on dynamically generated element does not work
Hi, I am cloning an element via jQuery and when I click on an item of the cloned element click does not work, follow example codes: Cloning: var template = $(".products…
-
0
votes1
answer69
viewsQ: How to use bootstrap Carousel in a wordpress theme
I made a simple theme in wordpress and am using this kind of js: (function($) { console.log("teste"); $('.carousel').carousel(); })(jQuery); and this html: <div id="carousel1" class="carousel…
-
1
votes1
answer124
viewsQ: Keep id and id_user equal on updateOrCreate
Hi, using the Slim Framework for php, I’m trying to make a updateOrCreate: $eventos = Eventos::updateOrCreate( ["id" => $id, "id_usuario" => $id_usuario], ["nome" => $nome, "descricao"…
-
0
votes1
answer81
viewsQ: CSS or Jquery - How to leave an entire page with Pointer-Events: None; less such element
I want to leave everything inside the div .divGeral with pointer-events: none; minus the class .divnaomodificavel This is my code, below... HTML: <div class="divGeral"> <div…
-
6
votes1
answer3033
viewsQ: Date in Portuguese (en-br)
I have the following code in PHP: <?php setlocale(LC_ALL, "pt_BR", "pt_BR.iso-8859-1", "pt_BR.utf-8", "portuguese"); $tz_object = new DateTimeZone('Brazil/East'); $datetime = new DateTime();…
-
1
votes1
answer77
viewsQ: Mysql - How to get the table name where the result came from?
I have the following mysql code: (SELECT * FROM entrada WHERE idUsuario = "1") UNION (SELECT * FROM saida WHERE idUsuario = "1") It’s all working but I need to know which of the 2 tables the result…
-
1
votes1
answer45
viewsA: Mysql - List results from 2 tables
I got it using UNION: (SELECT * FROM entrada WHERE idUsuario LIKE '1') UNION (SELECT * FROM saida WHERE idUsuario LIKE '1')
-
1
votes1
answer45
viewsQ: Mysql - List results from 2 tables
I have two tables with the same field and I need to make a SELECT with two conditions, I’m trying this code but is listing 2 times the result only from the first table (entrada), nothing from the…
-
0
votes1
answer352
viewsQ: Find previous sister div in CSS
I have the following HTML: <div class="load"> <img src="images/load.svg" class="loadimg"> </div> <div class="tela carregando"> <span>Teste</span> </div> the…
-
1
votes1
answer1412
viewsQ: Jquery or CSS - How to create an animation that flashes back to the original?
I have the following Jquery code: $(".add").click(function(e) { $(".saida").addClass("backgroundRed"); }); and the following css: .backgroundRed { color: #FFF; background: #c1272d; } It’s all right,…
-
2
votes1
answer88
viewsQ: Divs with alternating colors
I have an ajax that shows the results to me in a JSON, I need the colors of the <div> alternem: in the first gray color, in the second white, in the third gray, in the fourth white and so on.…
-
2
votes1
answer89
viewsA: Editing the course settings form
I managed to solve by editing the file edit.php, includes some lines in the code to add values to the $data object, example: $data->hora = $_POST["hora"]; $data->local = $_POST["local"];…
-
2
votes1
answer89
viewsQ: Editing the course settings form
I’m editing the course settings form on moodle and it works, it added the field but not saved if I change in banco de dados the data saved are printed on the input, only it didn’t save.…
-
1
votes1
answer56
viewsQ: Change equal titles
I have a foreach with equal results being printed, I need to change those that are equal. An example of the code is this: foreach ($courses as $key => $course) { var_dump($course->fullname); }…
-
3
votes2
answers7136
viewsQ: Find duplicate values in an array
I have a foreach and he has equal results, I want that when he has the same result he make a echo Code example: $courses = array('teste', 'teste2', 'teste3', 'teste'); foreach ($courses as $key…
-
-1
votes2
answers74
viewsQ: Mysql query generating error when using the OR clause
I have the query used in WP and it causes an error when I use OR, follow the example of use: SELECT * FROM ' . $table_ucf . ' WHERE form LIKE "'. $this->form_active.'" AND name LIKE "%s" OR email…
-
0
votes1
answer248
viewsQ: Search in WP, "%" does not work
I have a search in wordpress and she uses the following: $form_data = $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM ' . $table . ' ucf WHERE name LIKE…
-
0
votes1
answer824
viewsQ: Image size highlighted in wordpress
I have a loop that pulls the highlighted image of the post, I pull the image using get_the_post_thumbnail_url(), tried get_the_post_thumbnail_url('thumbnail') but gives error, I need to get the…
-
0
votes0
answers52
viewsQ: Jquery/Ajax/Json - Getting to Json
I have an array and need to get to it with jquery/ajax, the problem is that I do not know how to get to it, it is being created by php $json = Array(); then make an array push like this:…
-
5
votes2
answers2780
viewsQ: How to show a separate number per point every 3 houses?
How can I format values this way: 1.000 or 150.000 or 42.000 ? My code is this: var f02 = 42000; console.log(parseInt(f02)); I need the variable formatting f02 stay that way: 42.000, and when the…
javascriptasked Alan PS 2,511 -
1
votes2
answers298
viewsQ: Jquery - Next div when clicking on a link
I have 2 Divs and when I click inside a link inside the 1st div I need to get the value of the 2nd div, how do I do this? HTML: <div class="vei"> <span class="download"><a…
-
0
votes2
answers1851
viewsQ: PHP - Cookies, how to detect if you are created
How do I detect if a cookie exists ? My cookie is created like this: setcookie("log", "true", time()+60, "/classes"); And to detect I’m trying it: if (!isset($_COOKIE['log'])) { //função } But it…
-
3
votes1
answer2783
viewsQ: CSS - Format a table
I have a table that has a very complex header and I’m not being able to style, the table rows have a higher height in the fields that have 2 lines, how can I fix this ? Follow the link from Jsfiddle…
-
1
votes0
answers65
viewsQ: Jquery - Update list by ajax
I have an ajax that is called every 10 seconds by a setInterval, it gets a json and when I delete an item from the json I need the item to sum up from the ajax listing as well, the code to remove…
-
3
votes2
answers2939
viewsQ: Ajax/Jquery - How to know if a request has been completed?
I have a simple ajax like this: function ajax() { $.ajax({ url: "../../api/utilitarios/cidades/estado", method: 'POST', dataType: 'json', success: function (data) { }, error: function (data) {…
-
1
votes2
answers1282
viewsQ: Shell/Bash - Script continues before finishing the line that is running
I have a shell/bash script that works perfectly to make backups, the problem is that I have large files that are giving problems in the execution of the script. The script has to compress the file…
-
3
votes2
answers2187
viewsQ: Copy directory from one ssh server to another
I need to copy a directory on a server with a script .sh running on another server. I read about the command scp and saw some examples of use, but did not figure out how I put the password of the…
-
2
votes1
answer150
viewsQ: Jquery/Ajax - How to keep the page up to date?
I have a page that is loaded with $.ajax() from Jquery, ajax pulls a page in php with a database that is constantly updated and need to keep the page updated, as serious the best way ? I read about…
-
3
votes3
answers2128
viewsQ: Send PHP variable to Shell Script
I have a file .sh and it has variables that I need to receive from PHP, follow an example: //variavel 1 que preciso receber externamente NAME="" //variavel 2 que preciso receber externamente DIR=""…
-
1
votes1
answer5766
viewsQ: How to know if the script command has been successfully executed?
I need the script to identify whether the tar.gz file was successfully generated in an if. Here’s a non-functional example: VAR=tar -zcf teste.tar.gz teste/testeDir if [VAR] then echo "Sucesso" else…
-
0
votes2
answers530
viewsQ: Jquery - Compare 2 arrays in each
I have the following function: function pre() { $.ajax({ url: "arquivo1.php", method: 'POST', dataType: 'json', success: function (data) { $.ajax({ url: "arquivo2.php", method: 'POST', dataType:…
-
1
votes1
answer160
viewsQ: Jquery - append in prepend generated element in each
How do I add elements to an element that has been added inside a each ? Following example: $.each(data.id, function(i, item) { $( ".lado" ).prepend("<div id='tes'>" + data.id +…
-
1
votes1
answer91
viewsQ: Jquery - Each with multiple arrays
I need to make a each with several items, example: How can I do that? The "item" already generates the result of the "data.id_site" array but I need a new array together, the "item2" that generates…