Posts by Sr. André Baill • 6,946 points
384 posts
-
-1
votes1
answer30
viewsQ: Run file instead of redirect
I have the following javascript: $(".enviar_email").click(function(){ $('#myModal').modal('hide'); window.location.href = "<? echo base_url('boleto/email/'); ?>/" + cliente + "/" + datainicial…
-
1
votes0
answers665
viewsQ: Send PDF in Attachment mPDF, phpmailer
I have the following code in PHP: error_reporting(E_ALL ^ E_DEPRECATED); $this->load->helper('mpdf'); $this->data['dadosboleto'] = $this->boleto_model->GerarBoletoCEF($id_cliente,…
-
1
votes0
answers65
viewsQ: Field jQuery mask for mobile/landline phone with ninth digit
I got the following jQuery jQuery(function($){ $("#telefone").mask("(99) 9 9999-9999"); $("#celular").mask("(99) 9 9999-9999"); }); However, when typing the number in the field, if it is a landline…
jqueryasked Sr. André Baill 6,946 -
4
votes1
answer152
viewsA: Redirect login page does not match
<?php session_start(); $servidor = 'localhost'; $usuario = 'root'; $senha = ''; $banco = 'bd_'; // Conecta-se ao banco de dados MySQL $con = new mysqli($servidor, $usuario, $senha, $banco); //…
-
3
votes1
answer2154
viewsA: Check the difference between two dates in months
You can do it this way: $data1 = new DateTime( '2013-12-11' ); $data2 = new DateTime( '1994-04-17' ); $intervalo = $data1->diff( $data2 ); echo "Intervalo é de {$intervalo->y} anos,…
phpanswered Sr. André Baill 6,946 -
8
votes4
answers4010
viewsA:  - This error appears between the <body> and gives space difference
I found a very interesting solution, it’s called boom the file. This php file you can put in the root folder of your site, it is a kind of scan, which in turn accesses all the files and adjusts the…
htmlanswered Sr. André Baill 6,946 -
-1
votes2
answers74
viewsA: Select where the id of a previously selected is fetched
I’d do it that way, see if it helps you: function getAllDisplayable_ing($id=NULL) { $consuta = $this->db->get("lista_ingredientes")->result(); foreach($consulta as &$valor){…
-
0
votes1
answer47
viewsQ: Various functions that will do the same thing
I have the following function function about_about(){ $this->render(); } However, I have another 100 pages, which will only have the render(), how can I do a function just to save code and time?…
-
0
votes0
answers1404
viewsQ: Back to Top jQuery - Uncaught Typeerror: Cannot read Property 'top' of Undefined
I have the script to get back to TOPO. On the home page of the site, it works perfectly, however, on the internal pages it does not go up and presents the following error: Uncaught Typeerror: Cannot…
jqueryasked Sr. André Baill 6,946 -
2
votes1
answer4263
viewsQ: How do I open a submenu just by going over the menu?
I have the following css menu: <div class="collapse navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li class="scroll <? if(!$this->uri->segment(1)) echo "active";…
-
2
votes3
answers804
viewsA: How to know if the database query was successfully performed?
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <form action="" method="GET" > <input type="text"…
-
1
votes1
answer1407
viewsA: How best to use templates in Codeigniter 3
Particularly I like to use that way: public function _site($view) { $this->load->vars($this->dados); $this->load->view('view_topo'); if (is_array($view)) { foreach ($view as $valor) {…
-
0
votes3
answers558
viewsA: List Categories with Subcategories of the same table with another table
SELECT * FROM nw_manuais_tecnicos AS mt LEFT JOIN nw_manuais_tecnicos_categorias as mc USING (id_categoria) GROUP BY mt.id_categoria
-
0
votes3
answers65
viewsA: Help with IF and ELSE at session_start()
<?php session_start(); // Inicia a session. if($_SESSION['logo']==FALSE) { // Se a Session não for iniciada $logo = 'img/logo_tipo.png'; // Carrega esse conteúdo }else{ // Se não $logo =…
phpanswered Sr. André Baill 6,946 -
0
votes1
answer551
viewsQ: Compare fields in jQuery
I need to compare the fields according to the script below: $("#send_request").submit(function(event){ var password = '7c4a8d09ca3762af61e59520943dc26494f8941b';…
jqueryasked Sr. André Baill 6,946 -
0
votes3
answers607
viewsA: check query in 2 tables at the same time with mysql
You can develop as follows: SELECT * FROM cadastro as c JOIN funcionario as f ON (c.id=f.id_cadastro) This way, you can display the data of the other table too, you can put in the * of From, the…
-
3
votes2
answers1508
viewsA: I cannot enter the values in the table with auto_increment in the primary key
Right Way: INSERT INTO Utilizadores (IDUtilizador,PNome,UNome,Email,PalavraPasse,TipoUtilizador) VALUES ('', 'Ruben','Figueiredo','[email protected]','RubenFigueiredo','Cliente'); You need…
-
3
votes2
answers5715
viewsA: Is it possible to call a modal without a click?
You can do it this way: <?php if($acao=="sucesso"){ ?> <script> $(document).ready(function(){ $("#myModal").modal(); }); </script> <? } ?> <div…
bootstrap-3answered Sr. André Baill 6,946 -
0
votes2
answers498
viewsA: Add text to input (virtual keyboard)
In case anyone needs it, I’m posting the complete solution based on the answer from our friend Wesley <div class="controls"> <input id="userpassword" placeholder="Account Password"…
jqueryanswered Sr. André Baill 6,946 -
0
votes1
answer36
viewsQ: Rand() within the for
I have the following condition of FOR: <? for($i=0; $i<=9; $i++){ ?> <input type="button" value="<?=$i?>" name="no" onclick="moveNumbers(this.value)" class="btn btn-default">…
phpasked Sr. André Baill 6,946 -
3
votes2
answers498
viewsQ: Add text to input (virtual keyboard)
I wrote the following script: <input type="password" class="email password_action" placeholder="Account Password" id="user_password" name="user_password" required> <? for($i=0; $i<=9;…
jqueryasked Sr. André Baill 6,946 -
1
votes1
answer48
viewsA: Email appraisal
I needed it and I developed it: jQuery: var email = $("#usuario_email"); email.blur(function() { $.ajax({ url: "/outras/verificaEmail.php", method: "POST", cache: false, data: {"usuario_email":…
-
1
votes2
answers361
viewsA: Float does not work correctly
You can use bootstrap to regulate the dimensions issues, in which case, you use a <div class="container">, all content would be within the correct div... Just give a studied in the…
-
3
votes2
answers1084
viewsQ: Upload Multiple Codeigniter
I have a form for multiple image uploads using codeigniter: <input type="file" name="files[]" id="filer_input2" multiple> And PHP: #configuracoes base $config['upload_path'] = $diretorio;…
-
1
votes2
answers32
viewsA: Add DIV removed in jQuery
I leave here the answer, as commented by the staff, in case someone needs! <select id="selectOption" name="selectOption"> <option>escolha</option> <option…
jqueryanswered Sr. André Baill 6,946 -
1
votes2
answers32
viewsQ: Add DIV removed in jQuery
I made the following condition: jQuery: $( "#selectOption" ).click(function() { var option = $( "#selectOption option:selected" ).val(); if(option!='escolha'){ if(option==2){ $( "#atendimento_a"…
jqueryasked Sr. André Baill 6,946 -
1
votes1
answer61
viewsQ: Return data from a PHP/JQUERY - Unexpected end of input
I have a field called usuario_email, which in turn, the user type the desired email, triggers the jquery to search in the database if this email already exists there, if it exists, returns message…
jqueryasked Sr. André Baill 6,946 -
0
votes1
answer83
viewsQ: Return Date data according to month
I developed the following function: public function get_agendas() { $this->db->select("*, EXTRACT(MONTH FROM data) as mes_referencia, count(id) as total_registros");…
-
3
votes2
answers374
viewsQ: Select and view data with Ajax
I got the following ajax: var id = $('#idCliente').val(); $.ajax( { url:"/Administrar/chamadas/ajax/endereco/" + id, dataType : 'json', success:function(result) {…
-
1
votes2
answers42
viewsA: problems with HTML and PHP + Mysql
I’d do it this way <div class="container"> <div class="col-lg-6 col-md-6 col-sm-12 col-xs-12"> <section class="painel novidades"> <h2>Novidades</h2> <ol> <?php…
-
0
votes3
answers485
viewsA: Error inserting data into Mysql - Codeigniter
You can do it that way: <?php $chave = $retorno->resposta->cobrancasGeradas->cliente->cobranca->chave; $dados['id_fatura'] = $id_fatura; $dados['chave_boleto'] = $chave;…
-
1
votes2
answers2126
viewsA: Pass parameters to Modal in jQuery
I got the solution this way, in case someone needs it too: <script> $(document).ready(function(){ $(".boleto_campo").click(function(){ $("#cliente").val($(this).data('cliente'));…
-
5
votes2
answers2126
viewsQ: Pass parameters to Modal in jQuery
I have the following button: echo '<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-cliente='.$r->idCliente.' data-datainicial='.$_GET['data_inicial'].'…
-
4
votes2
answers1621
viewsQ: mPDF - Error generating PDF | Message: preg_replace():
I’m using mPDF to generate the PDF: $this->load->helper('mpdf'); $this->data['dadosboleto'] = $this->boleto_model->GerarBoletoCEF($id_cliente, $data_inicial, $data_final);…
-
1
votes2
answers1432
viewsA: How to use fonts on my Site?
You can import through Google Webfonts: This is a classic example of application: <html> <head> <link href='http://fonts.googleapis.com/css?family=Reenie+Beanie:regular'…
-
0
votes2
answers940
viewsA: how to make a cart items counter
Alter: for($i = 1; count($_SESSION['carrinho']) > 0; $i++){ To: for($i = 1; $i<=count($_SESSION['carrinho']); $i++){ That way, as long as it is less than or equal to the cart count, it will…
phpanswered Sr. André Baill 6,946 -
1
votes1
answer31
viewsA: Unablex to load your default controller. Please make sure the controller specified in your Routes.php file is Valid. Codeigniter
Incredible as it may seem, I got the solution as follows: Accessing the file system/core/codeigniter.php I looked for the error mentioned: Unablex to load your default controller. Please make sure…
codeigniteranswered Sr. André Baill 6,946 -
3
votes1
answer31
viewsQ: Unablex to load your default controller. Please make sure the controller specified in your Routes.php file is Valid. Codeigniter
This error appears when Load in the Initial method: Unablex to load your default controller. Please make sure the controller specified in your Routes.php file is Valid. And I’m running the project…
codeigniterasked Sr. André Baill 6,946 -
1
votes1
answer202
viewsQ: Fatal error: Call to a Member Function num_rows()
I have the following lines in Codeigniter: Line 217 if ($query->num_rows() == 0) { $this->sess_destroy(); return FALSE; } Displays the following error: Fatal error: Call to a Member Function…
-
2
votes1
answer162
viewsQ: Misaligned
I have these two div <div class="widget nuvem" style="position: static"> <h3>Nuvem de Palavras</h3> <div class="tags"> <? foreach($inicial_nuvem as $valor){ ?> <div…
cssasked Sr. André Baill 6,946 -
0
votes2
answers119
viewsA: Centos 6 - Codeigniter - HMVC - Not Found
Try modifying your htaccess: RewriteEngine on RewriteCond $1 !^(index\.php|css|js|images|robots.txt|includes|relatorio) RewriteRule ^(.*)$ index.php/$1 [L]
-
1
votes1
answer541
viewsQ: SQL - Codeigniter - Returns only one record
Gentlemen, I have the following function: // Busca Simples public function buscando(){ // pesquisar_palavra, idCategoria, idSubCategoria if($this->input->post('pesquisar_palavra')){…
-
2
votes1
answer799
viewsA: Read data in an SQL with columns of equal names in different tables
Change your SQL to: $sql = "SELECT tb_faqs.*, tb_fags.id as id_fag, tb_paginas.*, tb_paginas.id as id_pagina FROM (tb_faqs INNER JOIN tb_paginas) WHERE tb_faqs.ID = '$id' AND tb_faqs.id_pagina =…
-
0
votes1
answer729
viewsQ: SQL - Category & Subcategory
I have a category and subcategory structure. And I need to list all categories, and then their subcategories... But the listing went wrong. I’m using the codeigniter. Structure of the Database: SQL…
-
14
votes8
answers5012
viewsA: Printing a String until a space is found
It can be as follows: $string = "Nome Completo"; $string = explode(" ", $string); echo $string[0]; In this case, only "name"
-
5
votes4
answers721
viewsA: foreach php inside <script>
Personally I would do it that way: <a href="" onClick="get_indicador(<?=$row['id'];?>)">Visualizar</a> <script type="text/javascript"> function get_indicador(id){ var…
-
1
votes2
answers43
viewsA: Sum of tables according to session id
You can do it this way: <?php mysql_connect('localhost', 'root', 'pass') or print mysql_error(); mysql_select_db("database"); $consulta = mysql_query("SELECT id_affiliate FROM…
-
0
votes1
answer352
viewsA: Fix Where Clause with like null operator that finds data with null parameters
You can elaborate as follows: $condicao = "WHERE id != '' "; if($_POST['data']){ $condicao .= " AND data = '".$_POST['data']."'"; } if($_POST['palavra']){ $condicao .= " AND LIKE palavra =…
sqlanswered Sr. André Baill 6,946 -
0
votes2
answers512
viewsA: How to get the values of an array from a key
It can be that way: foreach( get_post_gallery( $post->id, false ) as $key => $src ) { echo $key; //resultado: link, size - ids - src foreach($src as $valor){ echo $valor->campo; } } Or if…
-
2
votes2
answers2126
viewsA: how to select only 1 record of each id
I’d do it this way: SELECT u.*, i.imagem as imagem_usuario FROM usuario u LEFT JOIN imagem i ON(i.id_usuario=u.id) GROUP BY u.id_usuario ORDER BY u.id_usuario ASC This way, we can also sort by id,…