Beispiel #1
0
 public function Inicializar()
 {
     $retorno = "Novo";
     session_start();
     if (isset($_SESSION['id_pessoa'])) {
         $this->p_cod_pessoa_fj = $_SESSION['id_pessoa'];
         $objPessoa = new clsPessoaFj();
         $db = new clsBanco();
         $db->Consulta("SELECT f.matricula, f.senha, f.ativo, f.ramal, f.ref_cod_setor, f.ref_cod_funcionario_vinculo, f.ref_cod_setor_new FROM funcionario f WHERE f.ref_cod_pessoa_fj={$this->p_cod_pessoa_fj}");
         if ($db->ProximoRegistro()) {
             list($this->f_matricula, $this->f_senha, $this->f_ativo, $this->f_ramal, $this->f_ref_setor, $this->ref_cod_funcionario_vinculo, $this->ref_cod_setor) = $db->Tupla();
             list($this->p_nm_pessoa, $this->p_id_federal, $this->p_endereco, $this->p_cep, $this->p_ref_bairro, $this->p_ddd_telefone_1, $this->p_telefone_1, $this->p_ddd_telefone_2, $this->p_telefone_2, $this->p_ddd_telefone_mov, $this->p_telefone_mov, $this->p_ddd_telefone_fax, $this->p_telefone_fax, $this->p_email, $this->p_http, $this->p_tipo_pessoa, $this->cidade, $this->bairro, $this->logradouro, $this->cep, $this->idlog, $this->idbai, $this->idtlog, $this->sigla_uf, $this->complemento, $this->numero, $this->letra, $this->bloco, $this->apartamento, $this->andar) = $objPessoa->queryRapida($this->p_cod_pessoa_fj, "nome", "cpf", "endereco", "cep", "bairro", "ddd_1", "fone_1", "ddd_2", "fone_2", "ddd_mov", "fone_mov", "ddd_fax", "fone_fax", "email", "url", "tipo", "cidade", "bairro", "logradouro", "cep", "idlog", "idbai", "idtlog", "sigla_uf", "complemento", "numero", "letra", "bloco", "apartamento", "andar");
             $objFisica = new clsPessoaFisica();
             list($this->p_sexo) = $objFisica->queryRapida($this->p_cod_pessoa_fj, "sexo");
             $this->fexcluir = FALSE;
             $retorno = "Editar";
             // define os niveis ate o setor escolhido (para que os campos ja venham preenchidos corretamente)
             if ($this->ref_cod_setor) {
                 $objSetor = new clsSetor();
                 $niveis = $objSetor->getNiveis($this->ref_cod_setor);
                 for ($i = 0; $i < count($niveis); $i++) {
                     $nm_var = "setor_{$i}";
                     $this->{$nm_var} = $niveis[$i];
                 }
             }
         }
     }
     $this->url_cancelar = 'index.php';
     $this->nome_url_cancelar = 'Cancelar';
     return $retorno;
 }
Beispiel #2
0
 function Gerar()
 {
     $this->titulo = "Di&aacute;rias";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $this->addCabecalhos(array("Secretaria", "Funcion&aacute;rio", "Partida", "Chegada", "Valor", "Nº Di&aacute;ria"));
     if ($_GET['ref_cod_setor']) {
         $this->ref_cod_setor = @$_GET['ref_cod_setor'];
     }
     $lst_setores = array("" => "Selecione");
     $obj_setor = new clsSetor();
     $lst_setor = $obj_setor->lista(null, null, null, null, null, null, null, null, null, null, 0);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $linha) {
             $lst_setores[$linha["cod_setor"]] = $linha["nm_setor"];
         }
     }
     $this->campoLista("ref_cod_setor", "Secretaria", $lst_setores, $this->ref_cod_setor, "", false, "", "", false, false);
     $where = "";
     $gruda = "";
     $where = " WHERE ativo = 't' ";
     if (!empty($_GET['ref_cod_setor'])) {
         $where .= " AND ref_cod_setor = {$this->ref_cod_setor}";
     }
     $db = new clsBanco();
     $db2 = new clsBanco();
     $total = $db->UnicoCampo("SELECT count(0) FROM pmidrh.diaria {$where}");
     // Paginador
     $limite = 15;
     $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
     $strLimit = " LIMIT {$iniciolimit}, {$limite}";
     $objPessoa = new clsPessoaFisica();
     $sql = "SELECT cod_diaria, ref_funcionario, data_partida, data_chegada, COALESCE(vl100,0) + COALESCE(vl75,0) + COALESCE(vl50,0) + COALESCE(vl25,0) AS valor, ref_cod_setor, num_diaria, data_pedido  FROM pmidrh.diaria {$where} ORDER BY num_diaria ASC {$strLimit}";
     $db->Consulta($sql);
     while ($db->ProximoRegistro()) {
         list($cod_diaria, $idpes, $data_partida, $data_chegada, $valor, $ref_cod_setor, $num_diaria, $data_pedido) = $db->Tupla();
         $data_chegada = date("d/m/Y H:i", strtotime($data_chegada));
         $data_partida = date("d/m/Y H:i", strtotime($data_partida));
         if ($ref_cod_setor) {
             $obj_setor = new clsSetor($ref_cod_setor);
             $det_setor = $obj_setor->detalhe();
             $secretaria = $det_setor['nm_setor'];
         } else {
             $secretaria = "";
         }
         list($nome) = $objPessoa->queryRapida($idpes, "nome");
         if (strlen($nome) > 40) {
             $nome = substr($nome, 0, 37);
         }
         $valor = number_format($valor, 2, ",", ".");
         $data = dataFromPgToBr($data_pedido);
         $data = explode("/", $data);
         $num_diaria = sprintf("%06d", $num_diaria);
         $this->addLinhas(array("<a href='diaria_det.php?cod_diaria={$cod_diaria}'><img src='imagens/noticia.jpg' border=0>{$secretaria}</a>", "<a href='diaria_det.php?cod_diaria={$cod_diaria}'>{$nome}</a>", "<a href='diaria_det.php?cod_diaria={$cod_diaria}'>{$data_partida}</a>", "<a href='diaria_det.php?cod_diaria={$cod_diaria}'>{$data_chegada}</a>", "<a href='diaria_det.php?cod_diaria={$cod_diaria}'>{$valor}</a>", "<a href='diaria_det.php?cod_diaria={$cod_diaria}'>{$num_diaria}/{$data[2]}</a>"));
     }
     // Paginador
     $this->addPaginador2("diaria_lst.php", $total, $_GET, $this->nome, $limite);
     $this->acao = "go(\"diaria_cad.php\")";
     $this->nome_acao = "Novo";
     $this->largura = "100%";
 }
 function Gerar()
 {
     @session_start();
     $id_pessoa = $_SESSION['id_pessoa'];
     @session_write_close();
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet", false);
     $this->addCabecalhos(array("Nome do setor"));
     $this->titulo = "Cadastro de Secretaria Respons&aacute;vel";
     // Filtros de Busca
     $setores = array('' => 'Selecione');
     $obj_setor = new clsSetor();
     $obj_setor_lista = $obj_setor->lista(null, null, null, null, null, null, null, null, null, 1, 0, null, null, "nm_setor", null, null, null, null, null, null, $cod_setor);
     if ($obj_setor_lista) {
         foreach ($obj_setor_lista as $secretaria) {
             $setores[$secretaria["cod_setor"]] = $secretaria["sgl_setor"];
         }
     }
     $this->campoLista("setor", "Setor", $setores, $_GET["setor"], '', false, '', '', '', true);
     // Paginador
     $limite = 10;
     $iniciolimit = $_GET["pagina_{$this->__nome}"] ? $_GET["pagina_{$this->__nome}"] * $limite - $limite : 0;
     $Objsetors = new clsPmiacoesSecretariaResponsavel();
     $Objsetors->setLimite($limite, $iniciolimit);
     $Listasetors = $Objsetors->lista($_GET["setor"]);
     if ($Listasetors) {
         foreach ($Listasetors as $setor) {
             $objSetor = new clsSetor();
             $niveis = $objSetor->getNiveis($setor['ref_cod_setor']);
             $strNivel = "";
             $gruda = "";
             sort($niveis);
             if ($niveis) {
                 foreach ($niveis as $nivel) {
                     $objSetor = new clsSetor($nivel);
                     $detalhe = $objSetor->detalhe();
                     $strNivel .= " {$gruda} {$detalhe['sgl_setor']}";
                     $gruda = "&gt;";
                 }
             }
             $this->addLinhas(array("<img src='imagens/noticia.jpg' border=0> <a href='acoes_setor_det.php?cod_setor={$setor['ref_cod_setor']}'>{$strNivel}</a>"));
             $total = $setor['_total'];
         }
     }
     // Paginador
     $this->addPaginador2("acoes_setor_lst.php", $total, $_GET, $this->__nome, $limite);
     $this->acao = "go(\"acoes_setor_cad.php\")";
     $this->nome_acao = "Novo";
     // Define Largura da Página
     $this->largura = "100%";
 }
 function Inicializar()
 {
     $cod_acao_governo = @$_GET['cod_acao_governo'];
     $this->status = @$_GET['status'];
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     if (!(int) $cod_acao_governo) {
         header("Location: acoes_acao_lst.php");
     }
     //Objeto Perturbação
     $obj_acao_governo = new clsPmiacoesAcaoGoverno($cod_acao_governo);
     $det_acao_governo = $obj_acao_governo->detalhe();
     if (!($det_acao_governo = $obj_acao_governo->detalhe())) {
         header("Location: acoes_acao_lst.php");
     }
     $obj_funcionario = new clsFuncionario($this->pessoa_logada);
     $detalhe_func = $obj_funcionario->detalhe();
     $setor_funcionario = $detalhe_func["ref_cod_setor_new"];
     //*
     $obj = new clsSetor();
     $setor_pai = array_shift(array_reverse($obj->getNiveis($setor_funcionario)));
     //*
     $obj_secretaria_responsavel = new clsPmiacoesSecretariaResponsavel($setor_pai);
     $obj_secretaria_responsavel_det = $obj_secretaria_responsavel->detalhe();
     $obj_acao = new clsPmiacoesAcaoGoverno($cod_acao_governo);
     $obj_acao_det = $obj_acao->detalhe();
     $status = $obj_acao_det["status_acao"];
     $isSecom = $setor_pai == 4327 ? true : false;
     if ($obj_secretaria_responsavel_det != false && $status == 0 || $status == 1 || $isSecom) {
         $ac = $this->status ? "incluída" : "removida";
         $obj_acao = new clsPmiacoesAcaoGoverno($cod_acao_governo, null, null, null, null, null, null, null, $this->status);
         if ($obj_acao->edita()) {
             echo "<script>alert('Ação {$ac} com sucesso');window.location=\"acoes_acao_det.php?cod_acao_governo={$cod_acao_governo}\";</script>";
         }
     }
     header("Location: acoes_acao_lst.php");
     die;
 }
 function Gerar()
 {
     $this->titulo = "Detalhe";
     $setor = @$_GET['cod_setor'];
     $objSetor = new clsSetor();
     $niveis = $objSetor->getNiveis($setor);
     $strNivel = "";
     $gruda = "";
     sort($niveis);
     if ($niveis) {
         foreach ($niveis as $nivel) {
             $objSetor = new clsSetor($nivel);
             $detalhe = $objSetor->detalhe();
             $strNivel .= " {$gruda} {$detalhe['sgl_setor']}";
             $gruda = ">";
         }
     }
     $this->addDetalhe(array("Secretaria", $strNivel));
     $this->url_novo = "acoes_setor_cad.php";
     $this->url_editar = "acoes_setor_cad.php?cod_setor={$setor}";
     $this->url_cancelar = "acoes_setor_lst.php";
     $this->largura = "100%";
 }
 function Gerar()
 {
     //	include( "include/form_setor.inc.php" );
     $obj_setores = new clsPmiacoesSecretariaResponsavel();
     $obj_setores->_campos_lista = "ref_cod_setor";
     $obj_lista = $obj_setores->lista();
     if ($obj_lista) {
         unset($obj_lista[array_search($this->setor, $obj_lista)]);
         $not_in = implode(",", $obj_lista);
     }
     $obj_setor = new clsSetor();
     $obj_setor_lista = $obj_setor->lista(null, null, null, null, null, null, null, null, null, 1, 0, null, null, "nm_setor", null, null, null, null, null, $not_in, $cod_setor);
     $setores = array('' => 'Selecione um setor');
     if ($obj_setor_lista) {
         foreach ($obj_setor_lista as $secretaria) {
             $setores[$secretaria["cod_setor"]] = $secretaria["sgl_setor"];
         }
     }
     $this->campoLista("setor", "Setor", $setores, $this->setor, '', false, '', '', '', true);
     $this->campoOculto("pessoa_logada", $this->pessoa_logada);
     $this->campoOculto("cod_setor_old", $this->setor);
 }
