Posts by Sr. André Baill • 6,946 points
384 posts
-
-1
votes1
answer22
viewsQ: Laravel - json_encode() does not work
Bring to Laravel in array format. [compacto] =>…
-
0
votes0
answers11
viewsQ: Canva - Fabric JS - Proportional image inside a container
I need to resize the image with width=100% and height=auto inside the Canvas - Fabric JS. I tried several ways, but without success. jQuery $(document).on('change', '#id_universo_imagem',…
-
-1
votes0
answers15
viewsQ: Icon fa-aligned icons
I have a question: When listing this menu, the arrow icon (Angle) is on the left side, but I wanted it to be on the right side. I tried some alignments but without success. How could I do it? I can…
cssasked Sr. André Baill 6,946 -
0
votes0
answers24
viewsQ: Closed cycles in PHP
We create the following function: public function get_ciclo_atual($hoje, $dia_inicial=21, $dia_final=20){ $ciclo = array(); if(date("d", strtotime($hoje)) >= $dia_inicial){ $ciclo[0] = date("Y",…
-
0
votes1
answer22
viewsQ: View in SQL ERROR
I’m trying to ride a SQL to use in the methodology view. But when executing, it produces an error. I need as a result the amount of items that are in the 'Released' condition and the amount of items…
mysqlasked Sr. André Baill 6,946 -
0
votes1
answer39
viewsQ: Error importing multiple XML files - Codeigniter PHP
I’m trying to import files xml into the database. In this example, I would have 2 arches xml to import. Note: XML is a road transport CTS. I tried to do it this way: $i = 1; $TotalArquivos =…
-
0
votes1
answer31
viewsQ: Limit in Laravel 7
I’m with the following Query in Laravel 7. $itens_carros_melhores_ofertas = Veiculo::where('status', 1) ->orderBy('ano', 'DESC') ->limit(6,9) ->get(); The problem: I need to display the…
-
0
votes1
answer31
viewsQ: Case & When in Select
SELECT c2.quantidade AS qtde_solicitada, IF ( ( SUM(c1.quantidade) - c2.quantidade ) < 0, '0', c2.quantidade ) AS estoque, ( SELECT SUM(quantidade_autorizada) FROM ferramental_requisicao WHERE…
mysqlasked Sr. André Baill 6,946 -
-1
votes1
answer28
viewsQ: Creating view in Mysql
I have a structure for view in the database. And when executing, the error is that c3.nome does not exist. But exists in the database, I believe it is on account of subquery. How to proceed? SELECT…
-
-2
votes1
answer96
viewsQ: Format decimal places in PHP
I have a payment module where I must pass the data without decimals, only number. Examples: 1000 = 10.00 10030 = 100.30 100000 = 1000.00 I researched some function in php that format decimal places,…
phpasked Sr. André Baill 6,946 -
1
votes1
answer21
viewsQ: Laravel: Display Row() instead of result()
I’m wearing the Laravel 7.3. I have the following appointment: $data = DB::table(self::TABLE_CATEGORIES) ->select('id') ->where('slug', $slug) ->get(); And the result would be this:…
-
-3
votes2
answers36
viewsQ: Calculate broken numbers
I own this section, but on the console it appears 64, not 64.9. How I can add in the right way? var carga_adicional = parseFloat('25,00'); var carga_parceiro = parseFloat('39,90'); var adicionais =…
javascriptasked Sr. André Baill 6,946 -
0
votes1
answer108
viewsQ: jQuery Form Serialize does not work
I got the following jQuery function doPay(event){ console.log('submetendo pagamento....'); event.preventDefault(); if(!doSubmit){ var $form = document.querySelector('#pay'); console.log('criando…
jqueryasked Sr. André Baill 6,946 -
0
votes1
answer58
viewsQ: Input mask does not work in dynamic fields
I’m using the library mask to format values, percentages, etc. I have a field carga_imposto (type %), and other carga_valor (type 0.00), which can be added dynamically via jquery. To add, it works…
jqueryasked Sr. André Baill 6,946 -
3
votes2
answers156
viewsQ: Check if automatically filled field is "True" jQuery
I have the following fields <input type="text" value="" name="campo" id="campo"> <input type="text" value="" name="campoRecebeDados" id="campoRecebeDados"> And the next jQuery:…
jqueryasked Sr. André Baill 6,946 -
0
votes2
answers122
viewsA: Delete data from 3 different tables (Codeigniter)
I’d do it this way function deleteImage($id){ $this->db->where('idImagem', $id); $delete_tbdsubcategoria = $this->db->delete('tbdsubcategoria'); $this->db->where('idImagem', $id);…
-
0
votes1
answer258
viewsQ: Return last field included jQuery
I have a value field with the class called .amount-debit, I automatically sum up everything that belongs to that class. How fields are included dynamically, how I could only fetch the value of the…
jqueryasked Sr. André Baill 6,946 -
-1
votes3
answers51
viewsQ: Add values of fields in jQuery
I have the following HTML <legend>Credits</legend> <div id="credit-after"> <div class="form-group"> <div class="col-md-3"> <div class="form-group">…
jqueryasked Sr. André Baill 6,946 -
-1
votes1
answer109
viewsQ: Apply maskMoney to dynamically added fields
I have a form where I add valor, data, detalhes_transacao, however, these fields are added dynamically through a javascript. The problem is that the value mask (maskMoney) works only in the first…
maskmoneyasked Sr. André Baill 6,946 -
0
votes0
answers143
viewsQ: Align div to equal CSS sizes
I have the following CSS: .your-account-main-menu li { display: inline-block !important; padding: 15px; width: 12%; border: solid 1px #EDEDED; } And the following structure <ul…
cssasked Sr. André Baill 6,946 -
0
votes1
answer55
viewsA: Sum of values of a column in PHP
You can also do as follows: <thead> <tr> <th>ID</th> <th>Valor</th> </tr> </thead> <tbody> <?php include_once('conexao.php'); $sql =…
-
0
votes2
answers274
viewsA: Codeigniter does not find Controller
If you are using CI 3, you need to set (on some servers), your controller both the file name, and the controller name with uppercase letter. Class Administrador extends CI { function index(){ return…
-
0
votes1
answer23
viewsA: Distinct tables in Codeigniter
In your model, you can do it this way: function get_lista(){ $this->db->select('concendente.nome as nome_concedente, aluno.nome as nome_aluno, tabela.*'); $this->db->join('concendente',…
codeigniter-3answered Sr. André Baill 6,946 -
2
votes1
answer79
viewsA: change line color
But following your ideology, you can do it this way: <table> <tr> <td>ID</td> <td>Nome</td> <td>Email</td> <td>Status</td> </tr>…
phpanswered Sr. André Baill 6,946 -
0
votes1
answer81
viewsQ: Return PHP categories/subcategories records
I have the following structure of tables and records: CREATE TABLE IF NOT EXISTS `produto` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_categoria` text, `titulo` text, `referencia` text, `valor`…
-
1
votes2
answers67
viewsA: Placing data in the same column (table) HTML5
In this passage: <thead> <tr> <th class="title">Pacientes</th> <th class="title">Como estou?</th> <th class="title">Administrar Paciente</th>…
-
0
votes1
answer25
viewsA: I would like to know how to list data in different bootstrap tables using Codeigniter
This way you’ve crafted it, it won’t work. There’s also an error regarding your controller. If you are working with MVC, I believe that you should insert the registry return Function within the…
-
0
votes2
answers64
viewsA: Phpmailer works on a project created without a framework but does not work with a project created with Codeigniter
You can elaborate that way: In your controller, that would then be the form Submit or the submission itself: function enviar_email(){ # Envia e-mail com cópia para o e-mail do usuário…
-
1
votes1
answer92
viewsQ: Group SQL PHP data with sum of records
I have the following appointment: $this->db->select('tbl_supplier.supplier_name, tbl_order_details.*'); $this->db->join("tbl_supplier",…
-
1
votes1
answer133
viewsQ: Category and subcategory in PHP listing
I have the following function: public function listar($tipo=null){ $this->db->select('p1.*, p2.titulo as subcategoria, p2.id as id2'); $this->db->join("produto_categoria as p2",…
-
0
votes1
answer42
viewsQ: Deduct quantity within a PHP loop
I got the following Array(): Array ( [0] => stdClass Object ( [inventory_id] => 1 [product_id] => 1 [order_id] => 0 [product_quantity] => 15 <-------- [notify_quantity] => 1…
-
0
votes1
answer200
viewsA: Problem with mPDF and Codeigniter
All you have to do is change: $mpdf->m_pdf->pdf->SetTitle('My Title'); To $this->m_pdf->pdf->SetTitle('My Title');
-
0
votes1
answer51
viewsA: Picking multiple fields from a column in mysql and splitting into arrays
Try it this way: <?php foreach($oss_list as $cat_edit){ $descricao = explode('|', $cat_edit['descricao']); ?> <tr> <td><input type="text" class="form-control cod" id="cod"…
phpanswered Sr. André Baill 6,946 -
1
votes2
answers307
viewsA: Mysql - Query in related tables
Try it this way: $where = ""; if(isset($_GET['var_filtro']){ $var_filtro = $_GET['var_filtro']; $var_filtro = explode(",",$var_filtro); if(count($var_filtro)>0){ $where .= "LEFT JOIN tbl2 ON…
-
0
votes1
answer53
viewsA: Pass a variable that is in a javascript file to a $_SESSION and pick up a php page
What I would do is this... if(compararHora(time_format,split[0])){ var ndate = now.getDate (); var nmonth = monName[now.getMonth()]; var nday = dayName[now.getDay()]; var nhour = split[0]; $.ajax({…
-
2
votes1
answer54
viewsQ: Return only a part of the PHP variable
I have the following variable: $imagem = "D:\Web\data\localweb\sites\site.com.br\crm\748064485.jpg"; I need to return only 748064485.jpg, however, I do not want and I do not have how to use the…
phpasked Sr. André Baill 6,946 -
1
votes2
answers197
viewsA: How to receive an array of results in a variable
In this case, if you are going to select which users you selected without seeing your full view, I would do so: // controller public function index(){…
-
0
votes1
answer208
viewsQ: Automatically select <option> with click/select action
I have the following form: <table id="products_stock" class="table"> <thead> <tr> <th class="active">Produto</th> <th class="active">Categoria</th> <th…
jqueryasked Sr. André Baill 6,946 -
5
votes1
answer181
viewsQ: Return date reversed in PHP
I am preparing a report based on the initial date (start_date) and final date (end_date). My return from filter comes through the POST, if I use then print_r($_POST), I note that the date comes in…
-
0
votes0
answers218
viewsQ: Random Numbers 0.9
I am developing a numeric keyboard, however, when printing the variable num, the numbers get repeated, I’m trying to make them random. <?php for($i=0; $i<=9; $i++){ $num = rand(0,9) ?>…
phpasked Sr. André Baill 6,946 -
0
votes1
answer471
viewsQ: Calculate and sum values in jQuery
I have the following loop: <?php foreach($order_details as $v_order): ?> <?php $others_price = $v_order->others_price; ?> <?php $adicional = ($v_order->others_price *…
-
3
votes3
answers89
viewsQ: Add values to total - SQL
I have the following query SELECT sum(tbl_purchase_product.sub_total) as sub_total FROM (`tbl_purchase_product`) WHERE `tbl_purchase_product`.`purchase_id` = '3' I have a field called others_price,…
sqlasked Sr. André Baill 6,946 -
0
votes1
answer27
viewsQ: Apply number_format in variable
I got the following: $_POST['stock_unity_push'] = "R$ 0,25"; $stock_unity_push = str_replace(".", "", str_replace("R$ ", "", $_POST['stock_unity_push'])); I need to turn this result to 0.25.…
phpasked Sr. André Baill 6,946 -
0
votes1
answer29
viewsQ: Insert records Cart codeigniter
I have the following PHP if($this->input->post('stock_unity_push')=='0'){ $stock_unity_push = 0; } else { $stock_unity_push = str_replace(".", "", str_replace("R$ ", "",…
codeigniterasked Sr. André Baill 6,946 -
0
votes2
answers793
viewsQ: Add data to array() in PHP
I’m developing a PHP cart, however, when adding items to the array, I’m not getting it, I tried it as follows: if($this->session->userdata('cart')==true){…
-
0
votes1
answer949
viewsQ: Format currency in jQuery
I have the following HTML <table id="products_stock" class="table"> <thead > <tr> <th class="active">Produto</th> <th class="active">Categoria</th> <th…
jqueryasked Sr. André Baill 6,946 -
0
votes2
answers173
viewsA: Check if a registered user in the bank has already registered Cpf
You can do it this way: // Controller public function check_cpf_doctor() { $check_result = $this->Doctor_model->checkCPFDoctor($this->input->post('doctor_id')); if($check_result==1){…
-
2
votes1
answer817
viewsQ: Calculate values in jQuery
I have three camps: <input type="number" id="product_quantity" name="product_quantity" placeholder="Quantidade"> <input type="text" id="buying_price" name="buying_price" placeholder="Valor…
jqueryasked Sr. André Baill 6,946 -
0
votes1
answer758
viewsA: Foreach in an HTML table - PHP - CODEIGNITER
You must do it this way: <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example"> <thead> <tr> <th>Nome</th>…
-
1
votes2
answers80
viewsQ: Div is not aligning CSS
I need to align this div that is misaligned as the image below: Note: I want to line up side by side, because the top div is misaligned, because of the larger text - I’m wearing a bootstrap. CSS:…