function Novo()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $obj_permissoes = new clsPermissoes();
     $obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7, 'educar_servidor_alocacao_lst.php');
     if ($_POST['alocacao_array']) {
         $this->alocacao_array = unserialize(urldecode($_POST['alocacao_array']));
     }
     if ($_POST['alocacao_excluida_array']) {
         $this->alocacao_excluida_array = unserialize(urldecode($_POST['alocacao_excluida_array']));
     }
     if ($this->alocacao_excluida_array) {
         foreach ($this->alocacao_excluida_array as $excluida) {
             $obj = new clsPmieducarServidorAlocacao(NULL, $this->ref_ref_cod_instituicao, $this->pessoa_logada, $this->pessoa_logada, $excluida['ref_cod_escola'], $this->ref_cod_servidor, NULL, NULL, $this->ativo, $excluida['carga_horaria_alocada'], $excluida['periodo']);
             $cadastrou = $obj->excluir_horario();
         }
     }
     if ($_POST['carga_horaria_alocada'] && $_POST['periodo']) {
         $aux = array();
         $aux['periodo'] = $_POST['periodo'];
         $aux['carga_horaria_alocada'] = $_POST['carga_horaria_alocada'];
         $aux['ref_cod_escola'] = $_POST['ref_cod_escola'];
         $aux['novo'] = 1;
         $achou = FALSE;
         foreach ($this->alocacao_array as $alocacao) {
             if ($alocacao['periodo'] == $aux['periodo']) {
                 $achou = TRUE;
             }
         }
         if (!$achou) {
             $this->alocacao_array[] = $aux;
         }
         unset($this->periodo);
         unset($this->carga_horaria_alocada);
     }
     if ($this->alocacao_array) {
         foreach ($this->alocacao_array as $alocacao) {
             if ($alocacao['novo']) {
                 $cargaHoraria = explode(':', $alocacao['carga_horaria_alocada']);
                 $hora = isset($cargaHoraria[0]) ? $cargaHoraria[0] : 0;
                 $minuto = isset($cargaHoraria[1]) ? $cargaHoraria[1] : 0;
                 $segundo = isset($cargaHoraria[2]) ? $cargaHoraria[2] : 0;
                 $cargaHoraria = sprintf("%'02d:%'02d:%'02d", $hora, $minuto, $segundo);
                 $obj = new clsPmieducarServidorAlocacao(NULL, $this->ref_ref_cod_instituicao, NULL, $this->pessoa_logada, $alocacao['ref_cod_escola'], $this->ref_cod_servidor, NULL, NULL, $this->ativo, $cargaHoraria, $alocacao['periodo']);
                 $cadastrou = FALSE;
                 if (FALSE == $obj->lista(NULL, $this->ref_ref_cod_instituicao, NULL, NULL, $alocacao['ref_cod_escola'], $this->ref_cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, $alocacao['periodo'])) {
                     $cadastrou = $obj->cadastra();
                 }
                 if (!$cadastrou) {
                     $this->mensagem = 'Cadastro não realizado.<br />';
                     echo "<!--\nErro ao cadastrar clsPmieducarServidorAlocacao\nvalores obrigatorios\nis_numeric({$this->ref_ref_cod_instituicao}) && is_numeric({$this->ref_usuario_cad}) && is_numeric({$this->ref_cod_escola}) && is_numeric({$this->ref_cod_servidor}) && is_numeric({$this->periodo}) && ({$this->carga_horaria_alocada})\n-->";
                     return FALSE;
                 }
             }
         }
     }
     $this->mensagem .= 'Cadastro efetuado com sucesso.<br />';
     header('Location: ' . sprintf('educar_servidor_det.php?cod_servidor=%d&ref_cod_instituicao=%d', $this->ref_cod_servidor, $this->ref_ref_cod_instituicao));
     die;
 }
 function Novo()
 {
     session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $professor = isset($_POST['professor']) ? strtolower($_POST['professor']) : 'FALSE';
     $substituto = isset($_POST['ref_cod_servidor_todos']) ? $_POST['ref_cod_servidor_todos'] : NULL;
     $permissoes = new clsPermissoes();
     $permissoes->permissao_cadastra(635, $this->pessoa_logada, 3, 'educar_servidor_alocacao_lst.php');
     $this->alocacao_array = array();
     if ($_POST['alocacao_array']) {
         $this->alocacao_array = unserialize(urldecode($_POST['alocacao_array']));
     }
     if ($this->alocacao_array) {
         // Substitui todas as alocações
         foreach ($this->alocacao_array as $key => $alocacao) {
             $obj = new clsPmieducarServidorAlocacao(NULL, $this->ref_ref_cod_instituicao, $this->pessoa_logada, $this->pessoa_logada, $alocacao['ref_cod_escola'], $this->ref_cod_servidor, NULL, NULL, NULL, $alocacao['carga_horaria'], $alocacao['periodo']);
             $return = $obj->lista(NULL, $this->ref_ref_cod_instituicao, NULL, NULL, $alocacao['ref_cod_escola'], $this->ref_cod_servidor, NULL, NULL, NULL, NULL, 1, $alocacao['carga_horaria']);
             if (FALSE !== $return) {
                 $substituiu = $obj->substituir_servidor($substituto);
                 if (!$substituiu) {
                     $this->mensagem = "Substituicao n&atilde;o realizado.<br>";
                     return FALSE;
                 }
             }
         }
         // Substituição do servidor no quadro de horários (caso seja professor)
         if ('true' == $professor) {
             $quadroHorarios = new clsPmieducarQuadroHorarioHorarios(NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_ref_cod_instituicao, NULL, $this->ref_cod_servidor, NULL, NULL, NULL, NULL, 1, NULL, NULL);
             $quadroHorarios->substituir_servidor($substituto);
         }
     }
     $this->mensagem .= 'Cadastro efetuado com sucesso.<br>';
     $destination = 'educar_servidor_det.php?cod_servidor=%s&ref_cod_instituicao=%s';
     $destination = sprintf($destination, $this->ref_cod_servidor, $this->ref_ref_cod_instituicao);
     header('Location: ' . $destination);
     die;
 }
 $obj_servidor = new clsPmieducarServidorAlocacao();
 $obj_servidor->setCamposLista('ref_ref_cod_instituicao, ref_cod_escola, sa.ref_cod_servidor, SUM(carga_horaria) AS carga_horaria');
 $obj_servidor->setOrderby('sa.ref_ref_cod_instituicao, sa.ref_cod_escola, p.nome, sa.ref_cod_servidor');
 $obj_servidor->setGroupBy('ref_ref_cod_instituicao, ref_cod_escola, sa.ref_cod_servidor, p.nome');
 $lst_servidor = $obj_servidor->lista(NULL, $ref_cod_instituicao, NULL, NULL, $escolas['ref_cod_escola'], NULL, NULL, NULL, NULL, NULL, 1, NULL, NULL, TRUE);
 if (is_array($lst_servidor)) {
     $get_nome_escola = new clsPmieducarEscola($escolas['ref_cod_escola']);
     $det_nome_escola = $get_nome_escola->detalhe();
     if (is_array($det_nome_escola)) {
         $total_servidor = count($lst_servidor);
         $relatorio->novalinha(array($det_nome_escola['nome'] . ' - Total de Professores: ' . $total_servidor), 0, 16, TRUE, 'arial', array(), '#515151', '#d3d3d3', '#FFFFFF', FALSE, TRUE);
     }
     $relatorio->novalinha(array('Nome', 'Matrícula', 'Turno', 'Carga Horária Disponível'), 0, 16, TRUE, 'arial', array(210, 90, 100), '#515151', '#d3d3d3', '#FFFFFF', FALSE, TRUE);
     $array_turnos = array('1' => 'M', '2' => 'V', '3' => 'N');
     foreach ($lst_servidor as $servidor) {
         $get_turnos = new clsPmieducarServidorAlocacao();
         $get_turnos->setCamposLista('periodo');
         $get_turnos->setGroupBy('periodo, p.nome');
         $turnos = $get_turnos->lista(NULL, $ref_cod_instituicao, NULL, NULL, $escolas['ref_cod_escola'], $servidor['ref_cod_servidor'], NULL, NULL, NULL, NULL, 1, NULL, NULL, TRUE);
         $turnos_txt = '';
         if (is_array($turnos)) {
             $completar = '';
             foreach ($turnos as $turno) {
                 $turnos_txt .= $completar . $array_turnos[$turno['periodo']];
                 $completar = '/';
             }
         }
         $relatorio->novalinha(array(minimiza_capitaliza($servidor['nome']), $servidor['ref_cod_servidor'], $turnos_txt, $servidor['carga_horaria']), 5, 17, FALSE, 'arial', array(215, 90, 100));
     }
     $entrou = TRUE;
 }
 /**
  * Implementação do método Gerar()
  */
 function Gerar()
 {
     session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $this->titulo = 'Servidor - Detalhe';
     $this->addBanner('imagens/nvp_top_intranet.jpg', 'imagens/nvp_vert_intranet.jpg', 'Intranet');
     $this->cod_servidor = $_GET['cod_servidor'];
     $this->ref_cod_instituicao = $_GET['ref_cod_instituicao'];
     $tmp_obj = new clsPmieducarServidor($this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao);
     $registro = $tmp_obj->detalhe();
     if (!$registro) {
         header('Location: educar_servidor_lst.php');
         die;
     }
     // Deficiência
     $obj_ref_cod_deficiencia = new clsCadastroDeficiencia($registro['ref_cod_deficiencia']);
     $det_ref_cod_deficiencia = $obj_ref_cod_deficiencia->detalhe();
     $registro['ref_cod_deficiencia'] = $det_ref_cod_deficiencia['nm_deficiencia'];
     // Escolaridade
     $obj_ref_idesco = new clsCadastroEscolaridade($registro['ref_idesco']);
     $det_ref_idesco = $obj_ref_idesco->detalhe();
     $registro['ref_idesco'] = $det_ref_idesco['descricao'];
     // Função
     $obj_ref_cod_funcao = new clsPmieducarFuncao($registro['ref_cod_funcao'], NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, $this->ref_cod_instituicao);
     $det_ref_cod_funcao = $obj_ref_cod_funcao->detalhe();
     $registro['ref_cod_funcao'] = $det_ref_cod_funcao['nm_funcao'];
     // Nome
     $obj_cod_servidor = new clsFuncionario($registro['cod_servidor']);
     $det_cod_servidor = $obj_cod_servidor->detalhe();
     $registro['matricula'] = $det_cod_servidor['matricula'];
     $det_cod_servidor = $det_cod_servidor['idpes']->detalhe();
     $registro['nome'] = $det_cod_servidor['nome'];
     // Instituição
     $obj_ref_cod_instituicao = new clsPmieducarInstituicao($registro['ref_cod_instituicao']);
     $det_ref_cod_instituicao = $obj_ref_cod_instituicao->detalhe();
     $registro['ref_cod_instituicao'] = $det_ref_cod_instituicao['nm_instituicao'];
     // Alocação do servidor
     $obj = new clsPmieducarServidorAlocacao();
     $obj->setOrderby('periodo, carga_horaria');
     $lista = $obj->lista(NULL, $this->ref_cod_instituicao, NULL, NULL, NULL, $this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
     if ($lista) {
         // Passa todos os valores do registro para atributos do objeto
         foreach ($lista as $campo => $val) {
             $temp = array();
             $temp['carga_horaria'] = $val['carga_horaria'];
             $temp['periodo'] = $val['periodo'];
             $obj_escola = new clsPmieducarEscola($val['ref_cod_escola']);
             $det_escola = $obj_escola->detalhe();
             $det_escola = $det_escola['nome'];
             $temp['ref_cod_escola'] = $det_escola;
             $this->alocacao_array[] = $temp;
         }
     }
     if ($registro['cod_servidor']) {
         $this->addDetalhe(array('Servidor', $registro['cod_servidor']));
     }
     if ($registro['matricula']) {
         $this->addDetalhe(array('Matrícula', $registro['matricula']));
     }
     if ($registro['nome']) {
         $this->addDetalhe(array('Nome', $registro['nome']));
     }
     if ($registro['ref_cod_instituicao']) {
         $this->addDetalhe(array("Instituição", $registro['ref_cod_instituicao']));
     }
     if ($registro['ref_cod_deficiencia']) {
         $this->addDetalhe(array('Deficiência', $registro['ref_cod_deficiencia']));
     }
     if ($registro['ref_idesco']) {
         $this->addDetalhe(array('Escolaridade', $registro['ref_idesco']));
     }
     if ($registro['ref_cod_subnivel']) {
         $obj_nivel = new clsPmieducarSubnivel($registro['ref_cod_subnivel']);
         $det_nivel = $obj_nivel->detalhe();
         $this->addDetalhe(array('Nível', $det_nivel['nm_subnivel']));
     }
     if ($registro['ref_cod_funcao']) {
         $this->addDetalhe(array('Função', $registro['ref_cod_funcao']));
     }
     $obj_funcao = new clsPmieducarServidorFuncao();
     $lst_funcao = $obj_funcao->lista($this->ref_cod_instituicao, $this->cod_servidor);
     // Inep.
     $docente = false;
     if ($lst_funcao) {
         $tabela .= "\n        <table cellspacing='0' cellpadding='0' border='0'>\n          <tr bgcolor='#A1B3BD' align='center'>\n            <td width='150'>Função</td>\n          </tr>";
         $class = 'formlttd';
         $tab_disc = NULL;
         $obj_disciplina_servidor = new clsPmieducarServidorDisciplina();
         $lst_disciplina_servidor = $obj_disciplina_servidor->lista(NULL, $this->ref_cod_instituicao, $this->cod_servidor);
         if ($lst_disciplina_servidor) {
             $tab_disc .= "<table cellspacing='0' cellpadding='0' width='200' border='0' style='border:1px dotted #000000'>";
             $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd";
             $tab_disc .= "\n          <tr>\n            <td bgcolor='#A1B3BD' align='center'>Componentes Curriculares</td>\n          </tr>";
             $componenteMapper = new ComponenteCurricular_Model_ComponenteDataMapper();
             foreach ($lst_disciplina_servidor as $disciplina) {
                 $componente = $componenteMapper->find($disciplina['ref_cod_disciplina']);
                 $tab_disc .= "\n            <tr class='{$class2}' align='center'>\n              <td align='left'>{$componente->nome}</td>\n            </tr>";
                 $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd";
             }
             $tab_disc .= "</table>";
         }
         $obj_servidor_curso = new clsPmieducarServidorCursoMinistra();
         $lst_servidor_curso = $obj_servidor_curso->lista(NULL, $this->ref_cod_instituicao, $this->cod_servidor);
         if ($lst_servidor_curso) {
             $tab_curso .= "<table cellspacing='0' cellpadding='0' width='200' border='0' style='border:1px dotted #000000'>";
             $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd";
             $tab_curso .= "\n          <tr>\n            <td bgcolor='#A1B3BD' align='center'>Cursos Ministrados</td>\n          </tr>";
             foreach ($lst_servidor_curso as $curso) {
                 $obj_curso = new clsPmieducarCurso($curso['ref_cod_curso']);
                 $det_curso = $obj_curso->detalhe();
                 $tab_curso .= "\n            <tr class='{$class2}' align='center'>\n              <td align='left'>{$det_curso['nm_curso']}</td>\n            </tr>";
                 $class2 = $class2 == "formlttd" ? "formmdtd" : "formlttd";
             }
             $tab_curso .= "</table>";
         }
         foreach ($lst_funcao as $funcao) {
             $obj_funcao = new clsPmieducarFuncao($funcao['ref_cod_funcao']);
             $det_funcao = $obj_funcao->detalhe();
             $tabela .= "\n          <tr class='{$class}' align='left'>\n            <td><b>{$det_funcao['nm_funcao']}</b></td>\n          </tr>";
             $docente = (bool) $det_funcao['professor'];
             $class = $class == "formlttd" ? "formmdtd" : "formlttd";
         }
         if ($tab_curso) {
             $tabela .= "\n          <tr class='{$class}' align='center'>\n            <td style='padding:5px'>{$tab_curso}</td>\n          </tr>";
         }
         if ($tab_disc) {
             $tabela .= "\n          <tr class='{$class}' align='center'>\n            <td style='padding:5px'>{$tab_disc}</td>\n          </tr>";
         }
         $tabela .= "</table>";
         $this->addDetalhe(array('Função', "<a href='javascript:trocaDisplay(\"det_f\");' >Mostrar detalhe</a><div id='det_f' name='det_f' style='display:none;'>" . $tabela . "</div>"));
     }
     $tabela = NULL;
     /**
      * @todo  Criar função de transformação de hora decimal. Ver educar_servidor_cad.php em 276
      */
     if ($registro['carga_horaria']) {
         $cargaHoraria = $registro['carga_horaria'];
         $horas = (int) $cargaHoraria;
         $minutos = round(($cargaHoraria - $horas) * 60);
         $cargaHoraria = sprintf('%02d:%02d', $horas, $minutos);
         $this->addDetalhe(array('Carga Horária', $cargaHoraria));
     }
     $dias_da_semana = array('' => 'Selecione', 1 => 'Domingo', 2 => 'Segunda', 3 => 'Terça', 4 => 'Quarta', 5 => 'Quinta', 6 => 'Sexta', 7 => 'Sábado');
     if ($this->alocacao_array) {
         $tabela .= "\n        <table cellspacing='0' cellpadding='0' border='0'>\n          <tr bgcolor='#A1B3BD' align='center'>\n            <td width='150'>Carga Horária</td>\n            <td width='80'>Período</td>\n            <td width='150'>Escola</td>\n          </tr>";
         $class = "formlttd";
         foreach ($this->alocacao_array as $alocacao) {
             switch ($alocacao['periodo']) {
                 case 1:
                     $nm_periodo = "Matutino";
                     break;
                 case 2:
                     $nm_periodo = "Vespertino";
                     break;
                 case 3:
                     $nm_periodo = "Noturno";
                     break;
             }
             $tabela .= "\n          <tr class='{$class}' align='center'>\n            <td>{$alocacao['carga_horaria']}</td>\n            <td>{$nm_periodo}</td>\n            <td>{$alocacao['ref_cod_escola']}</td>\n          </tr>";
             $class = $class == 'formlttd' ? 'formmdtd' : 'formlttd';
         }
         $tabela .= "</table>";
         $this->addDetalhe(array('Horários de trabalho', "<a href='javascript:trocaDisplay(\"det_pree\");' >Mostrar detalhe</a><div id='det_pree' name='det_pree' style='display:none;'>" . $tabela . "</div>"));
     }
     // Horários do professor
     $horarios = $tmp_obj->getHorariosServidor($registro['cod_servidor'], $this->ref_cod_instituicao);
     if ($horarios) {
         $tabela = "\n        <table cellspacing='0' cellpadding='0' border='0'>\n          <tr bgcolor='#A1B3BD' align='center'>\n            <td width='150'>Escola</td>\n            <td width='100'>Curso</td>\n            <td width='70'>Série</td>\n            <td width='70'>Turma</td>\n            <td width='100'>Componente curricular</td>\n            <td width='70'>Dia da semana</td>\n            <td width='70'>Hora inicial</td>\n            <td width='70'>Hora final</td>\n          </tr>";
         foreach ($horarios as $horario) {
             $class = $class == 'formlttd' ? 'formmdtd' : 'formlttd';
             $tabela .= sprintf('
       <tr class="%s" align="center">
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
         <td>%s</td>
       </tr>', $class, $horario['nm_escola'], $horario['nm_curso'], $horario['nm_serie'], $horario['nm_turma'], $horario['nome'], $dias_da_semana[$horario['dia_semana']], $horario['hora_inicial'], $horario['hora_final']);
         }
         $tabela .= "</table>";
         $this->addDetalhe(array('Horários de aula', "<a href='javascript:trocaDisplay(\"horarios\");' >Mostrar detalhes</a>" . "<div id='horarios' name='det_pree' style='display:none;'>" . $tabela . "</div>"));
     }
     // Dados do docente no Educacenso/Inep.
     if ($docente) {
         $docenteMapper = new Educacenso_Model_DocenteDataMapper();
         $docenteInep = NULL;
         try {
             $docenteInep = $docenteMapper->find(array('docente' => $registro['cod_servidor']));
         } catch (Exception $e) {
         }
         if (isset($docenteInep)) {
             $this->addDetalhe(array('Código do docente no Educacenso/Inep', $docenteInep->docenteInep));
             if (isset($docenteInep->nomeInep)) {
                 $this->addDetalhe(array('Nome do docente no Educacenso/Inep', $docenteInep->nomeInep));
             }
         }
     }
     $obj_permissoes = new clsPermissoes();
     if ($obj_permissoes->permissao_cadastra(635, $this->pessoa_logada, 7)) {
         $this->url_novo = 'educar_servidor_cad.php';
         $this->url_editar = "educar_servidor_cad.php?cod_servidor={$registro["cod_servidor"]}&ref_cod_instituicao={$this->ref_cod_instituicao}";
         $get_padrao = "ref_cod_servidor={$registro["cod_servidor"]}&ref_cod_instituicao={$this->ref_cod_instituicao}";
         $this->array_botao = array();
         $this->array_botao_url_script = array();
         $this->array_botao[] = 'Avaliação de Desempenho';
         $this->array_botao_url_script[] = "go(\"educar_avaliacao_desempenho_lst.php?{$get_padrao}\");";
         $this->array_botao[] = 'Formação';
         $this->array_botao_url_script[] = "go(\"educar_servidor_formacao_lst.php?{$get_padrao}\");";
         $this->array_botao[] = 'Cursos superiores/Licenciaturas';
         $this->array_botao_url_script[] = sprintf("go(\"../module/Docente/index?servidor=%d&instituicao=%d\");", $registro['cod_servidor'], $this->ref_cod_instituicao);
         $this->array_botao[] = 'Faltas/Atrasos';
         $this->array_botao_url_script[] = "go(\"educar_falta_atraso_lst.php?{$get_padrao}\");";
         $this->array_botao[] = 'Alocar Servidor';
         $this->array_botao_url_script[] = "go(\"educar_servidor_alocacao_cad.php?{$get_padrao}\");";
         $this->array_botao[] = 'Alterar Nível';
         $this->array_botao_url_script[] = "popless();";
         $obj_servidor_alocacao = new clsPmieducarServidorAlocacao();
         $lista_alocacao = $obj_servidor_alocacao->lista(NULL, $this->ref_cod_instituicao, NULL, NULL, NULL, $this->cod_servidor, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1);
         if ($lista) {
             $this->array_botao[] = 'Substituir Horário Servidor';
             $this->array_botao_url_script[] = "go(\"educar_servidor_substituicao_cad.php?{$get_padrao}\");";
         }
         $obj_afastamento = new clsPmieducarServidorAfastamento();
         $afastamento = $obj_afastamento->afastado($this->cod_servidor, $this->ref_cod_instituicao);
         if (is_numeric($afastamento) && $afastamento == 0) {
             $this->array_botao[] = 'Afastar Servidor';
             $this->array_botao_url_script[] = "go(\"educar_servidor_afastamento_cad.php?{$get_padrao}\");";
         } elseif (is_numeric($afastamento)) {
             $this->array_botao[] = 'Retornar Servidor';
             $this->array_botao_url_script[] = "go(\"educar_servidor_afastamento_cad.php?{$get_padrao}&sequencial={$afastamento}\");";
         }
     }
     $this->url_cancelar = 'educar_servidor_lst.php';
     $this->largura = '100%';
     $localizacao = new LocalizacaoSistema();
     $localizacao->entradaCaminhos(array($_SERVER['SERVER_NAME'] . "/intranet" => "In&iacute;cio", "educar_index.php" => "i-Educar - Escola", "" => "Detalhe do servidor"));
     $this->enviaLocalizacao($localizacao->montar());
 }