Posts by Rafael Meirim • 321 points
32 posts
-
0
votes1
answer50
viewsQ: Avoid many requests in Select
I would like to know some alternative to block excess requests with Select combo box from the following code: //Input Cascata Estado / Cidade $("select[name='estado_id']").change(function(){ var…
-
0
votes1
answer340
viewsQ: Problem with PUT Laravel
I’m using Laravel 5.6, routes and controller with Resource and in scritpt Post the code works normally, but with PUT it always gives error. Follow the working code of the POST const fileInput =…
-
1
votes1
answer199
viewsQ: Laravel Relationship on Datatable server side
Would you have some way to pass the model relationship to the columns of the Datatable server side? For example in the Datatable script: columns: [ { data: 'marca_id', name: 'marca_id' }, { data:…
-
0
votes1
answer144
viewsQ: Laravel activitylog, error in implementation
I’m following the documentation of the site: https://docs.spatie.be/laravel-activitylog/v2/basic-usage/logging-activity, but I’m not able to implement the option below: Setting a You can specify on…
-
1
votes1
answer91
viewsQ: Duplicate JS when sending record
I have an application with bootstrap modal, but when sending the data with the button it duplicates the event, follow the js with duplication. $(document).on('click', '.form-delete', function(e){…
-
0
votes2
answers220
viewsQ: Create route template in Laravel with Resource
I would like to know how to create a template in the Blade containing generic actions (view, edit, delete) for all routes of my application, for example in the column of actions I have the code:…
laravelasked Rafael Meirim 321 -
0
votes0
answers373
viewsQ: Count multiple records for Chart on Laravel
How do I count multiple records with Laravel? Example: Table homicios, count the columns month, date, city separately and generate the chart in Chart. Chart 1: Jan - X quantity Feb - X quantity Etc.…
-
0
votes1
answer150
viewsQ: Reduce function in controller
I wonder if you have how to rewrite the function below in a cleaner way without so many if / elseif. public function pesquisa(Request $request) { if (! Gate::allows('celular')) { return abort(401);…
-
0
votes1
answer64
viewsA: Junction of Laravel searches
I managed with a series of if and elseinf, I do not know if the most elegant way, but it worked, follows the code: // verifica se há valores para utilizar no 'where' if(isset($buscar_todos,…
-
0
votes1
answer64
viewsQ: Junction of Laravel searches
I have the function in my controller: public function pesquisa(Request $request) { if (! Gate::allows('celular')) { return abort(401); } $marcas = CelularMarca::orderBy('nome',…
-
1
votes1
answer1300
viewsQ: Form select with Laravel
I have this code working, but I wonder if there would be a more elegant way to write the following code in the view, through the Laravel formats: <div class="row"> <div class="col-xs-12…
-
1
votes4
answers1139
viewsQ: How to get last login of each user using mysql?
I have the following table: CREATE TABLE `adm_historico_acesso` ( `id` int(10) UNSIGNED NOT NULL, `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `ip` varchar(100) NOT NULL, `usuario`…
mysqlasked Rafael Meirim 321 -
2
votes2
answers1075
viewsQ: mpdf only displays in firerox
I am using mPDF and it is only generating the reports correctly in Firefox or opening by IE. If I try to open the file with PDF reader it returns the failure error when loading PDF document.…
-
1
votes2
answers247
viewsQ: Mysql does not save all characters
I implemented the Ckeditor in my textarea, but it is not saving the data correctly in the BD. The result is like this: If I write Testing in bold, the result of pure html would be:…
-
0
votes2
answers701
viewsA: Sort dates in Datatables
Managed using documentation with the plugins of Moment and date-time-Moment: $.fn.dataTable.moment( 'DD/MM/YYYY' );
answered Rafael Meirim 321 -
0
votes2
answers701
viewsQ: Sort dates in Datatables
I am using Datatables.js to render my tables, the problem is that the date displayed in the table is already converted to d/m/Y and if I click reorder by column it will not display the data…
asked Rafael Meirim 321 -
0
votes1
answer145
viewsQ: Put 00 left into another variable
I have an HTML form that receives the number according to the ID registered in SQL and saved in another variable, but the ID is sequential and without zero left, example: ID 1 ID 2 ID 3 I needed to…
-
1
votes1
answer37
viewsQ: Select model according to brand
I have the function that returns all registered tags: (With the ID and TAG fields) public function lista(){ $lista = array(); $n = 0; $db = new mysql(); $exec = $db->executar("SELECT * FROM…
-
0
votes1
answer1654
viewsQ: Send null date if not filled in
How do I enter a date null in that capacity? $data_saida = $this->post('data_saida'); //aqui pega a data se não for vazia e formata if($data_saida) { $arraydata = explode("/", $data_saida);…
-
0
votes1
answer69
viewsQ: Increment even if delete record
I have the following problem, I have the following function: public function codigo_denuncia() { $db = new mysql(); //pegar as linhas do ano $ultimoRegisto = $db->executar("SELECT id FROM…
-
1
votes2
answers70
viewsQ: Insert php field concatenating date
I would like to know how to insert the following combination, via PHP or mysql: I have a field called YEAR that needs to receive the current YEAR 2017 format, via php or mysql. I have a code field…
-
3
votes3
answers559
viewsQ: Document protocol
I am making a program in php, mysql and would like to generate a protocol with some argument. The protocol would be generated automatically in the system, without interference from the user, but it…
-
1
votes1
answer40
viewsQ: Open page with active form
I would like to know how to open a new page with an active form field, because by default when you open a page no field is active, ie you need to go with the mouse and click on some field, it is not…
-
0
votes1
answer114
viewsQ: Catch name of tag span
I need to take the generated name inside the id="pegname" and put inside the id="name", I did the code below, but it didn’t work. The tag of the span id="pegname" generates the name of the client,…
javascriptasked Rafael Meirim 321 -
1
votes1
answer361
viewsQ: Close function when clicking outside the element
I have a problem in script below, the function myFunction and myFunction1 normally open the dropdown by clicking the button, but in the click-out and close part, only the second event is working.…
javascriptasked Rafael Meirim 321 -
1
votes1
answer1094
viewsQ: Select Option with filters
Example of the first Box: <h5>Filtrar por Marcas</h5> <select name="filtrar_marca"> {% for category in categories %} <option value="{{ category.name }}">{{ category.name…
-
2
votes1
answer503
viewsA: Change NAV and DOT Owl Carousel 2
For those with this doubt I managed to create a class Own-Carousel-top, then making her call in DIV, follow the data: .owl-carousel-top .owl-next, .owl-carousel-top .owl-prev { top: 28%!important;…
-
1
votes1
answer503
viewsQ: Change NAV and DOT Owl Carousel 2
I’m using Owl Carousel 2, but I’m not able to make these changes to the image below. I need to shift the position of Navs and Dots into the banner, if you can give a force I thank you.…
-
1
votes1
answer39
viewsQ: Change page Divs and specific Ids with calculations
Speak guys, I have the following situation on my site, on the carts page have a div I need to change the content of it and put some calculations according to the total value, let go of the…
jqueryasked Rafael Meirim 321 -
1
votes3
answers1394
viewsA: Several different carousel with owlCarousel
<script type="text/javascript"> $(document).ready(function(){ $("#marcas").owlCarousel({ loop:true, margin:10, nav:true, responsive:{ 0:{ items:1 }, 600:{ items:3 }, 1000:{ items:5 } } }) });…
-
1
votes3
answers1394
viewsQ: Several different carousel with owlCarousel
On my page I need 3 carousel: One to the banner, another for ruler and one more for ratings. All will be with images and would need each one to have its parameter, but with Owlcarousel I could not…
-
-3
votes1
answer111
viewsQ: Pick predefined value and assign in another field
Talk guys, I have the following problem: I need to take a date value already set so 2017-06-30 (YEAR-MES-DAY) and play it in another countdown script with the following parameters: year: 2017,…
jqueryasked Rafael Meirim 321