Group Details

QA Engineer

Member List

  • RE: Problem by eliminating from memory a TObjectList<tlabel></tlabel>

    You are assigning nil to the variable before running the DisposeOf. You would have to do this assignment only after performing the method of memory release. Still, I think you should call the method .Free instead of Dispose. And also when creating TObjectList pass false as parameter. If you do so, TObjectList will not destroy the objects when it destroyed itself. Pass true only if you create the objects in runtime and/or want the list to destroy them.

    posted in Software Programming
  • "Unknown: Failed opening required" error when following slimphp manual

    I'm testing the Slim Framework on a machine with Windows 10, already in the first instructions I received the error:

    Fatal error: Unknown: Failed opening required 'public\public/index.php' (include_path='.;C:\php\pear') in Unknown on line 0
    

    I searched other related threads and saw that it may be something with permissions but I have already given master permission in both the PHP directory and the project directory.

    Follow my settings:

    • Folder location:

      C:/php
      
    • Project location:

      D:\git\slim-saa
      
    • PHP version:

      PHP 7.1.12 (cli) (built: Nov 23 2017 04:21:28) (ZTS MSVC14 (Visual C++ 2015) x6 4 ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

    Project https://github.com/getJv/slim-saa .

    I'm following exactly the https://www.slimframework.com/ and lift the built-in server with the command:

    php -S localhost:8080 -t public public/index.php
    

    Run on the root (slip-saa folder)

    Can anyone give me a light on how to circumvent this situation?

    posted in Software Programming
  • How to perform a PHP function in background?

    I'm using the cPanel API to add dynamically stationed domains. Until then all right, send the necessary data via jQuery.post() only that this process takes a little to complete, about 1 minute.

    Do you have any alternative for the process to continue running in "second plan" and the user to continue browsing the system?
    Currently the user cannot navigate until the process ends.

    posted in Software Programming
  • RE: Detect when a form is sent

    $('#form').submit(cb) is a shortcut to $('#form').on("submit", cb). If you want to avoid jquery you can do this event bind using onsubmit or addEventListener.

    To cancel the form submission you can use the preventDefault method or returnar false of the event handler:

    var meuForm = document.getElementById("meuForm");
    meuForm.onsubmit = function(){
        if(dadosInvalidos()){
            return false;
        }
    }
    

    (It should be noted that the return false may not be achieved if the verification logic releases an exception. See https://stackoverflow.com/questions/3350247/how-to-prevent-form-from-being-submitted

    Finally, using the submit event as you are doing covers both the user's case by clicking the button as the case of it tightening enter.

    posted in Software Programming
  • Solution for sending multi-destination email and html

    Hello, I charge a Solution for sending multi-destination email and with html, I have a mailing code for smtp gmail that works, but it has two problems that I can't solve.

    Problem 1: I need to enable html code in the email body if I write text, the destination must receive the text in bold

    Problem 2: I need you to send to more than one destination using line break when ising in the formulary

    Follow code working but not complete: http://pastebin.com/biwJKEmX

    posted in Software Programming
  • PhoneGap only makes games?

    I have studied hard programming for Android in Java, being worried about the issue of programming in Java and only earning a portion of the market because the programs in Java do not run on Windows Phone, so I of PhoneGap that is multiplatform can do games in IOS, Windows Phone and Android. being that my goal is not to play games, but corporate apps like box control.

    Most of the PhoneGap courses are to train people to develop games and I wanted to know if learning how to mess with PhoneGap could also develop corporate programs?

    posted in Software Programming
  • Dynamic Pointers allocation in C++

    I am needing to create a protective routine in the removal function. Why makes a mistake removing the last item?

    The function:

    // Remover o primeiro cliente
    void cadRemover(){
      lista=ini; // Volta ao início
      aux = lista; // Copia o 1º para aux
      lista = lista->prox; // Move a lista para o próximo
      delete aux; // Deleta aux
    }
    

    The source http://pastebin.com/3iu8h9Qw .

    posted in Software Programming
  • RE: UPDATE PHP with JavaScript

    I will change your form and your POST and what I'm sending is a functional code, that is, it was tested before posting here. Notice I removed the href of your type='submit' since it is already being indicated in <form action='...' is already recognized the file to which it has to submit the data

    <form action="atualizarFuncionario.php" method="POST">
    
    &lt;?php
    
    require_once './base/conexao.php'; 
    
        $funcionario = filter_input(INPUT_GET,"id");
        $nome_alter= filter_input(INPUT_GET,"nome");
        $cpf_alter= filter_input(INPUT_GET,"cpf");
        $tel_alter= filter_input(INPUT_GET,"tel");
    
    ?&gt;
    
    &lt;label&gt;ID: &lt;/label&gt;
    &lt;input type="hidden" name="id" value="&lt;?php echo $nome_alter; ?&gt;" required&gt;
    
    &lt;label&gt;Nome: &lt;/label&gt;
    &lt;input type="text" id="inp" name="nome" size="40" value="&lt;?php echo $nome_alter; ?&gt;" required="" placeholder="Nome"&gt;&lt;br&gt;&lt;br&gt;
    
    &lt;label&gt;CPF: &lt;/label&gt;
    &lt;input type="text" name="cpf" id="inp" size="40" id="cpf" required="" value="&lt;?php echo $cpf_alter; ?&gt;" maxlength="14" onkeyup="mascCPF(this.value)" placeholder="CPF xxx.xxx.xxx-xx"&gt;&lt;br&gt;&lt;br&gt;
    
    &lt;label&gt;Telefone: &lt;/label&gt;
    &lt;input type="text" name="tel" id="inp" size="40" value="&lt;?php echo $tel_alter; ?&gt;" id="tel" required="" maxlength="14" onkeyup="mascTel(this.value)"  placeholder="Telefone(xx)9xxxx-xxxx"&gt;&lt;br&gt;&lt;br&gt;
    
    &lt;center&gt;&lt;input type='submit' name='enviar' value='ATUALIZAR'&gt;&lt;/center&gt;
    

    </form>

    And the code to change stayed this way, created a bank and here it worked perfectly, where it will be checked if there is the ID of the employee to make UPDATE, otherwise, i.e. if there is no he will INSERT

    include_once './conexao.php';

    if(isset($_POST['enviar'])){
    
        $id = $_POST['id'];
        $nome = $_POST['nome'];
        $cpf = $_POST['cpf'];
        $tel = $_POST['tel'];
    
        $sql = "SELECT * FROM funcionario WHERE id = '$id' "; 
        $resulta = $conn-&gt;query($sql);
        $row = $resulta-&gt;fetch_assoc();
    
        if ($resulta-&gt;num_rows &gt; 0) {
            $result = "UPDATE funcionario SET nome = '$nome', cpf = '$cpf', tel = '$tel' WHERE id = '$id' ";
        } else {
            $result = "INSERT INTO funcionario (nome, telefone, endereco) VALUES ('$nome, '$cpf', '$tel')";
        }
    
        $resultado = mysqli_query($conn, $result);
        echo $result;
     }
    

    posted in Software Programming
  • How to improve select performance

    I have to use firebird, but I don't get very well with database, I did the select as follows:

    select first 5 skip ((1 - 1) * 10) distinct
     PRO.CODIGO,
     PRO.NIVEL_INTERESSE,
     PRO.DATA_RETORNO,
     PRO.RESPONSAVEL_PROSPECT,
     PRO.EMPRESA_PROSPECT,
     PRO.CIDADE_IBGE,
     PRO.VENDEDOR,
     PRO.STATUS,
     PRO.TIPO_CONTATO,
     PRO.EMAIL,
     PRO.DATA_ALTERACAO,
     PRO.DATA_CADASTRO,
     VEN.NOME as NOME_VENDEDOR,
     PRO.TELEFONE,
     (select first 1
       CODIGO
       from CAD_PROSPECTOS_PROPOSTAS WHERE PROSPECTO = PRO.CODIGO
       order by CODIGO desc) as COD_PROPOSTA,
     (select first 1
       CODIGO
       from CAD_PROSPECTOS_AGENDAMENTOS
       where PROSPECTO = PRO.CODIGO
       order by CODIGO desc) as COD_AGENDAMENTO,
     (select first 1
       CODIGO
       from CAD_PROSPECTOS_CONTRATOS
       where PROSPECTO = PRO.CODIGO
       order by CODIGO desc) as COD_CONTRATO,
     (select first 1
       CONTRATO_CONFIRMADO
       from CAD_PROSPECTOS_CONTRATOS
       where PROSPECTO = PRO.CODIGO
       order by CODIGO desc) as CONTRATO_CONFIRMADO,
     (select first 1
       NOME
       from CAD_MUNICIPIOS
       where IBGE = PRO.CIDADE_IBGE) as NOME_MUNICIPIO
     from CAD_PROSPECTOS PRO
     left join CAD_TERCEIROS VEN on PRO.VENDEDOR = VEN.CODIGO and PRO.EMPRESA = 
     VEN.EMPRESA
     left join CAD_TERCEIROS_VENDEDORES CTV on PRO.CODIGO = VEN.CODIGO and 
     PRO.EMPRESA = VEN.CODIGO
     where PRO.EMPRESA = 1 and
           PRO.ESTABELEC = 1
     order by PRO.CODIGO desc  
    

    It works perfectly and meets all my needs, only problem is that it gets extremely slow. How I could improve this select so it worked faster and bringing me the same data.

    posted in Software Programming
  • querySelector takes class? (JAVASCRIPT)

    I did a function to change a photo when an element is added in my table, table that I created a class to manage to change the photo, but to get the element of the html, I need to use the querySelector, but I am not getting it with class, but when it is with id it goes.

    Ex:

    function teste() {
      var elemento = document.querySelector('info-status');
    
    var conteudo = elemento.textContent || elemento.innerText;
    
    var teste = conteudo.length;
    
    if (teste &gt; 0) {
    
      var img = document.getElementById('TrocaPost');
      var imgg = document.getElementById('TrocaEntregue');
      var image = document.getElementById('TrocaViagem');
      img.src = 'caminhao/caminhaoCERTOazul.png';
      imgg.src = 'caminhao/caminhaoCERTOazul.png';
      image.src = 'caminhao/caminhaoCERTOazul.png';
    
    }
    

    }

    the info-status when it is id, it takes, but when it is class it does not catch.
    Is there something wrong with my code or the querySelector just grabs ID?

    posted in Software Programming