Posts by Sr. André Baill • 6,946 points
384 posts
-
2
votes2
answers258
viewsA: Control of the appearance of modal
You can do it this way: Janela Modal <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div…
-
1
votes1
answer75
viewsQ: Division of listed records into PHP Batches
I have a list of 37 items, returning in the form of a database array as follows: SELECT * FROM tabela WHERE id = '5'; In this listing, I have a dividend: $total = 37; // quantidade retornada do…
phpasked Sr. André Baill 6,946 -
1
votes1
answer504
viewsQ: Retrieve data fields array() jQuery
I have the following fields in array(): <form enctype="multipart/form-data" id="enviar" method="post"> <table class="table" style="border-top: 1px solid #FFF !important;"> <tr>…
jqueryasked Sr. André Baill 6,946 -
0
votes1
answer1087
viewsQ: Pass variable via GET URL jQuery
I got the following jQuery $(".quantidade_lotes").change(function() { var quantidade_linhas = $("#quantidade_linhas").val(); var quantidade_lotes = $(".quantidade_lotes").val(); var mensagem =…
-
-1
votes2
answers79
viewsQ: Show items in jQuery, using internal loop
I got the following jQuery: $(".quantidade_lotes").change(function() { var quantidade_linhas = $("#quantidade_linhas").val(); var quantidade_lotes = $(".quantidade_lotes").val(); var…
jqueryasked Sr. André Baill 6,946 -
3
votes1
answer7371
viewsQ: Round up values jQuery
I got the following jQuery: $(".quantidade_lotes").change(function() { var quantidade_linhas = $("#quantidade_linhas").val(); var quantidade_lotes = $(".quantidade_lotes").val(); var…
-
0
votes2
answers59
viewsA: How to make the site perform a code withdrawal with a particular user?
Usually, when we develop a login system, we register the id of the user who is logged in, which would be correct for you to do. In this case, as you make the user comparison, being user test, you…
-
2
votes1
answer307
viewsA: Session is destroyed after redirect in Codeigniter 3
Try it this way: $logar = $this->login->logar($this->input->('usuario'), $this->input->post('senha')); if($logar){ $this->session->set_userdata('logado', "OK");…
-
1
votes2
answers203
viewsQ: jQuery - Select option and return values
I have the following form: <div class="form-group"> <label for="sms_mensagem" class="col-sm-2 control-label">Mensagem Pré Definida</label> <div class="col-sm-10"> <select…
jqueryasked Sr. André Baill 6,946 -
0
votes3
answers850
viewsQ: Remove field Hidden jQuery
I have the following form: <button type="button" id="remover<? echo $valor->int_cod; ?>" idProspect="<? echo $valor->int_cod; ?>" value="<? echo $valor->int_cod; ?>"…
jqueryasked Sr. André Baill 6,946 -
1
votes2
answers397
viewsQ: Sort according to database | PHP
I have the following structure: I have 3 types of classification, following the coherence: 1.0.0, 1.1.0, 1.1.1, 1.1.2 - I have to display in front of the titles, each content that belongs to its…
-
3
votes1
answer536
viewsQ: Multi connections Mysql Codeigniter
In my.php database I created two connections: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $active_group = 'default'; $active_record = TRUE;…
-
1
votes0
answers161
viewsQ: mPDF - Generate PDF with cover and contents
I need to generate a PDF with cover, back cover and content. I’m searching the database for the name of the backgrounds and content. So far, so good. I did the following procedure: First I searched…
mpdfasked Sr. André Baill 6,946 -
1
votes1
answer228
viewsA: PHP/Mysql - Print values with relation between tables
You can design only one SQL, using JOIN to join the tables based on id_lata, in this case, you will be able to obtain the results of each of the tables, and also to distinguish one column from the…
-
0
votes2
answers539
viewsQ: Return records Timestamp() field
I have a table called interessados, in it have int_data this field is timestamp(), I have 5 records with the following dates: 2016-09-01 10:15:00 2016-09-01 10:50:00 2016-09-01 18:35:00 2016-09-01…
sqlasked Sr. André Baill 6,946 -
-1
votes1
answer4820
viewsQ: Run a cron Cpanel URL
I need to run a URL at 19:00 every day. I tried using Cpanel’s cron job, but the url is not executed. curl -s -o /dev/null http://minhaurl.com.br/index.php/sms/enviodiario What would be wrong?…
-
6
votes2
answers21084
viewsQ: Brazilian Time Zone in Mysql
I have a Mysql database table called registros. In it, I then have the following structure: id_registro, nome_registro, data_registro. In data_registro i am using the current_timestamp(), searching…
-
6
votes1
answer233
viewsQ: Define id of the php array()
I have the following array() Array ( [camposdb] => Array ( [51] => Array ( [0] => cpf_cnpj [1] => nome_razaosocial [2] => cod_cliente [3] => cod_contrato [4] => mensagem [5]…
-
3
votes2
answers458
viewsQ: Search for next 7 days records in SQL
I have the following SQL SELECT `age`.*, `inte`.`int_nome`, `inte`.`int_cod_unidade`, `set_uni`.`uni_titulo` as set_unidade, `set_cur`.`cur_titulo` as set_curso, `set_sta`.`set_setor` as set_status,…
sqlasked Sr. André Baill 6,946 -
0
votes0
answers39
viewsQ: Undefined jQuery passing via button
I’m trying to pass the cod_historico via jQuery, inside a button, which will open a modal, to search internal views of a specific content. I’m generating a list coming with database records:…
-
3
votes2
answers150
viewsQ: Retrieve PHP data within a text
I have the following text:: $texto = "Olá {cliente}, seja bem vindo ao site {site}! Aqui você terá acesso as seguintes opções: {opcoes} Estes dados foram gerados automaticamente em {data} Pela…
-
1
votes0
answers56
viewsQ: Search for MAC in PHP
I need to filter the type of access that will be done inside the system, can access only from a specific computer, with random IP. Is there any way to search in PHP or jQuery, or any other language…
-
3
votes5
answers426
viewsA: Explodes with name indexes (associative)
You can do it using a array() $user = "Diego:25:RJ"; $info = explode(":",$user); echo "O nome é ".$info[0]; $infoArr = array('nome'=>$info[0], 'idade'=>$info[1], 'estado'=>$info[2]);…
phpanswered Sr. André Baill 6,946 -
1
votes1
answer217
viewsQ: Move div to another div and update database
I own the following jQuery $(function() { $( "#sortable1, #sortable2, #sortable3, #sortable4, #sortable5, #sortable6").sortable({ connectWith: ".connectedSortable", receive: function( event, ui ){…
-
0
votes1
answer93
viewsQ: Show successful dragging component message with jQuery UI
I got the following jQuery: $(function() { $( "#sortable1, #sortable2, #sortable3, #sortable4, #sortable5, #sortable6").sortable({ connectWith: ".connectedSortable" }).disableSelection(); }); This…
-
1
votes0
answers214
viewsQ: Like dragging Div to another column?
In the Below image, I have several columns where the user can drag the div and put it in another column, as illustrated in the image: I’m using Sortable of Jquery-UI. I can drag this div to the…
-
0
votes1
answer449
viewsA: How to get data from two different tables?
You can do it this way: SELECT * FROM tabela1 as t1 LEFT JOIN tabela2 as t2 USING(id) This way, you take everything from the two tables, but you can also specify what you want to search for: SELECT…
phpanswered Sr. André Baill 6,946 -
2
votes1
answer591
viewsA: How to redirect the Subdomain directory?
Create a file called index php. and put it at the root of /forum In this file, we will use the command header to redirect as below. <?php header("Location: http://scavenge.forumeiros.com"); ?>…
phpanswered Sr. André Baill 6,946 -
1
votes1
answer228
viewsA: Format number from 3200 to 3,200 with PHP
You can elaborate as follows: function formata_valor($valor){ if($valor!=NULL){ echo number_format($valor, 0, ',', '.'); } else { echo "Nenhum valor foi preenchido."; } } echo…
-
-3
votes1
answer881
viewsQ: Return of duplicated SQL results
I have the following SQL SELECT `inte`.`int_nome`, `age`.*, `con_at`.`con_nome` as consultora_que_atendeu, `con_ag`.`con_nome` as consultora_que_agendou FROM (`agendamentos` as age) JOIN…
sqlasked Sr. André Baill 6,946 -
7
votes3
answers1514
viewsQ: Search between dates with between
I have the following research: SELECT * FROM (`agendamentos`) WHERE `age_data_agendado_para` BETWEEN "2016-08-28" and "2016-08-30" In the database, I have: But on my return, I can only search for…
sqlasked Sr. André Baill 6,946 -
0
votes0
answers408
viewsQ: mPDF horizontal - PHP
I need to generate a report PDF, with the following specifications: $this->load->helper('mpdf'); $html = $this->load->view('relatorio/interessados_relatorio_impressao', $data=NULL,…
-
3
votes2
answers7685
viewsQ: Return correct php strtotime date
I have the following line echo date('Y-m-d', strtotime("28/09/2016")); // 1970-01-01 How do I return 2016-09-28? If the day is less than 12, returns...
-
1
votes3
answers614
viewsQ: jQuery check php database field
I have the following button: <button type="submit" class="btn btn-info pull-right"><? echo $titulo; ?></button> This button sends a form action, with the completed data. And I also…
-
2
votes3
answers8116
viewsA: How to join 2 tables in a select?
You can elaborate as follows: SELECT pp.id, pp.id_pedido as id_pedido_pedido, pt.ltd as quantidade FROM produtos_pedido as pp JOIN produtos_troca as pt USING(id_produto) When you do the foreach()…
mysqlanswered Sr. André Baill 6,946 -
1
votes1
answer30
viewsQ: Field set_base NULL > SQL compliant
Reference issue: Delete sectors and their descendants - PHP I have the following SQL: CREATE TABLE IF NOT EXISTS `setores` ( `set_cod` int(10) NOT NULL AUTO_INCREMENT, `set_base` int(10) NOT NULL,…
sqlasked Sr. André Baill 6,946 -
3
votes1
answer78
viewsA: Format in R$ rescued values with SUM
You can do it using the php function number_format: Ref: http://php.net/manual/en/function.number-format.php function formatar_valor($valor){ return number_format($valor, 2, '.', ''); } include…
phpanswered Sr. André Baill 6,946 -
5
votes3
answers45
viewsA: & Error inside mysql query
You can do it this way: $Dias = "Segundas & Terças"; $sql = mysqli_query($con,"SELECT * FROM semana WHERE Dias = '".$Dias."'"); Passing the variable before.…
-
3
votes2
answers100
viewsQ: Delete sectors and their descendants - PHP
I have the following structure table: CREATE TABLE IF NOT EXISTS `setores` ( `set_cod` int(10) NOT NULL AUTO_INCREMENT, `set_base` int(10) NOT NULL, `set_setor` varchar(50) NOT NULL, `set_data`…
-
1
votes2
answers1158
viewsQ: Take data from the button in jQuery and call Modal
I have the following button: <button type="button" class="btn btn-danger btn-custom" name="deletar" id="<? echo $valor->set_cod; ?>"><i class="fa…
jqueryasked Sr. André Baill 6,946 -
1
votes2
answers1766
viewsA: Show result of a query in html - PHP+Codeigniter.
You can build your function as follows # Consulta $this->db->where("id_entidade", $this->session->userdata('id_entidade')); $results = $this->db->get('entidade')->result(); #…
-
0
votes5
answers1390
viewsA: Page redirection according to access country
You can also use this alternative by redirecting to default or language, if available. echo $_SERVER['HTTP_ACCEPT_LANGUAGE']; // pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4,gl;q=0.2 $arrlang = explode(',',…
-
2
votes1
answer256
viewsA: Add value to database
Controller $this->estoque->do_update($_POST, $this->input->post('id_produto')); In the model: public function do_update($dados=NULL, $id=NULL, $redir=TRUE){ if ($dados != NULL &&…
-
0
votes1
answer72
viewsQ: Change site via . htaccess
I have the following urls: www.meusite.com.br/pagina1 www.meusite.com.br/pagina1/a/b/c www.meusite.com.br/pagina1/1/2/nome-perfil I need that when accessing my site, I have a redirection in htaccess…
htaccessasked Sr. André Baill 6,946 -
0
votes2
answers73
viewsQ: Random Array between Specific Values
I would like to elaborate an array() where I can put: $arr = "argument1, argument2, argument3." ; And return only 1, 2 or 3, randomly. How can it be done?
phpasked Sr. André Baill 6,946 -
1
votes1
answer621
viewsA: Session PHP does not work
Change this excerpt: $_SESSION["a"] = $_GET["nome"]; $_SESSION["b"] = $_GET["email"]; $_SESSION["c"] = $_GET["telefone"]; $nome[] = $_SESSION["a"]; $email[] = $_SESSION["b"]; $telefone[] =…
-
0
votes3
answers98
viewsA: Why are you making these mistakes? #Registration forms
Some errors happen when creating and submitting the form, below is a basic solution that can help you: HTML <html><title>Cadastre-se</title> <meta charset="UNICODE"/>…
-
2
votes1
answer472
viewsA: Check if email already exists with codeigniter
I thought of the following solution: $this->db->select('email'); $this->db->where('email', $this->input->post('email')); $retorno = $this->db->get('usuario')->num_rows();…
-
1
votes2
answers1238
viewsQ: Menu in two CSS columns
I have a CSS bootstrap structure. This menu it stays this way: I would like to divide into two columns, how could I do? There has been no change of normal bootstrap menu structure. Follow the menu…
-
2
votes1
answer30
viewsA: Run file instead of redirect
I found a solution, I leave it on record to whom to serve! $(".enviar_email").on("click", function(evt) { $.ajax({ url: "<? echo base_url('boleto/email/'); ?>/" + cliente + "/" + datainicial +…