Posts by Sr. André Baill • 6,946 points
384 posts
-
1
votes1
answer35
viewsA: WHERE IT EXPLODES
You can elaborate as follows: $var = "5100/5101/5102"; $var = str_replace("/", ",", $var); $consulta = "SELECT * FROM tabela WHERE campo IN ('$var')"; Using the WHERE field IN, you can return the…
phpanswered Sr. André Baill 6,946 -
2
votes1
answer332
viewsQ: How to standardize vertical box size with CSS?
I have the following CSS: .course-content { padding-top: 22px; padding-bottom: 30px; } Inside the PHP loop, I search the database records. Stay that way: With this, I noticed that it got different…
cssasked Sr. André Baill 6,946 -
0
votes1
answer36
viewsQ: Join SQL Tables
I have two tables: curso curso_configurar With the following structure: My question is: I need to include within the curso_configurar, the courses that will be configured, until there is OK.…
sqlasked Sr. André Baill 6,946 -
1
votes1
answer425
viewsQ: Apply jQuery mask to Modal
I have the following modal: <div class="modal fade" id="anti_fraude_modal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> <div class="modal-dialog"…
jqueryasked Sr. André Baill 6,946 -
1
votes1
answer28
viewsQ: Calculate using jQuery filled fields
I have the following fields: moeda, taxa_compra, taxa_venda, valor_reais, valor_total I need you, when filling in the sales fee, to calculate: taxa_venda / valor_reais e represente o total no…
jqueryasked Sr. André Baill 6,946 -
1
votes2
answers181
viewsA: Generate multiple records in Mysql
As we have the post we received from the form, with the grupo, we’ll do the following: // Seleciono tudo que envolve o grupo = 10. $this->db->where('grupo', $this->input->post('grupo'));…
-
1
votes2
answers21
viewsQ: Swap Tag for another SQL Tag
I have the following email: [email protected], I need to change everything I have meusite.com.br for seusite.com.br. How can I do? My idea was: UPDATE tabela SET email = email "seusite.com.br"..…
sqlasked Sr. André Baill 6,946 -
2
votes2
answers9062
viewsQ: Concatenate text to an existing SQL column
I got the following SQL: UPDATE tabela SET peso = peso "KG" I need to add to the weight field, the tag KG, But if I do it the way I put it, it doesn’t work. How could I do it?…
sqlasked Sr. André Baill 6,946 -
1
votes1
answer128
viewsQ: Adjust icone CSS form
I have the following form However, the H3 icon, from above, was OK, only the next titles I put, are on the side of the form, how to do to adjust? HTML: <h3 class="titulos_cadastro"><i…
-
0
votes1
answer123
viewsQ: Filter numbers in PHP
I have the following phone in the database: (45) 9 9874-4700 Is there any function that I leave only NUMBERS? regardless of which character is in the middle of the tag?
phpasked Sr. André Baill 6,946 -
0
votes1
answer260
viewsQ: Run select + update SQL query
I have the following SQL: SELECT prospect.uni_id, prospect.usu_id, prospect.pro_nome, prospect_agendamento.* FROM prospect_agendamento JOIN prospect…
sqlasked Sr. André Baill 6,946 -
1
votes2
answers1993
viewsQ: Checkbox with jQuery Enable and Disable field
I have the following structure: <tr> <td>Modalidade</td> <td><input type="checkbox" name="check_adulto" id="check_adulto"> Adulto(s) <?php echo…
jqueryasked Sr. André Baill 6,946 -
1
votes1
answer4120
viewsQ: Compare PHP date and time
I have the following dates: data atual: 2018-02-11 20:14:40 data expiracao: 2018-02-12 19:57:10 I need to make a comparison between one and the other. if($dados['transacao']->data_expira <=…
phpasked Sr. André Baill 6,946 -
4
votes2
answers4281
viewsA: Sum variables value with foreach
You can do it as follows: Set the variable to 0, initially later, you do the auto sum, using +=. <?php $valortotal = 0; foreach($grupo as $contas){ $valortotal += $contas["valor"]; } ?> Total:…
-
0
votes1
answer142
viewsQ: Insert data into table via PHP Array()
I have the following PHP: # Prospect $sql_prospect = "SELECT * FROM interessados LIMIT 100"; $exe_prospect = mysqli_query($link, $sql_prospect); $i = 0;…
phpasked Sr. André Baill 6,946 -
0
votes1
answer316
viewsQ: Route structure of Codeigniter
I have the following route: $route_pri = $this->uri->segment(1); $route_sec = ($this->uri->segment(2)==true) ? $this->uri->segment(2) : ''; $route_three =…
-
2
votes1
answer1622
viewsQ: Replace text with jQuery asterisk
I have the following field: <input type="number" name="teste_senha"> I need that, when typing some content, this content is replaced by ****, without losing its original content, can be stored…
jqueryasked Sr. André Baill 6,946 -
0
votes2
answers242
viewsQ: Multiple upload to PHP online server
I have the following function to send multiple images: //Diretório onde a imagem será gravada temporariamente $dirToSave = 'assets/uploads/'.$pasta.'/'.$tipo.'/'; if(!is_dir($dirToSave)){ echo "noa…
-
2
votes1
answer456
viewsQ: Return quantity of SQL grouped items
I have the following SQL SELECT `setor`.`set_setor` as age_status_texto, `prospect_agendamento`.`age_status` FROM (`prospect_agendamento`) JOIN `setor` ON…
sqlasked Sr. André Baill 6,946 -
1
votes3
answers1115
viewsA: Filtar Birthday of the day
You can do it this way: SELECT NomeCompleto, Telefone FROM tblcliente WHERE MONTH(DataNascimento) = 5 In this case, using MONTH, We can filter by month. Similarly, we can then do it using YEAR, to…
mysqlanswered Sr. André Baill 6,946 -
1
votes1
answer57
viewsQ: Alert being repeated through . each() ajax
I got the following jQuery: $("#apagar-marcados").click(function(){ var lista_marcados = document.getElementsByName('id_mensagem[]'); $.each(lista_marcados, function(i, item){ if…
jqueryasked Sr. André Baill 6,946 -
2
votes1
answer42
viewsQ: Return Number of Responses PHP Array
I have the following array(): Array ( [0] => stdClass Object ( [men_id] => 3 [usu_id] => 2 [usu_destino] => 2 [id_resposta] => 0 [usu_respondeu] => 0 [set_assunto] => 147…
-
1
votes1
answer54
viewsA: Get name in Select Join
To do this in codeigniter, just use JOIN in your data return function, as follows: public function get_devedor_contrato(){ $this->db->select("tbl_devedor_contrato.*,…
codeigniteranswered Sr. André Baill 6,946 -
2
votes1
answer61
viewsA: Help with a mysql query
Correct is you use the BETWEEN: $data_inicial = "2017-01-01"; $data_final = "2018-01-01"; SELECT c.dia, c.mes, c.ano, c.id id_pedido, c.total total_pedido, c.tipo, d.cat_id id_prod, SUM(…
mysqlanswered Sr. André Baill 6,946 -
1
votes2
answers2310
viewsA: How do I get back to the form page when sending a message?
Just set up a Location header, the message will be displayed in javascript, after the click (either cancel or OK), it returns to contact.html, as desired. // ENVIO DO EMAIL $enviado =…
-
1
votes1
answer36
viewsA: Help with ajax to send new variable value in emsma page without refresh via radio button
You can elaborate this way, with jquery and search the data via ajax, and list. Page for verification: <table> <tr> <td><input type='radio' name='modo' class='modo'…
-
0
votes1
answer557
viewsA: Edit status of multiple records with checkbox marked?
Do it this way: Create a method called alterarCheckbox, and put the action of your form to this, and upon receiving, will update according to the selected. // Excluir com checkbox public function…
-
2
votes1
answer105
viewsQ: Close <li> by clicking on the next
I have the following ul > li <ul class="list-group no-radius no-border" id="mails-list"> <?php foreach($lista as $valor){ ?> <!-- mail in mails --> <li class="list-group-item…
jqueryasked Sr. André Baill 6,946 -
1
votes1
answer25
viewsQ: Return <andrebaill> result in browser
I have the following answer: <<?php echo $valor->usu_id; ?>> However, it is interpreted by the browser as TAG and not as return. How do I make it return without being a tag? In this…
htmlasked Sr. André Baill 6,946 -
2
votes1
answer195
viewsA: print content from div on another page
Change the print form to be this way, so we will pass via POST, so that we can print in the print file.php <form method="post" action="imprimir.php" enctype="multipart-form/data"> <textarea…
-
0
votes4
answers3559
viewsA: Increment a counter within a php foreach
To play what you imagine, just add one more increment to the foreach(). <?php $i = 0; $j = 0; $tab = 1; foreach ($enderecos as $endereco) { ?> <input type="text" name="endereco[<?php…
-
1
votes2
answers204
viewsQ: Recover jQuery date variables
I have the following button: <button type="button" class="btn btn-default" data-toggle="modal" data-target="#abrir-imagem" data-pasta="interno_fotos" data-imagem="139379939.jpg">Abrir…
jqueryasked Sr. André Baill 6,946 -
0
votes0
answers77
viewsQ: Group tables and return to json
I have this function that returns the data to Ajax: public function get_agenda(){ $this->db->select('prospect_agendamento.age_data_agendado_para as start, prospect.pro_nome as title,…
-
1
votes2
answers117
viewsQ: Check and uncheck Checkbox items
I have the following form: <div class="dia" id="dia" data-id="1"><input id="1" name="diasemana[]" type="checkbox" class="dias_semana" value="1"><label for="1">…
jqueryasked Sr. André Baill 6,946 -
1
votes2
answers250
viewsQ: Align Label with Text
I’d like to line this div up next to each other Getting checkbox - day of the week <div class="dia"><input id="1" name="diasemana[]" type="checkbox" class="dias_semana"…
cssasked Sr. André Baill 6,946 -
1
votes1
answer323
viewsQ: Loop validating days of the week in PHP
I have the following period: 15/10/2017 a 14/11/2017 (with selected option Monday, Tuesday, Wednesday, Thursday and Friday - Saturday and Sunday are inactive) I need, through PHP, to build a loop…
phpasked Sr. André Baill 6,946 -
2
votes2
answers106
viewsQ: Comparison of dates - PHP
I have the following comparison: # Verifica se está em tempo habil para concluir a transacao if($transacao->data_expira <= date("Y-m-d H:i:s")." 000000"){ echo "Ainda é permitido pagar"; }…
phpasked Sr. André Baill 6,946 -
1
votes1
answer346
viewsQ: Modal does not open in the second click
I have the following button: <button class="btn btn-default botao_leitura_biometrica" id="" style='border: solid 1px #666'>Lectura Biométrica</button> This should open a modal: <div…
-
1
votes1
answer1107
viewsQ: Paging datatable with jQuery
I’m using Datatable to render my records. The problem is: I have 15,000 records in a table, it needs to load ALL records first, then mount the pager. How can I manipulate this? First load the limit…
phpasked Sr. André Baill 6,946 -
0
votes4
answers1350
viewsA: Check if id_user is logged in (Session - codeigniter)
In each control, I use it as follows: if($this->session->userdata('logado')==null) redirect('login'); In this case, logged in, is the name of the Ssion you directed. Then the construction…
-
0
votes2
answers110
viewsQ: Mount A-Z listing in PHP
Need to make a form select of A-Z, how can I do this without being manually? In this case, I would do it manually as follows: <select> <option>A</option>…
phpasked Sr. André Baill 6,946 -
0
votes2
answers85
viewsA: Get date-ref from different buttons
We need to analyze that #detail is a unique id. What we can do is as follows: $('#verpedido').on('show.bs.modal', function (e) { let id_pedido = $(".detalha").attr('data-ref'); $.ajax({ url:…
-
1
votes1
answer44
viewsA: Many zeros in the modal
@extends('adminlte::layouts.app') @section('htmlheader_title') Parceiros Lista @stop @section('contentheader_title') @stop @section('contentheader_description') @stop @section('main-content') @php…
-
0
votes2
answers785
viewsA: Confirmation Modal with codeigniter
Do it this way: HTML: <div class="modal fade" id="confirma-deletar" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div…
-
2
votes1
answer223
viewsA: How to join two selects of different tables?
The most correct way in the codeigniter of you to do this, I think, is that it’s the way I’m going to expose it next, using the Join and mounting a subarray() for the expected results: public…
-
1
votes1
answer3251
viewsQ: Add +1d to current php date
I have the following date: $data = date("Y-d-m H:i:s"); I need to create the following date: $data_expira = date("Y-d-m H:i:s"); // adicionando +24h How can I add +1d on current date?…
-
3
votes1
answer47
viewsA: Show results children in parent array in Codeigniter
Elaborate as follows: public function lista_times_jogadores(){ $consulta = $this->db->get('times')->result(); foreach($consulta as &$valor){ $this->db->where('time_id',…
-
2
votes1
answer66
viewsQ: Separate year/month
I have the following date format: 201705 I’d like to put a / between the year and the month. How do I do it?
phpasked Sr. André Baill 6,946 -
0
votes1
answer38
viewsQ: Loop for printing per page
I have a loop: <?php for($i=0; $i<=20; $i++){ ?> <div id=""> <?php echo $i; ?> </div> <?php } ?> I need each of these Divs to appear separately at the time of…
-
-1
votes1
answer28
viewsQ: Adjust currency using PHP
I have the following value: R$ 1,524.33 I need to write to the database in the format: 1524.33 How can I do that?
phpasked Sr. André Baill 6,946