0
I am developing a legal system for registering processes and that can be shared between the users involved.
At the moment, I need to filter processes between dates. I already managed to do this where all existing processes are listed, but now I want to filter the dates of processes of a particular client.
For example, I have a client called Marcelo and I want to list all the processes of this client. Now, I want to filter the processes of this client by date. How to do?
Below I have the code that filters by date
function GetProcessoData($data_ini,$data_fim){
    $query  = "SELECT * FROM {$this->prefix}processos p";
    $query .= " INNER JOIN {$this->prefix}clientes c ON p.pro_cliente = c.cli_id";
    $query .= " INNER JOIN {$this->prefix}user u ON p.pro_remetente = u.user_id";
    $query.= " WHERE pro_data between :data_ini AND :data_fim ";
    $query .= $this->PaginacaoLinks("pro_id", $this->prefix."processos WHERE pro_data between ".$data_ini." AND ".$data_fim);
   // passando os parametros  
    $params = array(':data_ini'=>$data_ini, ':data_fim'=>$data_fim);
    // executando a SQL
    $this->ExecuteSQL($query,$params);
    $this->GetListaAll();
}
						
André, from what I understand, just add one more condition in your Where, filtering the client table by the field that stores the name of the same, your function would have to receive a third argument, being the client’s name.
– Daniel Mendes