Пример #1
0
 function Novo()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     @session_write_close();
     $obj_permissoes = new clsPermissoes();
     $obj_permissoes->permissao_cadastra(606, $this->pessoa_logada, 11, "educar_exemplar_lst.php");
     $this->preco = str_replace(".", "", $this->preco);
     $this->preco = str_replace(",", ".", $this->preco);
     if (!$this->combo_manual) {
         $obj_exemplar = new clsPmieducarExemplar();
         $max_tombo = $obj_exemplar->retorna_tombo_maximo() + 1;
     } else {
         $max_tombo = $this->combo_manual;
     }
     for ($i = 0; $i < $this->qtd_livros; $i++) {
         $obj = new clsPmieducarExemplar($this->cod_exemplar, $this->ref_cod_fonte, $this->ref_cod_motivo_baixa, $this->ref_cod_acervo, $this->ref_cod_situacao, $this->pessoa_logada, $this->pessoa_logada, $this->permite_emprestimo, $this->preco, $this->data_cadastro, $this->data_exclusao, $this->ativo, $this->data_aquisicao, $max_tombo);
         $cadastrou = $obj->cadastra();
         if (!$cadastrou) {
             $this->mensagem = "Cadastro n&atilde;o realizado.<br>";
             echo "<!--\nErro ao cadastrar clsPmieducarExemplar\nvalores obrigatorios\nis_numeric( {$this->ref_cod_fonte} ) && is_numeric( {$this->ref_cod_acervo} ) && is_numeric( {$this->ref_cod_situacao} ) && is_numeric( {$this->ref_usuario_cad} ) && is_numeric( {$this->permite_emprestimo} ) && is_numeric( {$this->preco} )\n-->";
             return false;
         }
         $max_tombo++;
     }
     $this->mensagem .= "Cadastro efetuado com sucesso.<br>";
     header("Location: educar_exemplar_lst.php");
     die;
     return true;
 }