Beispiel #7
0
 function Gerar()
 {
     $this->titulo = "Detalhe do valor";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet");
     $cod_diaria = @$_GET['cod_diaria'];
     $db = new clsBanco();
     $db2 = new clsBanco();
     $db->Consulta("SELECT ref_funcionario_cadastro, ref_cod_diaria_grupo, ref_funcionario, conta_corrente, agencia, banco,  dotacao_orcamentaria,  objetivo, data_partida, data_chegada, estadual, destino, data_pedido, vl100,  vl75, vl50, vl25, ref_cod_setor, num_diaria FROM pmidrh.diaria WHERE cod_diaria='{$cod_diaria}'");
     if ($db->ProximoRegistro()) {
         list($ref_funcionario_cadastro, $ref_cod_diaria_grupo, $ref_funcionario, $conta_corrente, $agencia, $banco, $dotacao_orcamentaria, $objetivo, $data_partida, $data_chegada, $estadual, $destino, $data_pedido, $vl100, $vl75, $vl50, $vl25, $ref_cod_setor, $num_diaria) = $db->Tupla();
         $this->addDetalhe(array("N&deg;. do roteiro", "<span style=\"font-size: 14px;font-weight:bold;\">{$cod_diaria}</span>"));
         $objPessoa = new clsPessoa_($ref_funcionario_cadastro);
         $detalhePessoa = $objPessoa->detalhe();
         $this->addDetalhe(array("Ultimo Editor", $detalhePessoa["nome"]));
         $nome_grupo = $db2->CampoUnico("SELECT desc_grupo FROM pmidrh.diaria_grupo WHERE cod_diaria_grupo = '{$ref_cod_diaria_grupo}'");
         $this->addDetalhe(array("Grupo", $nome_grupo));
         $objPessoa = new clsPessoaFisica($ref_funcionario);
         $detalhePessoa = $objPessoa->detalhe();
         $this->addDetalhe(array("Funcion&aacute;rio", $detalhePessoa["nome"]));
         $this->addDetalhe(array("CPF", int2CPF($detalhePessoa["cpf"])));
         $objFuncionario = new clsFuncionario($ref_funcionario);
         $detalheFuncionario = $objFuncionario->detalhe();
         $this->addDetalhe(array("Matricula", $detalheFuncionario["matricula"]));
         $data = dataFromPgToBr($data_pedido);
         $data = explode("/", $data);
         if ($ref_cod_setor) {
             $obj_setor = new clsSetor($ref_cod_setor);
             $det_setor = $obj_setor->detalhe();
             $nm_secretaria = $det_setor['nm_setor'];
             $this->addDetalhe(array("Secretaria", $nm_secretaria));
         }
         $this->addDetalhe(array("Conta Corrente", $conta_corrente));
         if (strlen($agencia) < 5) {
             $agencia = str_repeat("0", 5 - strlen($agencia)) . $agencia;
         }
         if ($agencia) {
             $this->addDetalhe(array("Ag&ecirc;ncia", $agencia));
         }
         if (strlen($banco) < 3) {
             $banco = str_repeat("0", 3 - strlen($banco)) . $banco;
         }
         if ($banco) {
             $this->addDetalhe(array("Banco", $banco));
         }
         if ($dotacao_orcamentaria) {
             $this->addDetalhe(array("Dota&ccedil;&atilde;o or&ccedil;ament&aacute;ria", $dotacao_orcamentaria));
         }
         if ($objetivo) {
             $this->addDetalhe(array("Objetivo", $objetivo));
         }
         if ($data_pedido) {
             $this->addDetalhe(array("Data Pedido", date("d/m/Y", strtotime(substr($data_pedido, 0, 16)))));
         }
         if ($data_partida) {
             $this->addDetalhe(array("Data Partida", date("d/m/Y H:i", strtotime(substr($data_partida, 0, 16)))));
         }
         if ($data_chegada) {
             $this->addDetalhe(array("Data Chegada", date("d/m/Y H:i", strtotime(substr($data_chegada, 0, 16)))));
         }
         $estadual = $estadual ? "Sim" : "N&atilde;o";
         $this->addDetalhe(array("Estadual", $estadual));
         if ($destino) {
             $this->addDetalhe(array("Destino", $destino));
         }
         $this->addDetalhe(array("100%", number_format($vl100, 2, ",", ".")));
         $this->addDetalhe(array("75%", number_format($vl75, 2, ",", ".")));
         $this->addDetalhe(array("50%", number_format($vl50, 2, ",", ".")));
         $this->addDetalhe(array("25%", number_format($vl25, 2, ",", ".")));
         $this->addDetalhe(array("Total", "<span style=\"font-size: 12px;font-weight:bold;border-width:1px;border-color:#000000;border-style:solid;padding:2px;\">" . number_format($vl25 + $vl50 + $vl75 + $vl100, 2, ",", ".") . "</span>"));
         if ($num_diaria) {
             $num_diaria = sprintf("%06d", $num_diaria);
             $this->addDetalhe(array("Nº Di&aacute;ria", "{$num_diaria}/{$data['2']}"));
         }
         $this->url_editar = "diaria_cad.php?cod_diaria={$cod_diaria}";
         $this->array_botao[] = "Arquivo para impressão";
         $this->array_botao_url[] = "diaria_pdf.php?cod_diaria={$cod_diaria}";
     } else {
         $this->addDetalhe(array("Erro", "Codigo de diaria invalido"));
     }
     $this->url_novo = "diaria_cad.php";
     $this->url_cancelar = "diaria_lst.php";
     $this->largura = "100%";
 }
 function Gerar()
 {
     $this->titulo = "Detalhe do Setor";
     $this->cod_setor = @$_GET['cod_setor'];
     $obj_setor = new clsSetor($this->cod_setor);
     $detalhe = $obj_setor->detalhe();
     if (!$detalhe) {
         $this->addDetalhe(array("Erro", "Setor Inexistente"));
     } else {
         $objSetor = new clsSetor($detalhe["cod_setor"]);
         $parentes = $objSetor->getNiveis($detalhe["cod_setor"]);
         $strParentes = "";
         $gruda = "";
         for ($i = 0; $i < count($parentes); $i++) {
             $objSetor = new clsSetor($parentes[$i]);
             $detalheSetor = $objSetor->detalhe();
             $strParentes = " {$detalheSetor["nm_setor"]} - {$detalheSetor["sgl_setor"]}";
             //$gruda = " &gt; ";
             $gruda .= "&nbsp&nbsp&nbsp ";
             if ($i == 0) {
                 $this->addDetalhe(array("Setor", $strParentes));
             } else {
                 $this->addDetalhe(array("Setor", "{$gruda}<img src=\"imagens/nvp_setal.gif\">{$strParentes}"));
             }
         }
         $ref_cod_pessoa_cad = $detalhe["ref_cod_pessoa_cad"];
         $obj_pessoa_fj = new clsPessoaFj($ref_cod_pessoa_cad);
         $det = $obj_pessoa_fj->detalhe();
         $this->addDetalhe(array("Responsável pelo cadastro", $det["nome"]));
         $ativo = $detalhe["ativo"] == 1 ? "Sim" : "Não";
         $this->addDetalhe(array("Ativo", $ativo));
         $no_paco = $detalhe["no_paco"] ? "Sim" : "Não";
         $this->addDetalhe(array("No Paço", $no_paco));
         if ($detalhe["endereco"]) {
             $this->addDetalhe(array("Endereço", $detalhe["endereco"]));
         }
         if ($detalhe["tipo"]) {
             switch ($detalhe["tipo"]) {
                 case "s":
                     $this->addDetalhe(array("Tipo", "Secretaria"));
                     break;
                 case "a":
                     $this->addDetalhe(array("Tipo", "Altarquia"));
                     break;
                 case "f":
                     $this->addDetalhe(array("Tipo", "Fundação"));
                     break;
             }
         }
         if ($detalhe["refIdpesResp"]) {
             $obj_pessoa = new clsPessoa($detalhe["refIdpesResp"]);
             $det_pessoa = $obj_pessoa->detalhe();
             $this->addDetalhe(array("Secretario", $det_pessoa["nome"]));
         }
     }
     if (!is_null($detalhe["ref_cod_setor"])) {
         $this->url_editar = "oprot_setor_cad.php?cod_setor={$this->cod_setor}&setor_atual={$detalhe['ref_cod_setor']}";
     } else {
         $this->url_editar = "oprot_setor_cad.php?cod_setor={$this->cod_setor}";
     }
     $this->url_novo = "oprot_setor_cad.php";
     $this->url_cancelar = "oprot_setor_lst.php";
     $this->largura = "100%";
 }
