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;
 }