Posts by novic • 35,673 points
1,265 posts
-
1
votes1
answer222
viewsA: Take json element with PHP
The last BUSCA_BIN is a array, example: var_dump($json->resultado->BUSCA_BIN->BUSCA_BIN[0]->ITEM_ID); Reference: PHP - array…
-
3
votes1
answer889
viewsA: Laravel 5.4 - Update in related tables
Load the $servico, update the fields, navigate the relation cliente() and updates the Cliente of the relationship of Servico: $servico = Servico::find($id) // busca o serviço if ($servico) //…
-
1
votes1
answer1104
viewsA: How to set up remote database in Laravel 5.4
Configure your file .env: DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=banco DB_USERNAME=root DB_PASSWORD= DB_CONNECTION1=mysql_gps DB_HOST1=192.168.1.125 DB_PORT1=3306…
-
1
votes2
answers78
viewsA: What is the correct way to send a form to a controller via AJAX?
From what I can tell, there’s an item in the way viewModel, I believe you should do this: Change this var formData = $('form').serialize(); $.ajax({ url: '/configuracaocomercial/Create', type:…
-
4
votes2
answers3068
viewsA: Convert image to Base64 using Vuejs?
Takes the instance of new Vue by the variable vm, to gain access to imageSrc, then in the method uploadImage, utilize Filereader to load and display the image directly in the tag <img>.…
-
1
votes1
answer135
viewsA: With Treat a string by transforming it into an array
To extract this information, you need to work with 3 functions that are str_replace to remove what is unnecessary and then use explode creating a array through the spaces between the values and with…
-
1
votes1
answer538
viewsA: Toggle using different ng-Style - Angularjs
Your code is missing a lot to make an ideal answer, but I’ll give you a minimal example where it will work for an element like this when you click the square, it will change the style as set in…
-
1
votes1
answer211
viewsA: Set sender name via Resetpasswordnotification
The configuration of the email that is responsible in sending the user the password reset, is in: app/config/mail.php, opens the file and in the configuration key from, change according to your…
-
2
votes3
answers4764
viewsA: Expression within ng-disabled
The directive ng-disabled, if you receive a value false, will release the button if you receive a value true will lock the button, then your logic can be analyzed by a function, which at the end…
-
1
votes2
answers434
viewsA: Remove Orange Result Quotes 5.4
If text comes that elements are separated by comma, use explode to create a array of each element and then you need a array whole use array_map that will apply the function intval in each element of…
-
1
votes1
answer164
viewsA: ERROR creating Unique constraint with two fields in the Laravel request?
The tutorial described here on the site was not correctly observed, in your code is wrong as it is called the validation, because in descricao has to be put user_created, see how the correct call…
-
1
votes4
answers449
viewsA: When the textbox is null, the button will be off
It will depend on the ideal and expected behavior for this, an example, if you don’t want to space blank will have to use string.Isnullorwhitespace, example: private void textBox1_TextChanged(object…
-
1
votes1
answer6582
viewsA: How to put input and label side by side with bootstrap?
Utilize Gridsystem to position its elements, the total of columns are 12, example: <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css"…
-
6
votes1
answer75
viewsA: Is this type of security validation validated? (Varios if verifying if the VALIDATE is true)
Use the filter_input_array and then with in_array and array_values check if there is any value FALSE in values, example: <?php $filters = [ 'hemocomponenteBolsa' => FILTER_VALIDATE_INT,…
-
2
votes1
answer2339
viewsA: How to make a sum of two matrices generating a third in c#?
The result of a sum of an order matrix 2 x 2 is the sum of the corresponding elements of their positions, example: Source:…
-
1
votes1
answer510
viewsA: Search in two tables with codeigniter
To solve your problem is simple, the code below exemplifies what you need to encode: $this->db ->from('compatibilidade') ->join('produto', 'compatibilidade.codigo=produto.codigo')…
-
1
votes2
answers331
viewsA: Print a sum in the view
Let’s go according to the pure SQL execution documentation from Larable that says the return of a DB::select is an array of stdClass, (in the documentation in English: The select method will always…
-
3
votes1
answer12385
viewsA: Datepicker Bootstrap does not work
Debug by browser press F12 console guide to check if there is any Javascript error, because, I just generated a test and it worked, but at the end of this HTML has two Javascript that I have no…
-
1
votes2
answers1527
viewsA: How to treat Queryexception SQLSTATE error[23000]: Integrity Constraint Violation: 1062 Duplicate;
You need to configure your application so that when the request is made the validation of your model, a minimum example with validation: The Model <?php namespace App; use…
-
3
votes1
answer1037
views -
3
votes1
answer2148
views -
0
votes2
answers1762
viewsA: mascara Angularjs
In the ui-Mask the data format is only in the element that in this case is a <input>, in the model is the data without formatting, but, there is a way to recover the formatted value:…
-
6
votes2
answers1485
viewsA: I don’t understand why Empty says the variable is not empty
The right thing would be: @if(isset($aniversario) && $aniversario->count() > 0) because it’s a class collection Collection, and the empty will not have the expected effect, because, it…
-
0
votes1
answer159
views -
2
votes4
answers2092
viewsA: Null values in PHP
To define is with null and to check is with is_null($value); returning a true or false value (boleano) whether or not it is NULL would not indicate the other ways that even work, but, that from time…
-
2
votes2
answers1161
viewsA: How to insert using Sqlbulkcopy with Entityframework
The same connection in the Entity Framework, but that’s not a rule you can make your own, only Sqlbulkcopy requires a Datatable or Idatareader to record the batch of information in a table, one…
-
3
votes1
answer194
viewsA: Specific doubt using ng-repeat at angular
Set the directive ng-show asking if the list of products is greater than zero, example: <div ng-show="products.length > 0" class="header-products"> <h3>Produtos</h3>…
-
8
votes3
answers2851
viewsA: Java repeated letter counter
Separate operations into two methods, one goes count and the other goes show, never do a single thing, in which case first the code has to sweep the entire text and calculate until finished to then…
-
1
votes1
answer59
viewsA: Help with a simple Join
Your models are all off the charts, they’re on namespaces different from the standard and when it happens, it needs to be registered and configured so that the Larable recognize them, honestly I…
-
1
votes2
answers477
viewsA: number of days of the week per month
function weekOfMonthWithWeek($date) { list($y, $m, $d) = explode('-', $date); $weeks = array(); $s = date('w', strtotime("{$y}-{$m}-01")); $t = date('t', strtotime("{$y}-{$m}-01")); $c = 0; $i = 1;…
-
1
votes1
answer44
viewsA: XML query with Linq
In the original file failed to close some items of xml, and this one stayed like this: <?xml version="1.0" encoding="utf-8" ?> <RetNfseEasyWs xmlns:xsd="http://www.w3.org/2001/XMLSchema"…
-
1
votes1
answer787
viewsA: Insert Many To Many Laravel 5.4
When you’re in a relationship many for many with the eloquent and uses the method attach to add items in the temp table do not need to pass in your specific case the code of the category key, as it…
-
1
votes1
answer156
viewsA: Belongstomany Laravel 5.4 Class 'Department::class' not found
The correct is without the single quotes in this case where Departamento::class signifies that the fully qualified class name will be obtained and remember that this command works from the version…
-
0
votes3
answers66
viewsA: Modify element through Javascript and "warn" page that element has been modified
Right after the textarea change use the method Trigger, and call the event you need in case change, example: $(document).ready(function(){ $("#myTextarea").change(function(){ alert("text area…
-
2
votes1
answer316
viewsA: Obtain Multidimensional Array (codeigniter) data?
The work is a bit confusing at first, but, rewarding when you have an expected result, you need to use optimized mechanisms so that this assembly does not get low performance and does not access too…
codeigniteranswered novic 35,673 -
1
votes1
answer282
viewsA: How to get a specific Json/XML object?
There are some ways to work so hard with json and with xml, examples: To Xml: [Serializable, XmlRoot("api")] public class RootObject { [System.Xml.Serialization.XmlAttribute("batchcomplete")] public…
-
0
votes1
answer2544
viewsA: How to call an Ajax controller method using MVC5 in visual studio?
Change the return to Jsonresult in your method of controller and use Json() to format this data, example: Javascript: $("#icon-cep").click(function() { var cep = $(".cep").val(); console.log(cep);…
-
1
votes1
answer108
viewsA: Where Dinâmico no Linq to Entities
Also use a expression to define the filter of this search and that has to do with the sort, example: public TransportadorasGrid ObterTransportadorasBusca(Int32 PageNumber, Int32 PageSize, String…
-
4
votes1
answer4164
viewsA: Problems with angular-input-masks?
To function correctly use this address: https://assisrafael.github.io/angular-input-masks/javascripts/masks.js which is already the file with everything you need to perform these masks on Angularjs…
-
1
votes1
answer2276
viewsA: What’s the difference between SOAP and Nusoap?
The error message: Nusoap "SOAP-ENV: Xml was Empty, didn’t parse" Message has an apparent solution for this message which is to add an extra element to this part: $HTTP_RAW_POST_DATA =…
-
0
votes2
answers1345
viewsA: How to make a text box appear when selecting a select option
For Document.getElementById("id_do_elemento").style.visibility, where the setting value can vary as described in table below:…
-
4
votes1
answer4875
viewsA: How to make specific sql queries using Laravel?
How could I make that appointment at Laravel? I will try to answer with some solutions: SQL SELECT * FROM membros WHERE day(dataNasc) = day(CURRENT_DATE) and month(dataNasc) = month(CURRENT_DATE);…
-
0
votes1
answer3200
viewsA: Creating a message of success when able to perform an action LARAVEL 5.4
There are several ways to make a status, in my view yours is wrong, including because your test in the if does not correctly test the variables and could be done for example as follows: Create a…
-
1
votes1
answer289
viewsA: Pick up items from shopping cart with PHP
To search for specific fields you first need to find out how many items this has array which characterize the part of the keys, for example, the code first checks with preg_grep how many items have…
-
1
votes3
answers866
viewsA: print value of a given array with PHP
To print only the field product_price who is in a array of objects make a foreach, example: $items = array(); // esse array é do pergunta foreach($items as $item) { echo $item->product_price; }…
-
3
votes1
answer37
viewsA: Problems with php PDO
To return all items of a query sql use the method fetchAll(), because only put fetch() is to return only one item of the result, usually in the search of data of 1 customer, data of a purchase,…
-
2
votes1
answer99
viewsA: PHP and json how to print?
Use the function json_decode: json_decode( string $string, bool $assoc_array = false ) Minimal example $json =…
-
2
votes1
answer1087
viewsA: Laravel 5.4 - Send e-mail with text attached?
Step by step create a text file and send via email to Larable is: Step 1: First thing is to configure the Filesystem of the briefcase storage with the command: php artisan storage:link this will…
-
1
votes2
answers50
viewsA: Open window 1 single time
Put a control variable with the name of status, example: <script> var status = 0; document.onclick = function( e ) { myFunction(); } function myFunction() { if (status == 0) {…
-
1
votes1
answer216
viewsA: Controller exists but Lumen says it does not exist
In addition to the route observation which should be so: $app->group(['prefix' => 'api/v1'], function($app) { $app->get('communities', 'CommunitiesController@index'); } lack the inheritance…