Posts by novic • 35,673 points
1,265 posts
-
2
votes3
answers1936
viewsA: How to pass dynamically changed value to function, in Angularjs
You have to create in your $scope the array of items and to initialize can be used in two ways, one within the controller and another by ng-init assigning the value in a simple expression. 1)…
-
2
votes1
answer31
viewsA: Middleware for post handling
The variable $post needs to be checked if he’s different from null, then try this adjustment: if ($user->id == 2 || ($post && $post->user_id == $user->id)) { or if ($user->id ==…
-
2
votes1
answer593
viewsA: Pagedlist: Data Pagination with Ajax
There’s an adjustment to be made here: Is pagina place new {pagina}: Instead of POST, place GET, because in that case it is link: @Html.PagedListPager(Model, pagina =>…
-
3
votes2
answers98
viewsA: How to relate two records in an elegant way?
Forms are diverse: Auth::user()->posts()->create($request->all()); or $user = Auth::user() if ($user) { $user->posts()->create($request->all()); } or in class FormRequest in the…
-
2
votes2
answers101
viewsA: EF relationship
If it is 1 for muitos make the change in StatusConcursos which has a list of Concurso: [Table("StatusConcursos")] public class StatusConcursos { public StatusConcursos() { Concursos = new…
-
1
votes1
answer749
viewsA: Apply CSS Style to Razor elements ex: Editorfor
The Editorfor generates tags HTML and are where we apply size, color, styles (css), etc.. The table below is how the Editorfor depending on the type of data: | --- Property DataType --- | ------…
-
2
votes3
answers75
viewsA: Conditional for registration selection
SELECT profissional.nome, funcao, final FROM historico_profissional LEFT JOIN profissional ON historico_profissional.idprofissional = profissional.idprofissional WHERE…
-
3
votes2
answers244
viewsA: Remove Arrows from Editorfor
Place TextBoxFor in place of EditorFor. The TextBoxFor generates a input text, while EditorFor generates input according to the type existing in your model which can be color, date, datetime,…
-
2
votes1
answer4106
viewsA: Target [Repository] is not instantiable while building [Controller, Service]
In the file key composer.json, include "Igreja\\": "app/": "autoload": { "classmap": [ "database" ], "psr-4": { "App\\": "app/", "Igreja\\": "app/" } }, In the code line type: php composer…
-
3
votes2
answers90
viewsA: Doubt with group by for last record
With ROW_NUMBER(): SELECT * FROM ( SELECT *, ROW_NUMBER() OVER(PARTITION BY aluno, aula ORDER BY data DESC) as sequencia from notas ) F WHERE sequencia = 1 References: ROW_NUMBER (Transact-SQL)…
-
1
votes1
answer1254
viewsA: Return the maximum sum of Collection with Mongodb
To take the maximum amount, regardless of the group: db.Values.aggregate( [ { $group : { _id : null , maximo: { $max: "$Valor" } } } ] ) To take the values per group (UF): db.Values.aggregate( [ {…
-
0
votes1
answer182
viewsA: Consultation in Relationship Many-to-Many with LINQ to Entities
Do the research and bring one Curso Code 1, already in the list will come all Professores related: Cursos curso = db.Cursos.Find(1); // contem a lista de professores do curso 1…
-
3
votes1
answer268
viewsA: Problems deleting via ajax with Laravel
There are configuration errors that compromise sending the request via ajax in the Larable. $.ajaxSetup was wrong the key to the headers as described in the documentation itself of the framework…
-
0
votes1
answer142
viewsA: C# Entity Dbset with DDD?
I was in doubt in some fields, but, can be done the Include, after a Select and finally the filter inside the FirstOrDefault: var result = DbSet .Include(i = i.Cliente) .Select(s => new { s.Id,…
-
2
votes1
answer39
views -
0
votes1
answer760
viewsA: Doubt about the version of the Laravel:
To install a particular version follow the documentation and use the commiserate as the command line just below: php composer create-project laravel/laravel nome_do_projeto "5.1.*" as described in…
-
3
votes1
answer1417
viewsA: Editable combobox with filter
Has several plugins which are excellent to solve your problem: 1) bootstrap-select $(document).ready(function() { $('.selectpicker').selectpicker(); }); <script…
-
3
votes1
answer1201
viewsA: Asynchronous paging with Laravel
Using $.post of jquery and the paginate() of eloquent has an easy way to work with ajax: Example: Table The table parque has two fields the id and the description Model Parque <?php namespace…
-
3
votes1
answer143
viewsA: c# Microsoft Access converting data
Always when using specific field recordings (datetime, decimal, double, bit, etc), there is the Parameters of Oledbcommand to correctly convert the data sent to your table into database ACCESS (this…
-
1
votes1
answer155
viewsA: Queries Builder Problems (Query Builder) in Laravel 4.2
I guess it’s like, I did it right without putting like scope If it works, just transfer it there, the syntax is this:. $param1 = $data[0]['mundos']; $param2 = $data[0]['regionais']; $rel =…
-
1
votes1
answer606
views -
2
votes1
answer818
viewsA: Capturing the Boolean value of a PHP checkbox
Your code is wrong, you are sending a variable that does not match the key name, note: Change: #Caso de verificação da variável booleana $usado = $_POST["usado-produto"]; if(array_key_exists($usado,…
-
2
votes2
answers1063
viewsA: Grab image inside Storage folder
Create a symbolic link inside the briefcase /public. How to create symbolic link, examples here on Sopt?: How to list symlinks from a folder on Linux? Linux - Symolic Link + Dropbox How to create a…
-
5
votes2
answers2166
viewsA: Check Empty Fields - Orange 5.3
If no value is chosen on that select he’s sending "" ai mora the problem, need to be checked before sending to that layer repository: $data = $request->except('vendedor_id'); $data['vendedor_id']…
-
2
votes1
answer722
viewsA: Laravel - How to call a different action from store,update, Edit?
Open the route file and create a Route::post as follows: Route::post('consulta', [ 'as' => 'cadastro.consulta', 'uses' => 'cadastrarController@pesquisar'] ); Reference: routing basic-routing…
-
1
votes1
answer373
viewsA: Problem with referential integrity in Migrations (Laravel 5)
Along those lines $table->integer('instituicoes_id')->unsigned(); add nullable(): $table->integer('instituicoes_id')->unsigned()->nullable(); answer obtained in the question Soen -…
-
1
votes1
answer67
viewsA: CONCAT not working
Try it like this: SELECT *, CONCAT(Anos, ' Anos ', Mes, ' Mes e ', Dias, ' Dias') AS Extenso FROM ( SELECT indicativo_ja_registrado, qra, fez_contato, DATE_FORMAT(data_qso, '%d/%m/%y') AS data_qso,…
-
2
votes2
answers775
viewsA: Mask problem in jQuery
Has several plugin for example jQuery.validation and one other plugin to verify the date the momentjs. Creates a method on validator ($.validator.addMethod) that will check the date on brazilian…
jquery-mask-pluginanswered novic 35,673 -
2
votes1
answer144
viewsA: URL by Viewbag
With Html.Raw, that in the translation says that the string to interpret as HTML markup instead of encoded HTML. (translating: HtmlHelper.Raw Method (String)). Controller: ViewBag.Quantidade =…
-
7
votes1
answer1794
viewsA: Save multiple attributes to the same object in Laravel
Relationship Laravel N:M The relationship Many for Many (N:M) to the eloquent, is not obligatory the creation of model of that relationship when it relates correctly using belongsToMany it is simple…
-
3
votes4
answers94
viewsA: What’s wrong with this Javascript code?
You have to use the querySelectorAll instead of querySelector the difference is that it takes all occurrences and not just one (in the case the first span). var menuTabs =…
javascriptanswered novic 35,673 -
5
votes2
answers6439
viewsA: Serializing and Deserializing Json objects with C#
The @Randrade answer is a better way to solve your problem, I just want to add that if you use the package Json.NET, can rename class fields by placing more suggestive names, with the configuration…
-
4
votes1
answer1519
viewsA: Edit record before passing validation rule in Laravel
Has two viable ways to work with validation with this problem: 1) Creation of Service Provider with Validation Customizada Create a Service Provider by command: php composer make:provider…
-
3
votes2
answers540
viewsA: How to sort with LINQ with one LIST<T> inside another?
Example: static void Main(string[] args) { Combo combo = CarregarCombo(); //ordenando os grupos. combo.Grupos = combo.Grupos.OrderBy(o => o.Key).ToList(); //ordenando e atribuindo a mesma…
-
3
votes3
answers89
viewsA: How to parse a string array for a multidimensional array?
Utilize explode within an interaction (for) sweeping each line and transformed into another array: $dados = array ( 0 => 'MemTotal: 4060964 kB', 1 => 'MemFree: 3630320 kB', 2 =>…
-
1
votes1
answer182
viewsA: Combobox with yes and no on the Laravel
Basically that would be: <select name="disponivel_venda" class="form-control"> <option {{$property->disponivel_venda=='Sim'?' selected':''}}>Sim</option> <option…
-
2
votes1
answer132
viewsA: How to simplify declaration of types with Entity Frameowrk?
The way to leave a configuration global to the Entity Framework is in the method OnModelCreating with the line modelBuilder.Properties<DateTime>().Configure(x =>…
-
3
votes2
answers1150
viewsA: Group items by month and count them
$mes = date('m'); $vendas = Encomenda::where('FlgStEncomenda', 'O') ->groupBy(\DB::raw('MONTH(created_at)')) ->select(\DB::raw('MONTH(created_at) as Mes, count(*) as Quantidade'))…
-
0
votes1
answer378
viewsA: Error: Array to string Conversion - Select Multiple Laravel 5
In the way you sent directly, without converting the data will give error even, need to convert with json_encode, to send a text in the format json for the table in the bank. In MySQL to from…
-
0
votes2
answers319
views -
5
votes4
answers6169
viewsA: Angular js Array within another array
Need to make a ng-repeat within another ng-repeat, to access each array and print the values: Html: <div ng-app="app"> <div ng-controller="ctrl"> <div ng-repeat="array in arrays">…
-
2
votes1
answer264
viewsA: Convert C# Generated Date to ISO format in Javascript
Download momentjs which is a library javascript, that works with various date formats and various functions: moment("/Date(1198908717056-0700)/").format('DD/MM/YYYY'); var data =…
-
1
votes2
answers1769
viewsA: Get JSON result with php
The key is ['results']['forecast'], I made a complete example with all the keys including what I needed most. <?php // Função responsável em trazer os dados json function getForecast() { $url =…
-
2
votes1
answer43
viewsA: Simple While Cycles
Remove & of this line printf("%d\n",&cont);: Code: #include <stdio.h> int main(void) { int cont=15; while(cont<=200){ printf("%d\n",cont); cont++; } return 0; } Online Example…
-
1
votes1
answer31
viewsA: How to modify this query to get the desired result in Codeigniter?
You have to use the query-grouping, commands: $this->db->group_start(); and here you put the conditions and finish: $this->db->group_end(); applying in your code, within the if, some…
-
2
votes2
answers6203
viewsA: Use array_search in a php multidimensional array
Combine array_keys with array_filter, and in comparison with strpos searching for the first occurrence of a text (string). Observing: If you don’t want to differentiate between upper and lower case,…
-
3
votes4
answers544
viewsA: Error set getElementById?
It is not good practice to put the id (read) of any tag html only with a number always put the initial one letter (example: a1, b1, etc.), in the code has the problem of putting a number as a…
javascriptanswered novic 35,673 -
2
votes1
answer27
viewsA: How does Composer behave when upgrading packages?
In case I rename the directory lib/ for src/. The right thing would be to make the package available as v1.0.1 or v1.1.0? May v1.0.1 following the normal sequence of your package and for being a…
commiserateanswered novic 35,673 -
3
votes2
answers1027
viewsA: How to activate 24 hours in Datapicker Bootstrap?
Placing the references of: Css bootstrap.min.css datetimepicker.css Javascript jquery.min.hs bootstrap.min.js Moment-with-locales.js bootstrap-datetimepicker.js format the time format with H in…
-
2
votes2
answers535
viewsA: Import a list to another Form C#
Some details are missing in the FrmNovoProduto 1 - The list does not need to have the modifier static (in that context would not be valid) 2 - No Construtor FrmNovoProduto missing put the kind that…