-
Conteúdo Similar
-
Por joao b silva
Tenho uma pequena aplicação em php que gera arquivos pdf com a MPDF e envia email com a PHPMAILER. De repente a app parou de enviar os emails e apresenta a seguinte mensagem de erro:
Error PHPMailer: SMTP Error: Could not authenticate.
Faço uso de um hotmail para a configuração do PHPMAILER.
-
Por violin101
Caros amigos, saudações.
Gostaria de tirar uma dúvida com os amigos.
Quando programava em DOS. utilizava algumas teclas de atalho para: SALVAR / EDITAR / EXCLUIR / IMPRIMIR.
Por exemplo:
Salvar ----> ALT+S
Editar ----> ALT+E
Excluir --> ALT+X
Imprimir -> ALT+I
no PHP tem como colocar esses ATALHOS nos button, para o usuário trabalhar com esses atalhos e como seria ?
grato,
Cesar
-
Por violin101
Caros Amigos, saudações.
Por favor, me perdoa em postar uma dúvida.
Preciso criar uma Rotina onde o usuário possa buscar na Base de Dados de Produtos, tanto por Código e Descrição, ou seja:
- caso o usuário digita o Código, mostra os dados do Produto.
- caso o usuário digita a Descrição, mostra os dados do Produto
Fiz uma Rotina, onde o usuário digita a DESCRIÇÃO com a função AUTOCOMPLETE. <=== está funcionando certinho.
Minha dúvida é como faço para DIGITAR o Código e mostrar os dados também.
o meu AutoComplete na MODEL está assim.
public function autoCompleteProduto($q){ $this->db->select('*' ) ->from('produtos') ->where('produtos.statusProd',1) ->like('descricao', $q) ->limit(5) ->order_by('descricao', 'ASC'); $query = $this->db->get(); if ($query->num_rows() > 0) { foreach ($query->result_array() as $row) { $row_set[] = ['label' => str_pad($row['idProdutos'], '5', '0', STR_PAD_LEFT).' - '.$row['descricao'], 'id' => $row['idProdutos'], 'descricao' => $row['descricao'], 'cod_interno' => $row['cod_interno'], 'prd_unid' => $row['prd_unid'], 'estoque_atual' => $row['estoque_atual'] ]; } echo json_encode($row_set); } }
no CONTROLLER está assim:
public function autoCompleteProduto() { $this->load->model('estoque/lancamentos_model'); if (isset($_GET['term'])) { $q = strtolower($_GET['term']); $this->lancamentos_model->autoCompleteProduto($q); } }
na VIEW está assim:
<div class="col-md-10"> <label for="idProdutos">Produto:</label> <input type="hidden" name="idProdutos" id="idProdutos"> <input type="text" class="form-control" id="descricao" name="descricao" style="font-size:15px; font-weight:bold;" placeholder="Pesquisar por descrição do produto" disabled> </div>
VIEW + JAVASCRIPT
//Função para trazer os Dados pelo o AutoComplete. function resolveAutocomplete() { $("#descricao").autocomplete({ source: "<?php echo base_url(); ?>estoque/lancamentos/autoCompleteProduto/", minLength: 2, select: function (event, ui) { $("#idProdutos").val(ui.item.id); $("#cod_interno").val(ui.item.cod_interno); $("#descricao").val(ui.item.descricao); $("#prd_unid").val(ui.item.prd_unid); $("#estoque_atual").val(ui.item.estoque_atual); $("#qtde").focus(); } }); } // inicia o autocomplete resolveAutocomplete();
Grato,
Cesar
-
Por belann
Olá!
Estou tentando criar um projeto laravel e está dando o seguinte erro
curl error 60 while downloading https://getcomposer.org/versions: SSL certificate problem: unable to get local issu
er certificate
Já tentei atualizar o composer, mas dá o mesmo erro acima.
-
Por violin101
Caros amigos, saudações.
Estou com uma dúvida de validação de INPUT com função moeda.
Tenho um input onde o usuário digita um valor qualquer, por exemplo: 1.234,56
o problema é quando precisa atualizar o valor.
Quando o usuário atualizar o input fica assim: 1.234,
como faço para atualizar as casas decimais, conforme o valor for sendo alterado ?
o input está assim:
<div class="col-md-2"> <label for="">Valor Unitário</label> <input type="text" class="form-control" id="estoqprod" name="estoqprod" style="font-size:15px; font-weight:bold; width:100%; text-align:center;" placeholder="0,00" OnKeyUp="calcProd();" onkeypress="return(FormataMoeda(this,'.',',',event))" > </div>
a função para formatar o input para moeda está assim:
obs.: a Função CalcProd está executando corretamente
function calcProd(){ //Obter valor digitado do produto var estoq_prod = document.getElementById("estoqprod").value; //Remover ponto e trocar a virgula por ponto while (estoq_prod.indexOf(".") >= 0) { estoq_prod = estoq_prod.replace(".", ""); } estoq_prod = estoq_prod.replace(",","."); //Obter valor digitado do produto var prod_qtde = document.getElementById("qtde").value; //Remover ponto e trocar a virgula por ponto while (prod_qtde.indexOf(".") >= 0) { prod_qtde = prod_qtde.replace(".", ""); } prod_qtde = prod_qtde.replace(",","."); //Calcula o Valor do Desconto if (prod_qtde > 0 && estoq_prod > 0) { calc_total_produto = parseFloat(prod_qtde) - parseFloat(estoq_prod); var numero = calc_total_produto.toFixed(2).split('.'); //Calculo para não deixar GRAVAR valores negativos if (calc_total_produto < 0 ) { numero[0] = numero[0].split(/(?=(?:...)*$)/).join('.') * -1; document.getElementById("qtdeTotal").value = numero.join(','); } else { numero[0] = numero[0].split(/(?=(?:...)*$)/).join('.'); document.getElementById("qtdeTotal").value = numero.join(','); } } else { if (estoq_prod > 0) { document.getElementById("qtdeTotal").value = document.getElementById("estoqprod").value; } else { document.getElementById("qtdeTotal").value = "0,00"; } } } /*---Função para Formatar Campo para Moeda [R$]---*/ function FormataMoeda(objTextBox, SeparadorMilesimo, SeparadorDecimal, e){ var sep = 0; var key = ''; var i = j = 0; var len = len2 = 0; var strCheck = '0123456789'; var aux = aux2 = ''; var whichCode = (window.Event) ? e.which : e.keyCode; if (whichCode == 13) return true; key = String.fromCharCode(whichCode); // Valor para o código da Chave if (strCheck.indexOf(key) == -1) return false; // Chave inválida len = objTextBox.value.length; for(i = 0; i < len; i++) if ((objTextBox.value.charAt(i) != '0') && (objTextBox.value.charAt(i) != SeparadorDecimal)) break; aux = ''; for(; i < len; i++) if (strCheck.indexOf(objTextBox.value.charAt(i))!=-1) aux += objTextBox.value.charAt(i); aux += key; len = aux.length; if (len == 0) objTextBox.value = ''; if (len == 1) objTextBox.value = '0'+ SeparadorDecimal + '0' + aux; if (len == 2) objTextBox.value = '0'+ SeparadorDecimal + aux; if (len > 2) { aux2 = ''; for (j = 0, i = len - 3; i >= 0; i--) { if (j == 3) { aux2 += SeparadorMilesimo; j = 0; } aux2 += aux.charAt(i); j++; } objTextBox.value = ''; len2 = aux2.length; for (i = len2 - 1; i >= 0; i--) objTextBox.value += aux2.charAt(i); objTextBox.value += SeparadorDecimal + aux.substr(len - 2, len); } return false; }
Grato,
Cesar
-
PESSOAL BOM DIA,
MEU NOME É MANOEL,
ESTOU AQUI PQ TENHO JÁ ACOMPANHANDO TEM UM TEMPO ESSE SITE E JÁ TIREI VÁRIAS DÚVIDAS AQUI...
ESTOU INICIANDO NO MUNDO DO PHP, E AGORA ENTREI NUMA CONDIÇÃO ONDE PRECISO MUITO DO APOIO DE VCS...
EU COLOCO O CÓDIGO ABAIXO E SEMPRE RETORNA O ERRO
404 Page Not Found
The page you requested was not found.
PODEM ME ORIENTAR EM COMO RESOLVO ESSA PENDENCIA...DE ANTEMÃO AGRADEÇO.
SEGUE CÓDIGO:
<?php
/*
* IIMS version 1.0
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT - AMBIENTE DE APLICAÇÃO
*---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting.
*
* This can be set to anything, but default usage is:
*
* development
* testing
* production
*
* NOTE: If you change these, also change the error_reporting() code below
*
*/
define('ENVIRONMENT', 'production');
/*
*---------------------------------------------------------------
* ERROR REPORTING - RELATÓRIOS DE ERROS
*---------------------------------------------------------------
*
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.
*/
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
/*
*---------------------------------------------------------------
* SYSTEM FOLDER NAME - NOME DO PASTA DO SISTEMA
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory
* as this file.
*
*/
$system_path = 'system';
/*
*---------------------------------------------------------------
* APPLICATION FOLDER NAME - APLICAÇÃO NOME DA PLACA
*---------------------------------------------------------------
*
* If you want this front controller to use a different "application"
* folder then the default one you can set its name here. The folder
* can also be renamed or relocated anywhere on your server. If
* you do, use a full server path. For more info please see the employee guide:
* http://codeigniter.com/user_guide/general/managing_apps.html
*
* NO TRAILING SLASH!
*
*/
$application_folder = 'application';
/*
* --------------------------------------------------------------------
* DEFAULT CONTROLLER - CONTROLADOR DE DEFAULT
* --------------------------------------------------------------------
*
* Normally you will set your default controller in the routes.php file.
* You can, however, force a custom routing by hard-coding a
* specific controller class/function here. For most applications, you
* WILL NOT set your routing here, but it's an option for those
* special instances where you might want to override the standard
* routing in a specific front controller that shares a common CI installation.
*
* IMPORTANT: If you set the routing here, NO OTHER controller will be
* callable. In essence, this preference limits your application to ONE
* specific controller. Leave the function name blank if you need
* to call functions dynamically via the URI.
*
* Un-comment the $routing array below to use this feature
*
*/
// The directory name, relative to the "controllers" folder. Leave blank
// if your controller is not in a sub-folder within the "controllers" folder
// $routing['directory'] = '';
// The controller class file name. Example: Mycontroller
// $routing['controller'] = '';
// The controller function you wish to be called.
// $routing['function'] = '';
/*
* -------------------------------------------------------------------
* CUSTOM CONFIG VALUES - VALORES DE CONFIGURAÇÃO PERSONALIZADOS
* -------------------------------------------------------------------
*
* The $assign_to_config array below will be passed dynamically to the
* config class when initialized. This allows you to set custom config
* items or override any default config values found in the config.php file.
* This can be handy as it permits you to share one application between
* multiple front controller files, with each file containing different
* config values.
*
* Un-comment the $assign_to_config array below to use this feature
*
*/
// $assign_to_config['name_of_config_item'] = 'value of config item';
// --------------------------------------------------------------------
// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
// --------------------------------------------------------------------
/*
* ---------------------------------------------------------------
* Resolve the system path for increased reliability
* ---------------------------------------------------------------
*/
// Set the current directory correctly for CLI requests
if (defined('STDIN'))
{
chdir(dirname(__FILE__));
}
if (realpath($system_path) !== FALSE)
{
$system_path = realpath($system_path).'/';
}
// ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
// Is the system path correct?
if ( ! is_dir($system_path))
{
exit("Your system folder path does not appear to be set correctly. Please open the following file and correct this: ".pathinfo(__FILE__, PATHINFO_BASENAME));
}
/*
* -------------------------------------------------------------------
* Now that we know the path, set the main path constants
* -------------------------------------------------------------------
*/
// The name of THIS file
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
// The PHP file extension
// this global constant is deprecated.
define('EXT', '.php');
// Path to the system folder
define('BASEPATH', str_replace("\\", "/", $system_path));
// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));
// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
// The path to the "application" folder
if (is_dir($application_folder))
{
define('APPPATH', $application_folder.'/');
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.'/'))
{
exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);
}
define('APPPATH', BASEPATH.$application_folder.'/');
}
/*
* --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
* --------------------------------------------------------------------
*
* And away we go...
*
*/
require_once BASEPATH.'core/CodeIgniter.php';
/* End of file index.php */
/* Location: ./index.php */
Compartilhar este post
Link para o post
Compartilhar em outros sites