diff --git a/ieducar/intranet/include/pessoa/clsFuncionario.inc.php b/ieducar/intranet/include/pessoa/clsFuncionario.inc.php index 837568e..44444a9 100755 --- a/ieducar/intranet/include/pessoa/clsFuncionario.inc.php +++ b/ieducar/intranet/include/pessoa/clsFuncionario.inc.php @@ -101,7 +101,7 @@ class clsFuncionario extends clsPessoaFisica */ var $_campo_order_by; - function clsFuncionario($int_idpes = false, $str_matricula = false, $int_cpf = false, $int_ref_cod_setor = false, $str_senha = false, $data_troca_senha = false, $tempo_expira_senha = false, $data_reativa_conta = false, $tempo_expira_conta = false, $ref_cod_funcionario_vinculo = false, $ramal = false, $matricula_permanente = false, $banido = false) + function clsFuncionario($int_idpes = false, $str_matricula = false, $int_cpf = false, $int_ref_cod_setor = false, $str_senha = false, $data_troca_senha = false, $tempo_expira_senha = false, $data_reativa_conta = false, $tempo_expira_conta = false, $ref_cod_funcionario_vinculo = false, $ramal = false, $matricula_permanente = false, $banido = false, $email = null) { $this->idpes = $int_idpes; $this->matricula = $str_matricula; @@ -116,6 +116,7 @@ class clsFuncionario extends clsPessoaFisica $this->ramal = $ramal; $this->matricula_permanente = $matricula_permanente; $this->proibido = $banido; + $this->email = $email; $this->_campos_lista = " f.ref_cod_pessoa_fj, f.matricula, f.senha, @@ -132,7 +133,8 @@ class clsFuncionario extends clsPessoaFisica f.ref_ref_cod_pessoa_fj, f.proibido, f.nome, - f.ref_cod_setor_new + f.ref_cod_setor_new, + f.email "; } @@ -157,7 +159,7 @@ class clsFuncionario extends clsPessoaFisica } } - function lista($str_matricula=false, $str_nome=false, $int_ativo=false, $int_secretaria=false, $int_departamento=false, $int_setor=false, $int_vinculo=false, $int_inicio_limit=false, $int_qtd_registros=false, $str_ramal = false, $matricula_is_not_null = false, $int_idpes = false ) + function lista($str_matricula=false, $str_nome=false, $int_ativo=false, $int_secretaria=false, $int_departamento=false, $int_setor=false, $int_vinculo=false, $int_inicio_limit=false, $int_qtd_registros=false, $str_ramal = false, $matricula_is_not_null = false, $int_idpes = false, $email = null ) { $sql = " SELECT {$this->_campos_lista} FROM {$this->schema_portal}.v_funcionario f"; $filtros = ""; @@ -204,6 +206,12 @@ class clsFuncionario extends clsPessoaFisica $filtro_pessoa =true; } + if(is_string($str_email)) + { + $filtros .= "{$whereAnd} f.email ILIKE '%{$str_email}%'f"; + $whereAnd = " AND "; + } + $limite = ""; if($int_inicio_limit !== false && $int_qtd_registros !== false) { @@ -284,7 +292,7 @@ class clsFuncionario extends clsPessoaFisica $tupla = parent::detalhe(); $db = new clsBanco(); - $db->Consulta("SELECT ref_cod_pessoa_fj, matricula, senha, ativo, ref_sec, ramal, sequencial, opcao_menu, ref_cod_setor, ref_cod_funcionario_vinculo, tempo_expira_senha, tempo_expira_conta, data_troca_senha, data_reativa_conta, ref_ref_cod_pessoa_fj, proibido, ref_cod_setor_new, matricula_permanente FROM funcionario WHERE ref_cod_pessoa_fj = '{$this->idpes}'"); + $db->Consulta("SELECT ref_cod_pessoa_fj, matricula, senha, ativo, ref_sec, ramal, sequencial, opcao_menu, ref_cod_setor, ref_cod_funcionario_vinculo, tempo_expira_senha, tempo_expira_conta, data_troca_senha, data_reativa_conta, ref_ref_cod_pessoa_fj, proibido, ref_cod_setor_new, matricula_permanente, email FROM funcionario WHERE ref_cod_pessoa_fj = '{$this->idpes}'"); if($db->ProximoRegistro()) { $tupla = $db->Tupla(); @@ -438,4 +446,4 @@ class clsFuncionario extends clsPessoaFisica $this->_campos_lista = $this->_todos_campos; } } -?> \ No newline at end of file +?> diff --git a/ieducar/intranet/include/portal/clsPortalFuncionario.inc.php b/ieducar/intranet/include/portal/clsPortalFuncionario.inc.php index 452cbb3..a476051 100755 --- a/ieducar/intranet/include/portal/clsPortalFuncionario.inc.php +++ b/ieducar/intranet/include/portal/clsPortalFuncionario.inc.php @@ -150,13 +150,13 @@ class clsPortalFuncionario * * @return object */ - function clsPortalFuncionario( $ref_cod_pessoa_fj = null, $matricula = null, $senha = null, $ativo = null, $ref_sec = null, $ramal = null, $sequencial = null, $opcao_menu = null, $ref_cod_administracao_secretaria = null, $ref_ref_cod_administracao_secretaria = null, $ref_cod_departamento = null, $ref_ref_ref_cod_administracao_secretaria = null, $ref_ref_cod_departamento = null, $ref_cod_setor = null, $ref_cod_funcionario_vinculo = null, $tempo_expira_senha = null, $tempo_expira_conta = null, $data_troca_senha = null, $data_reativa_conta = null, $ref_ref_cod_pessoa_fj = null, $proibido = null, $ref_cod_setor_new = null, $matricula_new = null, $matricula_permanente = null, $tipo_menu = null ) + function clsPortalFuncionario( $ref_cod_pessoa_fj = null, $matricula = null, $senha = null, $ativo = null, $ref_sec = null, $ramal = null, $sequencial = null, $opcao_menu = null, $ref_cod_administracao_secretaria = null, $ref_ref_cod_administracao_secretaria = null, $ref_cod_departamento = null, $ref_ref_ref_cod_administracao_secretaria = null, $ref_ref_cod_departamento = null, $ref_cod_setor = null, $ref_cod_funcionario_vinculo = null, $tempo_expira_senha = null, $tempo_expira_conta = null, $data_troca_senha = null, $data_reativa_conta = null, $ref_ref_cod_pessoa_fj = null, $proibido = null, $ref_cod_setor_new = null, $matricula_new = null, $matricula_permanente = null, $tipo_menu = null, $email = null ) { $db = new clsBanco(); $this->_schema = "portal."; $this->_tabela = "{$this->_schema}funcionario"; - $this->_campos_lista = $this->_todos_campos = "ref_cod_pessoa_fj, matricula, senha, ativo, ref_sec, ramal, sequencial, opcao_menu, ref_cod_setor, ref_cod_funcionario_vinculo, tempo_expira_senha, tempo_expira_conta, data_troca_senha, data_reativa_conta, ref_ref_cod_pessoa_fj, proibido, ref_cod_setor_new, matricula_new, matricula_permanente, tipo_menu"; + $this->_campos_lista = $this->_todos_campos = "ref_cod_pessoa_fj, matricula, senha, ativo, ref_sec, ramal, sequencial, opcao_menu, ref_cod_setor, ref_cod_funcionario_vinculo, tempo_expira_senha, tempo_expira_conta, data_troca_senha, data_reativa_conta, ref_ref_cod_pessoa_fj, proibido, ref_cod_setor_new, matricula_new, matricula_permanente, tipo_menu, email"; if( is_numeric( $ref_ref_cod_pessoa_fj ) ) { @@ -402,6 +402,9 @@ class clsPortalFuncionario $this->tipo_menu = $tipo_menu; } + if(is_string($email)) + $this->email = $email; + } /** @@ -567,6 +570,12 @@ class clsPortalFuncionario $gruda = ", "; } + if(is_string($this->email)) + { + $campos .= "{$gruda}email"; + $valores .= "{$gruda}'{$this->email}'"; + $gruda = ", "; + } $db->Consulta( "INSERT INTO {$this->_tabela} ( $campos ) VALUES( $valores )" ); return true;//$db->InsertId( "{$this->_tabela}_ref_cod_pessoa_fj_seq"); @@ -708,6 +717,11 @@ class clsPortalFuncionario $gruda = ", "; } + if(is_string($this->email)) + { + $set .= "{$gruda}email = '{$this->email}'"; + $gruda = ", "; + } if( $set ) { @@ -1076,4 +1090,4 @@ class clsPortalFuncionario } } -?> \ No newline at end of file +?> -- libgit2 0.21.2