*	publicada pela Free  Software  Foundation,  tanto  a versão 2 da	 *
*	Licença   como  (a  seu  critério)  qualquer  versão  mais  nova.	 *
*																		 *
*	Este programa  é distribuído na expectativa de ser útil, mas SEM	 *
*	QUALQUER GARANTIA. Sem mesmo a garantia implícita de COMERCIALI-	 *
*	ZAÇÃO  ou  de ADEQUAÇÃO A QUALQUER PROPÓSITO EM PARTICULAR. Con-	 *
*	sulte  a  Licença  Pública  Geral  GNU para obter mais detalhes.	 *
*																		 *
*	Você  deve  ter  recebido uma cópia da Licença Pública Geral GNU	 *
*	junto  com  este  programa. Se não, escreva para a Free Software	 *
*	Foundation,  Inc.,  59  Temple  Place,  Suite  330,  Boston,  MA	 *
*	02111-1307, USA.													 *
*																		 *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
// opcao para selecionar o proximo setor manualmente
$objSetor = new clsSetor();
$listaSetores = array("Selecione");
$lista = $objSetor->lista(null, null, null, null, null, null, null, null, null, 1, 0, null, null, "sgl_setor ASC");
if (is_array($lista) && count($lista)) {
    foreach ($lista as $linha) {
        $listaSetores[$linha["cod_setor"]] = $linha["sgl_setor"];
    }
}
$this->campoLista("setor_0", "Setor", $listaSetores, $this->setor_0, "oproDocumentoNextLvl( this.value, '1' )", true);
$listaVazia = array("-----------");
if ($this->setor_0) {
    $lista1 = array("Selecione");
    $lista = $objSetor->lista($this->setor_0, null, null, null, null, null, null, null, null, 1, null, null, null, "sgl_setor ASC");
    if (is_array($lista) && count($lista)) {
        foreach ($lista as $linha) {
            $lista1[$linha["cod_setor"]] = $linha["sgl_setor"];
 function permiteEditar()
 {
     $retorno = false;
     if ($_SESSION['acao_det'] != $this->cod_acao_governo) {
         return false;
     }
     $obj_funcionario = new clsFuncionario($this->pessoa_logada);
     $detalhe_func = $obj_funcionario->detalhe();
     $setor_funcionario = $detalhe_func["ref_cod_setor_new"];
     //*
     $obj = new clsSetor();
     $setor_pai = array_shift(array_reverse($obj->getNiveis($setor_funcionario)));
     //*
     $obj_secretaria_responsavel = new clsPmiacoesSecretariaResponsavel($setor_pai);
     $obj_secretaria_responsavel_det = $obj_secretaria_responsavel->detalhe();
     $obj_acao = new clsPmiacoesAcaoGoverno($this->cod_acao_governo);
     $obj_acao_det = $obj_acao->detalhe();
     $status = $obj_acao_det["status_acao"];
     //**
     $func_cad = $obj_acao_det["ref_funcionario_cad"];
     $obj_funcionario = new clsFuncionario($func_cad);
     $detalhe_func = $obj_funcionario->detalhe();
     $setor_cad = $detalhe_func["ref_cod_setor_new"];
     $setor_cad = array_shift(array_reverse($obj->getNiveis($setor_cad)));
     //**
     //$isSecom = $setor_pai == 4327 ? true : false;
     $retorno = $obj_secretaria_responsavel_det != false && $status == 0 || $setor_cad == $setor_pai && $status == 0 || $obj_secretaria_responsavel_det != false && $status == 1 ? true : false;
     return $retorno;
 }
 /**
  * Construtor (PHP 4)
  *
  * @return object
  */
 function clsPmiacoesSecretariaResponsavel($ref_cod_setor = null, $ref_cod_funcionario_cad = null, $data_cadastro = null)
 {
     $db = new clsBanco();
     $this->_schema = "pmiacoes.";
     $this->_tabela = "{$this->_schema}secretaria_responsavel";
     $this->_campos_lista = $this->_todos_campos = "ref_cod_setor, ref_cod_funcionario_cad, data_cadastro";
     if (is_numeric($ref_cod_setor)) {
         $tmp_obj = new clsSetor($ref_cod_setor);
         if ($tmp_obj->detalhe()) {
             $this->ref_cod_setor = $ref_cod_setor;
         }
     }
     if (is_numeric($ref_cod_funcionario_cad)) {
         $tmp_obj = new clsFuncionario($ref_cod_funcionario_cad);
         if ($tmp_obj->detalhe()) {
             $this->ref_cod_funcionario_cad = $ref_cod_funcionario_cad;
         }
     }
     if (is_string($data_cadastro)) {
         $this->data_cadastro = $data_cadastro;
     }
 }
 function RenderHTML()
 {
     $retorno = "<br>";
     $espaco_padrao = "&nbsp; &nbsp;";
     $objSetor = new clsSetor();
     $lista0 = $objSetor->lista(null, null, null, null, null, null, null, null, null, 1, 0);
     if (is_array($lista0)) {
         foreach ($lista0 as $linha0) {
             $espacamento = array();
             for ($i = 0; $i < 1; $i++) {
                 $espacamento[$i] = $espaco_padrao;
             }
             $tabulacao = implode("|", $espacamento);
             $retorno .= "<br>{$tabulacao}+ <a href='oprot_setor_det.php?cod_setor={$linha0["cod_setor"]}'><b>{$linha0["nm_setor"]} - <i>{$linha0["sgl_setor"]}</i></b></a><br>";
             // prox nivel
             $lista1 = $objSetor->lista($linha0["cod_setor"]);
             if (is_array($lista1)) {
                 foreach ($lista1 as $linha1) {
                     $espacamento = array();
                     for ($i = 0; $i < 2; $i++) {
                         $espacamento[$i] = $espaco_padrao;
                     }
                     $tabulacao = implode("|", $espacamento);
                     $retorno .= "{$tabulacao}+ <a href='oprot_setor_det.php?cod_setor={$linha1["cod_setor"]}'>{$linha1["nm_setor"]} - <i>{$linha1["sgl_setor"]}</i></a><br>";
                     // prox nivel
                     $lista2 = $objSetor->lista($linha1["cod_setor"]);
                     if (is_array($lista2)) {
                         foreach ($lista2 as $linha2) {
                             $espacamento = array();
                             for ($i = 0; $i < 3; $i++) {
                                 $espacamento[$i] = $espaco_padrao;
                             }
                             $tabulacao = implode("|", $espacamento);
                             $retorno .= "{$tabulacao}+ <a href='oprot_setor_det.php?cod_setor={$linha2["cod_setor"]}'>{$linha2["nm_setor"]} - <i>{$linha2["sgl_setor"]}</i></a><br>";
                             // prox nivel
                             $lista3 = $objSetor->lista($linha2["cod_setor"]);
                             if (is_array($lista3)) {
                                 foreach ($lista3 as $linha3) {
                                     $espacamento = array();
                                     for ($i = 0; $i < 4; $i++) {
                                         $espacamento[$i] = $espaco_padrao;
                                     }
                                     $tabulacao = implode("|", $espacamento);
                                     $retorno .= "{$tabulacao}+ <a href='oprot_setor_det.php?cod_setor={$linha3["cod_setor"]}'>{$linha3["nm_setor"]} - <i>{$linha3["sgl_setor"]}</i></a><br>";
                                     // prox nivel
                                     $lista4 = $objSetor->lista($linha3["cod_setor"]);
                                     if (is_array($lista4)) {
                                         foreach ($lista4 as $linha4) {
                                             $espacamento = array();
                                             for ($i = 0; $i < 5; $i++) {
                                                 $espacamento[$i] = $espaco_padrao;
                                             }
                                             $tabulacao = implode("|", $espacamento);
                                             $retorno .= "{$tabulacao}+ <a href='oprot_setor_det.php?cod_setor={$linha4["cod_setor"]}'>{$linha4["nm_setor"]} - <i>{$linha4["sgl_setor"]}</i></a><br>";
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     /*
     $db1 = new clsBanco();
     $db2 = new clsBanco();
     $db3 = new clsBanco();
     
     
     $retorno = "<br>";
     $db1->Consulta( "SELECT cod_administracao_secretaria, nm_secretaria, sigla FROM administracao_secretaria ORDER BY nm_secretaria" );
     while ( $db1->ProximoRegistro() )
     {
     	list( $cod_secretaria, $nm_secretaria, $sigla ) = $db1->Tupla();
     	$retorno .= "&nbsp;&nbsp;<a href='administracao_secretaria_det.php?cod={$cod_secretaria}'><b>{$nm_secretaria} - <i>{$sigla}</i></b></a><br>";
     	
     	$db2->Consulta("SELECT ref_cod_administracao_secretaria, cod_departamento, nm_departamento FROM administracao_departamento WHERE ref_cod_administracao_secretaria={$cod_secretaria} ORDER BY nm_departamento");
     	while ($db2->ProximoRegistro())
     	{
     		list ($ref_cod_secretaria, $cod_departamento, $nm_departamento) = $db2->Tupla();
     			$retorno .= "&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;- <a href='administracao_departamento_det.php?cod_departamento={$cod_departamento}&ref_cod_administracao_secretaria={$ref_cod_secretaria}'>{$nm_departamento}</a><br>";
     		
     		$db3->Consulta("SELECT ref_ref_cod_administracao_secretaria, ref_cod_departamento, cod_setor, nm_setor FROM administracao_setor WHERE ref_ref_cod_administracao_secretaria={$ref_cod_secretaria} AND ref_cod_departamento={$cod_departamento} ORDER BY nm_setor");
     		while ($db3->ProximoRegistro())
     		{
     			list ($ref_ref_cod_secretaria, $ref_cod_departamento, $cod_setor, $nm_setor) = $db3->Tupla();
     			$retorno .= "&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;- <a href='administracao_setor_det.php?cod_setor={$cod_setor}&ref_cod_departamento={$ref_cod_departamento}&ref_ref_cod_administracao_secretaria={$ref_ref_cod_secretaria}'>{$nm_setor}</a><br>";
     		}
     		$db3->Libera();
     	}
     	$db2->Libera();
     }
     $db1->Libera();
     */
     return $retorno . "<br><br>";
 }
 function Gerar()
 {
     @session_start();
     $obj_setor = new clsSetor();
     $this->nome = "form1";
     $this->funcAcaoNome = $this->nome;
     $total = 0;
     $id_pesssoa = $_SESSION['id_pessoa'];
     $this->titulo = "Setores";
     $this->addBanner("imagens/nvp_top_intranet.jpg", "imagens/nvp_vert_intranet.jpg", "Intranet", false);
     // Paginador
     $limite = 10;
     $iniciolimit = $_GET["pagina_{$this->nome}"] ? $_GET["pagina_{$this->nome}"] * $limite - $limite : 0;
     /*
     	Filtro
     */
     foreach ($_GET as $key => $value) {
         $this->{$key} = $value;
     }
     $this->nm_setor = $_GET["nm_setor"] ? $_GET["nm_setor"] : null;
     $this->sgl_setor = $_GET["sgl_setor"] ? $_GET["sgl_setor"] : null;
     include "include/form_setor.inc.php";
     $this->campoTexto("nm_setor", "Nome do Setor", $this->nm_setor, 30, 255);
     $this->campoTexto("sgl_setor", "Sigla do Setor", $this->sgl_setor, 30, 255);
     /*
     	Fim Filtro
     */
     $this->addCabecalhos(array("Setor"));
     if ($this->nm_setor || $this->sgl_setor) {
         $lista = $obj_setor->lista(null, nul, null, $this->nm_setor, $this->sgl_setor, null, null, null, null, 1, null, null, null, "nm_setor");
         if ($lista) {
             foreach ($lista as $key => $valor) {
                 $niveis = $obj_setor->getNiveis($valor["cod_setor"]);
                 $str = "";
                 for ($i = 0; $i < count($niveis); $i++) {
                     $obj = new clsSetor($niveis[$i]);
                     $det = $obj->detalhe();
                     if ($i == 0) {
                         if ($det["sgl_setor"] == $this->sgl_setor) {
                             $str .= "<b>{$det['sgl_setor']}</b>";
                             $cod_setor = $det["cod_setor"];
                         } else {
                             $str .= "{$det['sgl_setor']}";
                         }
                     } else {
                         if ($det["sgl_setor"] == $this->sgl_setor) {
                             $str .= " > <b>{$det['sgl_setor']}</b>";
                             $cod_setor = $det["cod_setor"];
                         } else {
                             $str .= " > {$det['sgl_setor']}";
                         }
                     }
                 }
                 $this->addLinhas(array("<a href=oprot_setor_det.php?cod_setor={$cod_setor}>{$str}</a>"));
                 $total++;
             }
         }
     } else {
         if ($this->setor_0) {
             $objSetores = new clsSetor($this->setor_0);
             $listaSetores0[] = $objSetores->detalhe();
         } else {
             $objSetores = new clsSetor();
             $listaSetores0 = $objSetores->lista(null, null, null, null, null, null, null, null, null, 1, 0);
         }
         if ($listaSetores0) {
             foreach ($listaSetores0 as $key0 => $valor0) {
                 $this->addLinhas(array("<a href=oprot_setor_det.php?cod_setor={$valor0["cod_setor"]}>{$valor0['sgl_setor']}</a>"));
                 $total++;
                 if ($this->setor_1) {
                     $objSetores = new clsSetor($this->setor_1);
                     $listaSetores1[] = $objSetores->detalhe();
                 } else {
                     $objSetores = new clsSetor();
                     $listaSetores1 = $objSetores->lista($valor0["cod_setor"], null, null, null, null, null, null, null, null, 1, 1);
                 }
                 if ($listaSetores1) {
                     foreach ($listaSetores1 as $key1 => $valor1) {
                         $a = "<font color=#9EA3A9>{$valor0['sgl_setor']} ></font> {$valor1['sgl_setor']}";
                         $this->addLinhas(array("<a href=oprot_setor_det.php?cod_setor={$valor1['cod_setor']}>{$a}</a></font>"));
                         $total++;
                         if ($this->setor_2) {
                             $objSetores = new clsSetor($this->setor_2);
                             $listaSetores2[] = $objSetores->detalhe();
                         } else {
                             $objSetores = new clsSetor();
                             $listaSetores2 = $objSetores->lista($valor1["cod_setor"], null, null, null, null, null, null, null, null, 1, 2);
                         }
                         if ($listaSetores2) {
                             foreach ($listaSetores2 as $key2 => $valor2) {
                                 $a = "<font color=#9EA3A9>{$valor0['sgl_setor']} > {$valor1['sgl_setor']} ></font> {$valor2['sgl_setor']}";
                                 $this->addLinhas(array("<a href=oprot_setor_det.php?cod_setor={$valor2['cod_setor']}>{$a}</a></font>"));
                                 $total++;
                                 if ($this->setor_3) {
                                     $objSetores = new clsSetor($this->setor_3);
                                     $listaSetores3[] = $objSetores->detalhe();
                                 } else {
                                     $objSetores = new clsSetor();
                                     $listaSetores3 = $objSetores->lista($valor2["cod_setor"], null, null, null, null, null, null, null, null, 1, 3);
                                 }
                                 if ($listaSetores3) {
                                     foreach ($listaSetores3 as $key3 => $valor3) {
                                         $a = "<font color=#9EA3A9>{$valor0['sgl_setor']} > {$valor1['sgl_setor']} > {$valor2['sgl_setor']} > </font>{$valor3['sgl_setor']} ";
                                         $this->addLinhas(array("<a href=oprot_setor_det.php?cod_setor={$valor3['cod_setor']}>{$a}</a></font>"));
                                         $total++;
                                         if ($this->setor_4) {
                                             $objSetores = new clsSetor($this->setor_4);
                                             $listaSetores4[] = $objSetores->detalhe();
                                         } else {
                                             $objSetores = new clsSetor();
                                             $listaSetores4 = $objSetores->lista($valor3["cod_setor"], null, null, null, null, null, null, null, null, 1, 4);
                                         }
                                         if ($listaSetores4) {
                                             foreach ($listaSetores4 as $key4 => $valor4) {
                                                 $a = "<font color=#9EA3A9>{$valor0['sgl_setor']} > {$valor1['sgl_setor']} > {$valor2['sgl_setor']} > {$valor3['sgl_setor']} ></font> {$valor4['sgl_setor']}";
                                                 $this->addLinhas(array("<a href=oprot_setor_det.php?cod_setor={$valor4['cod_setor']}>{$a}</a></font>"));
                                                 $total++;
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $this->acao = "go(\"oprot_setor_cad.php\")";
     $this->nome_acao = "Novo";
     $this->largura = "100%";
     @session_write_close();
 }
 * ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral
 * do GNU para mais detalhes.
 *
 * Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto
 * com este programa; se não, escreva para a Free Software Foundation, Inc., no
 * endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
 *
 * @author    Prefeitura Municipal de Itajaí <*****@*****.**>
 * @category  i-Educar
 * @license   @@license@@
 * @package   iEd
 * @since     Arquivo disponível desde a versão 1.0.0
 * @version   $Id$
 */
header('Content-type: text/xml');
require_once 'include/pmidrh/geral.inc.php';
require_once 'Portabilis/Utils/DeprecatedXmlApi.php';
Portabilis_Utils_DeprecatedXmlApi::returnEmptyQueryUnlessUserIsLoggedIn();
echo '<?xml version="1.0" encoding="ISO-8859-15"?>' . "\n";
echo '<query xmlns="sugestoes">' . "\n";
if (isset($_GET['setor_pai'])) {
    $obj = new clsSetor();
    $lista = $obj->lista($_GET['setor_pai']);
    if ($lista) {
        foreach ($lista as $linha) {
            echo '  <item>' . $linha['sgl_setor'] . '</item>' . "\n";
            echo '  <item>' . $linha['cod_setor'] . '</item>' . "\n";
        }
    }
}
echo '</query>';
Beispiel #15
0
 function Gerar()
 {
     @session_start();
     $this->pessoaFj = $_SESSION['id_pessoa'];
     session_write_close();
     $this->campoOculto("pessoaFj", $this->pessoaFj);
     $this->campoOculto("cod_diaria", $this->cod_diaria);
     if ($this->num_diaria) {
         $this->campoOculto("num_diaria", $this->num_diaria);
     }
     // Campo listaPesq de Funcionario
     $lista = array();
     if ($this->ref_funcionario) {
         $objPessoa = new clsPessoaFJ($this->ref_funcionario);
         $detalhe = $objPessoa->detalhe();
         if ($detalhe) {
             $lista[$detalhe["idpes"]] = $detalhe["nome"];
             $lista[""] = "Pesquise outras pessoas clicando no botao ao lado";
         } else {
             $lista[""] = "Pesquise a pessoa clicando no botao ao lado";
         }
     } else {
         $lista[""] = "Pesquise a pessoa clicando no botao ao lado";
     }
     $parametros = new clsParametrosPesquisas();
     $parametros->setSubmit(0);
     $parametros->adicionaCampoSelect("ref_funcionario", "ref_cod_pessoa_fj", "nome");
     $this->campoListaPesq("ref_funcionario", "Funcion&aacute;rio", $lista, $this->ref_funcionario, "pesquisa_funcionario_lst.php", "", false, "", "", null, null, "", false, $parametros->serializaCampos());
     $grupo = array();
     $grupo[""] = "Selecione o grupo";
     $db = new clsBanco();
     $db->Consulta("SELECT cod_diaria_grupo, desc_grupo FROM pmidrh.diaria_grupo ORDER BY cod_diaria_grupo ASC");
     while ($db->ProximoRegistro()) {
         list($cod_grupo, $nome) = $db->Tupla();
         $grupo[$cod_grupo] = $nome;
     }
     $this->campoLista("ref_cod_diaria_grupo", "Grupo de di&aacute;ria", $grupo, $this->ref_cod_diaria_grupo, "diaria_carrega_valores();");
     $lst_setores = array("" => "Selecione");
     $obj_setor = new clsSetor();
     $lst_setor = $obj_setor->lista(null, null, null, null, null, null, null, null, null, null, 0);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $linha) {
             $lst_setores[$linha["cod_setor"]] = $linha["nm_setor"];
         }
     }
     $this->campoLista("ref_cod_setor", "Secretaria", $lst_setores, $this->ref_cod_setor, "diaria_carrega_valores();");
     $this->campoTexto("conta_corrente", "Conta corrente", $this->conta_corrente, 10, 10);
     if (!$this->banco) {
         $this->banco = "001";
     }
     if (!$this->agencia) {
         $this->agencia = "03050";
     }
     $this->campoTexto("agencia", "Ag&ecirc;ncia", $this->agencia, 10, 10);
     $this->campoTexto("banco", "Banco", $this->banco, 10, 10);
     $this->campoTexto("dotacao_orcamentaria", "Dota&ccedil;&atilde;o Or&ccedil;ament&aacute;ria", $this->dotacao_orcamentaria, 50, 50);
     $this->campoMemo("objetivo", "Objetivo", $this->objetivo, 48, 2);
     if ($this->data_pedido) {
         $this->data_pedido = date("d/m/Y", strtotime(substr($this->data_pedido, 0, 16)));
     }
     $this->campoData("data_pedido", "Data para Empenho", $this->data_pedido, true);
     if ($this->data_partida) {
         $this->hora_partida = date("H:i", strtotime($this->data_partida));
         $this->data_partida = date("d/m/Y", strtotime($this->data_partida));
     }
     $this->campoData("data_partida", "Data de Partida", $this->data_partida, false, false, false, "onBlur=\"diaria_carrega_valores();\"");
     $this->campoHora("hora_partida", "Hora de Partida", $this->hora_partida, false, false, "onBlur=\"diaria_carrega_valores();\"");
     if ($this->data_chegada) {
         $this->hora_chegada = date("H:i", strtotime($this->data_chegada));
         $this->data_chegada = date("d/m/Y", strtotime($this->data_chegada));
     }
     $this->campoData("data_chegada", "Data de Chegada", $this->data_chegada, false, false, false, "onBlur=\"diaria_carrega_valores();\"");
     $this->campoHora("hora_chegada", "Hora de Chegada", $this->hora_chegada, false, false, "onBlur=\"diaria_carrega_valores();\"");
     if (!is_numeric($this->estadual)) {
         $this->estadual = 1;
     }
     $this->campoLista("estadual", "Estadual", array("N&atilde;o", "Sim"), $this->estadual, "diaria_carrega_valores();");
     $this->campoTexto("destino", "Destino", $this->destino, 50, 100);
     $this->campoTexto("vl100", "Valor 100%", number_format($this->vl100, 2, ',', '.'), 20, 20, false, false, true);
     $this->campoTextoInv("sug100", " &nbsp; &nbsp; Valor sugerido", "", 10, 10);
     $this->campoTexto("vl75", "Valor 75%", number_format($this->vl75, 2, ',', '.'), 20, 20, false, false, true);
     $this->campoTextoInv("sug75", " &nbsp; &nbsp; Valor sugerido", "", 10, 10);
     $this->campoTexto("vl50", "Valor 50%", number_format($this->vl50, 2, ',', '.'), 20, 20, false, false, true);
     $this->campoTextoInv("sug50", " &nbsp; &nbsp; Valor sugerido", "", 10, 10);
     $this->campoTexto("vl25", "Valor 25%", number_format($this->vl25, 2, ',', '.'), 20, 20, false, false, true);
     $this->campoTextoInv("sug25", " &nbsp; &nbsp; Valor sugerido", "", 10, 10);
     $this->campoRotulo("copia", "Copiar", "<a href=\"#bottom\" onclick=\"diaria_copia_valores();\">Clique aqui para copiar os valores sugeridos.</a>", false, "<script type=\"text/javascript\">diaria_carrega_valores();</script>");
 }
 /**
  * Construtor (PHP 4)
  *
  * @return object
  */
 function clsPmiacoesAcaoGovernoSetor($ref_cod_acao_governo = null, $ref_cod_setor = null, $ref_funcionario_cad = null, $data_cadastro = null)
 {
     $db = new clsBanco();
     $this->_schema = "pmiacoes.";
     $this->_tabela = "{$this->_schema}acao_governo_setor";
     $this->_campos_lista = $this->_todos_campos = "ref_cod_acao_governo, ref_cod_setor, ref_funcionario_cad, data_cadastro";
     if (is_numeric($ref_cod_acao_governo)) {
         $tmp_obj = new clsPmiacoesAcaoGoverno($ref_cod_acao_governo);
         if ($tmp_obj->detalhe()) {
             $this->ref_cod_acao_governo = $ref_cod_acao_governo;
         }
     }
     if (is_numeric($ref_cod_setor)) {
         $tmp_obj = new clsSetor($ref_cod_setor);
         if ($tmp_obj->detalhe()) {
             $this->ref_cod_setor = $ref_cod_setor;
         }
     }
     if (is_numeric($ref_funcionario_cad)) {
         $tmp_obj = new clsFuncionario($ref_funcionario_cad);
         if ($tmp_obj->detalhe()) {
             $this->ref_funcionario_cad = $ref_funcionario_cad;
         }
     }
     if (is_string($data_cadastro)) {
         $this->data_cadastro = $data_cadastro;
     }
 }
 function Gerar()
 {
     $this->campoOculto("ref_pessoa", $this->ref_pessoa);
     if (is_numeric($this->ref_pessoa)) {
         $this->campoOculto("confere_senha", $this->confere_senha);
     }
     //--------------------------------------------------------------------
     if ($_POST) {
         foreach ($_POST as $campo => $val) {
             $this->{$campo} = $this->{$campo} ? $this->{$campo} : $val;
         }
     }
     //--------------------------------------------------------------------
     $this->ref_cod_setor_new = 0;
     if (!$this->ref_cod_setor_new && is_numeric($this->ref_pessoa)) {
         $objFuncionario = new clsPortalFuncionario($this->ref_pessoa);
         $detFunc = $objFuncionario->detalhe();
         $this->ref_cod_setor_new = $detFunc["ref_cod_setor_new"];
     }
     if ($this->ref_cod_setor_new) {
         $objSetor = new clsSetor();
         $parentes = $objSetor->getNiveis($this->ref_cod_setor_new);
         for ($i = 0; $i < 5; $i++) {
             if (isset($parentes[$i]) && $parentes[$i]) {
                 $nmvar = "setor_{$i}";
                 $this->{$nmvar} = $parentes[$i];
             }
         }
     }
     //--------------------------------------------------------------------
     if ($_GET["ref_pessoa"]) {
         $obj_funcionario = new clsPessoaFj($this->ref_pessoa);
         $det_funcionario = $obj_funcionario->detalhe();
         $this->nome = $det_funcionario["nome"];
         $this->campoRotulo("nome", "Nome", $this->nome);
     } else {
         $parametros = new clsParametrosPesquisas();
         $parametros->setSubmit(1);
         $parametros->setPessoa("F");
         $parametros->setPessoaNovo('S');
         $parametros->setPessoaEditar('N');
         $parametros->setPessoaTela("frame");
         $parametros->setPessoaCPF('N');
         $parametros->adicionaCampoTexto("nome", "nome");
         $parametros->adicionaCampoTexto("nome_busca", "nome");
         $parametros->adicionaCampoTexto("ref_pessoa", "idpes");
         $this->campoTextoPesquisa("nome_busca", "Nome", $this->nome, 30, 255, true, "pesquisa_pessoa_lst.php", false, false, "", "", $parametros->serializaCampos() . "&busca=S", true);
         $this->campoOculto("nome", $this->nome);
         $this->campoOculto("ref_pessoa", $this->ref_pessoa);
     }
     $this->campoTexto("matricula", "Matr&iacute;cula", $this->matricula, 12, 12, true);
     $this->campoSenha("_senha", "Senha", $this->_senha, true);
     $this->campoEmail("email", "E-mail usuário", $this->email, 50, 50, false, false, false, 'Utilizado para redefinir a senha, caso o usúario esqueça<br />Este campo pode ser gravado em branco, neste caso será solicitado um e-mail ao usuário, após entrar no sistema.');
     $obj_setor = new clsSetor();
     $lst_setor = $obj_setor->lista(null, null, null, null, null, null, null, null, null, 1, 0);
     $opcoes = array("" => "Selecione");
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     }
     $this->campoLista("setor_0", "Setor", $opcoes, $this->setor_0, "oproDocumentoNextLvl( this.value, '1' )", NULL, NULL, NULL, NULL, FALSE);
     $lst_setor = $obj_setor->lista($this->setor_0);
     $opcoes = array("" => "Selecione");
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     } else {
         $opcoes[""] = "---------";
     }
     $this->campoLista("setor_1", "Subsetor 1", $opcoes, $this->setor_1, "oproDocumentoNextLvl(this.value, '2')", false, "", "", $this->setor_0 == "" ? true : false, false);
     $opcoes = array("" => "Selecione");
     $lst_setor = $obj_setor->lista($this->setor_1);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     } else {
         $opcoes[""] = "---------";
     }
     $this->campoLista("setor_2", "Subsetor 2", $opcoes, $this->setor_2, "oproDocumentoNextLvl(this.value, '3')", false, "", "", $this->setor_1 == "" ? true : false, false);
     $opcoes = array("" => "Selecione");
     $lst_setor = $obj_setor->lista($this->setor_2);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     } else {
         $opcoes[""] = "---------";
     }
     $this->campoLista("setor_3", "Subsetor 3", $opcoes, $this->setor_3, "oproDocumentoNextLvl(this.value, '4')", false, "", "", $this->setor_2 == "" ? true : false, false);
     $opcoes = array("" => "Selecione");
     $lst_setor = $obj_setor->lista($this->setor_3);
     if (is_array($lst_setor) && count($lst_setor)) {
         foreach ($lst_setor as $setor) {
             $opcoes[$setor["cod_setor"]] = $setor["sgl_setor"];
         }
     } else {
         $opcoes[""] = "---------";
     }
     $this->campoLista("setor_4", "Subsetor 4", $opcoes, $this->setor_4, "oproDocumentoNextLvl(this.value, '5')", false, "", "", $this->setor_3 == "" ? true : false, false);
     $opcoes = array(0 => "Inativo", 1 => "Ativo");
     $this->campoLista("ativo", "Status", $opcoes, $this->ativo);
     $opcoes = array("" => "Selecione", 5 => "Comissionado", 4 => "Contratado", 3 => "Efetivo", 6 => "Estagi&aacute;rio");
     $this->campoLista("ref_cod_funcionario_vinculo", "V&iacute;nculo", $opcoes, $this->ref_cod_funcionario_vinculo);
     $opcoes = array("" => "Selecione", 5 => "5", 6 => "6", 7 => "7", 10 => "10", 14 => "14", 20 => "20", 21 => "21", 28 => "28", 30 => "30", 35 => "35", 60 => "60", 90 => "90", 120 => "120", 150 => "150", 180 => "180", 210 => "210", 240 => "240", 270 => "270", 300 => "300", 365 => "365");
     $this->campoLista("tempo_expira_conta", "Dias p/ expirar a conta", $opcoes, $this->tempo_expira_conta);
     $tempoExpiraSenha = $GLOBALS['coreExt']['Config']->app->user_accounts->default_password_expiration_period;
     if (is_numeric($tempoExpiraSenha)) {
         $this->campoOculto("tempo_expira_senha", $tempoExpiraSenha);
     } else {
         $opcoes = array('' => 'Selecione', 5 => '5', 30 => '30', 60 => '60', 90 => '90', 120 => '120', 180 => '180');
         $this->campoLista("tempo_expira_senha", "Dias p/ expirar a senha", $opcoes, $this->tempo_expira_senha);
     }
     $this->campoTexto("ramal", "Ramal", $this->ramal, 11, 30);
     $opcoes = array(null => "Não", 'S' => "Sim");
     $this->campoLista("super", "Super usu&aacute;rio", $opcoes, $this->super, '', false, '', '', false, false);
     $opcoes = array(null => "Não", 1 => "Sim");
     $this->campoLista("proibido", "Banido", $opcoes, $this->proibido, '', false, '', '', false, false);
     $opcoes = array(null => "Não", 1 => "Sim");
     $this->campoLista("matricula_permanente", "Matr&iacute;cula permanente", $opcoes, $this->matricula_permanente, '', false, '', '', false, false);
     //-----------------------------------------------------------------------------------------------
     $this->campoRotulo("rotulo_permissoes", "<b><i>Permiss&otilde;es</i></b>", "");
     $obj_menu = new clsPortalMenuMenu();
     $obj_menu->setOrderby("nm_menu ASC");
     $lst_menu = $obj_menu->lista();
     //busca todos os submenus liberado para o funcionario
     if (is_numeric($this->ref_pessoa)) {
         $obj_menu_funcionario = new clsPortalMenuFuncionario($this->ref_pessoa);
         $lst_menu_funcionario = $obj_menu_funcionario->lista(null, null, $this->ref_pessoa);
         if (is_array($lst_menu_funcionario) && count($lst_menu_funcionario)) {
             foreach ($lst_menu_funcionario as $id_submenu) {
                 $array_submenu[] = $id_submenu["ref_cod_menu_submenu"];
             }
         }
     }
     if (is_array($lst_menu) && count($lst_menu)) {
         foreach ($lst_menu as $key => $menu) {
             $array_valores = array();
             if ($menu["cod_menu_menu"] != 1) {
                 /*					if( $menu['nm_menu'] == "i-Frotas")
                 					{
                 						echo $menu["cod_menu_menu"];
                 					}*/
                 $obj_submenu = new clsPortalMenuSubmenu();
                 $obj_submenu->setOrderby("nm_submenu ASC");
                 $lst_submenu = $obj_submenu->lista($menu["cod_menu_menu"], 2);
                 $opcoes = array("" => "Selecione");
                 if (is_array($lst_submenu) && count($lst_submenu)) {
                     foreach ($lst_submenu as $submenu) {
                         $opcoes[$submenu["cod_menu_submenu"]] = $submenu["nm_submenu"];
                     }
                 }
                 if (is_numeric($this->ref_pessoa)) {
                     if (is_array($array_submenu) && count($array_submenu)) {
                         //faz a interseccao dos submenus do funcionario e os submenus do menu atual (do foreach)
                         $array_menu_submenu = array_intersect(array_flip($opcoes), $array_submenu);
                     }
                     $contador = 0;
                     if (is_array($array_menu_submenu) && count($array_menu_submenu)) {
                         //monta a matriz que conterao os valores da tabela (do BD)
                         foreach ($array_menu_submenu as $id_submenu) {
                             $obj_menu_funcionario = new clsPortalMenuFuncionario($this->ref_pessoa, null, null, $id_submenu);
                             $det_menu_funcionario = $obj_menu_funcionario->detalhe();
                             $array_valores[$contador][] = $det_menu_funcionario["ref_cod_menu_submenu"];
                             $array_valores[$contador][] = $det_menu_funcionario["cadastra"];
                             $array_valores[$contador++][] = $det_menu_funcionario["exclui"];
                         }
                     }
                 }
                 $this->campoTabelaInicio(str_replace(" ", "_", limpa_acentos(strtolower($menu["nm_menu"]))), $menu["nm_menu"], array("Submenu", "Cadastrar", "Excluir"), $array_valores, "500");
                 $this->campoLista(str_replace(" ", "_", limpa_acentos(strtolower($menu["nm_menu"]))) . "_", "", $opcoes, "", "", false, "", "", false, false);
                 $this->campoCheck("cad_" . str_replace(" ", "_", limpa_acentos(strtolower($menu["nm_menu"]))), "", "");
                 $this->campoCheck("exc_" . str_replace(" ", "_", limpa_acentos(strtolower($menu["nm_menu"]))), "", "");
                 $this->campoTabelaFim();
             }
         }
     }
 }
Beispiel #18
0
 /**
  * Função retorna o nome completo (com os niveis acima) de um setor
  *
  * @return string
  */
 function getNomeFamilia($intRefCodSetor, $separador = " &gt; ", $sigla = false)
 {
     $campo = $sigla ? "sgl_setor" : "nm_setor";
     $nome = array();
     $niveis = $this->getNiveis($intRefCodSetor);
     for ($i = 0; $i < count($niveis); $i++) {
         $objSetor = new clsSetor($niveis[$i]);
         $det = $objSetor->detalhe();
         $nome[] = $det[$campo];
     }
     return implode($separador, $nome);
 }
 function detAcoes($cod_acao_governo)
 {
     $existe = false;
     $obj_categoria = new clsPmiacoesAcaoGovernoCategoria();
     $obj_categoria->_campos_lista = "ref_cod_categoria";
     $lista_categoria = $obj_categoria->lista(null, $cod_acao_governo);
     $tabela = "<table border=0 cellpadding=2 width='100%'>";
     if ($lista_categoria) {
         $existe = true;
         $tabela .= "<tr bgcolor={$cor}><td colspan='2'><b>Categorias</b></td></tr><tr><td>";
         $tabela .= "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" align=\"left\" width='50%'>";
         $tabela .= "<tr bgcolor='#A1B3BD'><th>Categoria</th><th width='70'>Excluir</th></tr>";
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         foreach ($lista_categoria as $categoria) {
             $obj_nm_categoria = new clsPmiacoesCategoria($categoria);
             $det_categoria = $obj_nm_categoria->detalhe();
             $tabela .= "<tr bgcolor='{$cor}'><td style='padding-left:20px'><img src=\"imagens/noticia.jpg\" border='0'> {$det_categoria['nm_categoria']}</td><td><a href='acoes_categoria.php?cod_acao_governo={$cod_acao_governo}&remover_categoria={$categoria}&display=inline' ><img src=\"imagens/nvp_bola_xis.gif\" border=0 style='padding-left:10px;'></a></td></tr>";
         }
         $tabela .= "</table></td></tr>";
     }
     $obj_setores = new clsPmiacoesAcaoGovernoSetor();
     $obj_setores->_campos_lista = "ref_cod_setor";
     $lista_setores = $obj_setores->lista($cod_acao_governo);
     if ($lista_setores) {
         $existe = true;
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         $tabela .= "<tr bgcolor={$cor}><td colspan='2'><b>Setores</b></td></tr><tr><td>";
         $tabela .= "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" align=\"left\" width='50%'>";
         $tabela .= "<tr bgcolor='#A1B3BD'><th>Setor</th><th width='70'>Excluir</th></tr>";
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         foreach ($lista_setores as $setores) {
             $obj_nm_setor = new clsSetor($setores);
             $det_setor = $obj_nm_setor->detalhe();
             $tabela .= "<tr bgcolor='{$cor}'><td style='padding-left:20px'><img src=\"imagens/noticia.jpg\" border='0'> {$det_setor['sgl_setor']}</td><td><a href='acoes_setor.php?cod_acao_governo={$cod_acao_governo}&remover_setor={$setores}&display=inline' ><img src=\"imagens/nvp_bola_xis.gif\" border=0 style='padding-left:10px;'></a></td></tr>";
         }
         $tabela .= "</table></td></tr>";
     }
     //fotos
     $obj_fotos = new clsPmiacoesAcaoGovernoFoto();
     $obj_fotos->_campos_lista = "cod_acao_governo_foto, nm_foto, caminho, to_char(data_foto,'dd/mm/yyyy') as data_foto";
     $lista_fotos = $obj_fotos->lista(null, null, $cod_acao_governo);
     if ($lista_fotos) {
         $existe = true;
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         $tabela .= "<tr bgcolor={$cor}><td colspan='2'><b>Fotos</b></td></tr><tr><td>";
         $tabela .= "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" align=\"left\" width='100%'>";
         $tabela .= "<tr bgcolor='#A1B3BD'><th>Foto</th><th>Data</th><th width='100%'>T�tulo</th><th width='70'>Excluir</th></tr>";
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         foreach ($lista_fotos as $foto) {
             $data = $foto["data_foto"];
             $tabela .= "<tr bgcolor={$cor} align='center'><td><a href='javascript:void(0)' onclick='openfotoAcoes(\"arquivos/acoes/fotos/big/{$foto["caminho"]}\")' alt='Clique na imagem para maximizar'><img src='arquivos/acoes/fotos/small/{$foto["caminho"]}' border='0'></a></td><td width='20'>{$data}</td><td align='left'>{$foto["nm_foto"]}</td><td align='center'><a href='acoes_foto.php?cod_acao_governo={$cod_acao_governo}&remover_foto={$foto["cod_acao_governo_foto"]}&display=inline' ><img src=\"imagens/nvp_bola_xis.gif\" border=0 style='padding-left:10px;'></a></td></tr>";
         }
         $tabela .= "</table></td></tr>";
     }
     //arquivos
     $obj_fotos = new clsPmiacoesAcaoGovernoArquivo();
     $obj_fotos->_campos_lista = "cod_acao_governo_arquivo,nm_arquivo, caminho_arquivo";
     $lista_fotos = $obj_fotos->lista(null, null, $cod_acao_governo);
     if ($lista_fotos) {
         $existe = true;
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         $tabela .= "<tr bgcolor={$cor}><td colspan='2'><b>Arquivos</b></td></tr><tr><td>";
         $tabela .= "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" align=\"left\" width='50%'>";
         $tabela .= "<tr bgcolor='#A1B3BD'><th width='60%'>Nome</th><th>Arquivo</th><th width='70'>Excluir</th></tr>";
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         foreach ($lista_fotos as $foto) {
             $data = date("d/m/Y", strtotime(substr($foto["data_foto"], 0, 19)));
             $tabela .= "<tr bgcolor={$cor} align='center'><td align='left' width='80%'>{$foto["nm_arquivo"]}</td><td><a href='{$foto["caminho_arquivo"]}'\" target=\"_blank\"><img src='imagens/nvp_icon_download.gif' border='0' align='bottom'><br>Visualizar</td><td align='center'><a href='acoes_arquivo.php?cod_acao_governo={$cod_acao_governo}&remover_arquivo={$foto["cod_acao_governo_arquivo"]}&display=inline' ><img src=\"imagens/nvp_bola_xis.gif\" border=0 style='padding-left:10px;'></a></td></tr>";
         }
         $tabela .= "</table></td></tr>";
     }
     $obj_noticias = new clsPmiacoesAcaoGovernoNoticia();
     $obj_noticias->_campos_lista = "ref_cod_not_portal";
     $lista_noticias = $obj_noticias->lista($cod_acao_governo);
     if ($lista_noticias) {
         $existe = true;
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         $tabela .= "<tr bgcolor={$cor}><td colspan='2'><b>Noticias Portal</b></td></tr>";
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         $noticias_in = implode(",", $lista_noticias);
         $db = new clsBanco();
         $db->Consulta("SELECT n.data_noticia, n.titulo, n.cod_not_portal FROM not_portal n where  n.cod_not_portal in({$noticias_in}) ORDER BY n.data_noticia DESC {$limit}");
         $tabela .= "<tr><td colspan='2'><table border=0 cellpadding=2 width='100%'>";
         $tabela .= "<tr bgcolor='#A1B3BD' align='center'><td style='padding-left:20px'> <b>Data</b> </td><td><b>Titulo</b></td><td width='70'><b>Excluir</b></td></tr>";
         while ($db->ProximoRegistro()) {
             list($data, $titulo, $id_noticia) = $db->Tupla();
             $data = date("d/m/Y", strtotime(substr($data, 0, 19)));
             $tabela .= "<tr bgcolor='{$cor}'><td style='padding-left:20px' width='100'><img src=\"imagens/noticia.jpg\" border='0'> {$data} </td><td>{$titulo}</td><td align='center'><a href='acoes_noticia.php?cod_acao_governo={$cod_acao_governo}&remover_noticia={$id_noticia}&display=inline' ><img src=\"imagens/nvp_bola_xis.gif\" border=0 style='padding-left:10px;'></a></td></tr>";
         }
         $tabela .= "</table></td></tr>";
     }
     $obj_fotos_portal = new clsPmiacoesAcaoGovernoFotoPortal();
     $obj_fotos_portal->_campos_lista = "ref_cod_foto_portal";
     $lista_fotos = $obj_fotos_portal->lista($cod_acao_governo);
     if ($lista_fotos) {
         $existe = true;
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         $tabela .= "<tr bgcolor={$cor}><td colspan='2'><b>Fotos Portal</b></td></tr><tr><td>";
         $tabela .= "<table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" align=\"left\" width='100%'>";
         $tabela .= "<tr bgcolor='#A1B3BD'><th>Foto</th><th>Data</th><th width='60%'>T�tulo</th><th width='70'>Excluir</th></tr>";
         $fotos_in = implode(",", $lista_fotos);
         $db = new clsBanco();
         $db->Consulta("SELECT f.cod_foto_portal,f.titulo, f.descricao, f.data_foto, f.caminho, f.nm_credito, f.altura, f.largura FROM foto_portal f WHERE cod_foto_portal in({$fotos_in})");
         $cor = $cor == "#FFFFFF" ? "#E4E9ED" : "#FFFFFF";
         while ($db->ProximoRegistro()) {
             list($cod_foto_portal, $titulo, $descricao, $data_foto, $caminho, $nm_credito) = $db->Tupla();
             $data = date("d/m/Y", strtotime(substr($data, 0, 19)));
             $rowspan = "";
             if ($descricao) {
                 $rowspan = "rowspan='2'";
                 $descricao = "<tr bgcolor={$cor}><td colspan='2'><div><b>Descri&ccedil;&atilde;o:</b> {$descricao}</div></td></tr>";
             }
             $tabela .= "<tr bgcolor={$cor} align='center'><td {$rowspan}><img src='fotos/small/{$caminho}' border='0'></td><td>{$data}</td><td align='left'>{$titulo}</td><td {$rowspan}><a href='acoes_foto_portal.php?cod_acao_governo={$cod_acao_governo}&remover_foto={$cod_foto_portal}&display=inline' ><img src=\"imagens/nvp_bola_xis.gif\" border=0 style='padding-left:10px;'></a></td></tr>{$descricao}";
         }
         $tabela .= "</table></td></tr>";
     }
     $tabela .= "</table>";
     return $existe == true ? $tabela : false;
 }
 function Excluir()
 {
     $obj_setor = new clsSetor($this->cod_setor, null, $this->cod_pessoa);
     if ($obj_setor->exclui()) {
         header("Location: oprot_setor_lst.php");
         die;
         return true;
     }
     return false;
 }