Exemplo n.º 1
0
 public function ValidaUsuarioDAO($login, $senha)
 {
     $this->_conexao = conectaComBanco();
     $sqlStr = "SELECT login FROM tb_usuario WHERE login = ? and senha = ? and STATUS = 'ATIVO'";
     $stmt = $this->_conexao->prepare($sqlStr);
     $stmt->bind_param('ss', $login, $senha);
     $stmt->bind_result($ias);
     $stmt->execute();
     while ($stmt->fetch()) {
         return $ias;
     }
     desconectaDoBanco($this->_conexao);
 }
Exemplo n.º 2
0
 function __construct()
 {
     $this->_conexao = conectaComBanco();
 }
Exemplo n.º 3
0
 public function GetTotalDiasHouveramHelpdeskDAO()
 {
     $this->_conexao = conectaComBanco();
     $sqlStr = "select count(data) dias from (\n\t\t\t\t\t\tselect distinct\n\t\t\t\t\t\t\tdate(resposta.data) as data\n\t\t\t\t\t\tfrom \n\t\t\t\t\t\t\ttb_chamado chamado\n\t\t\t\t\t\t\tleft join tb_resposta_chamado resposta on resposta.id_chamado = chamado.id\n\t\t\t\t\t\twhere\n\t\t\t\t\t\t\tresposta.id = (select min(id) from tb_resposta_chamado where id_chamado = chamado.id)\n\t\t\t\t\t\tlimit 100\n\t\t\t\t\t) tb_chamado";
     $result = mysqli_query($this->_conexao, $sqlStr);
     if ($result) {
         while ($r = $result->fetch_assoc()) {
             $totalHora = $r['dias'];
         }
     }
     desconectaDoBanco($this->_conexao);
     return $totalHora;
 }