function Novo() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $obj = new clsPmieducarMaterialTipo(null, $this->pessoa_logada, null, $this->nm_tipo, $this->desc_tipo, null, null, 1, $this->ref_cod_instituicao); $cadastrou = $obj->cadastra(); if ($cadastrou) { $this->mensagem .= "Cadastro efetuado com sucesso.<br>"; header("Location: educar_material_tipo_lst.php"); die; return true; } $this->mensagem = "Cadastro não realizado.<br>"; echo "<!--\nErro ao cadastrar clsPmieducarMaterialTipo\nvalores obrigatorios\nis_numeric( {$this->pessoa_logada} ) && is_numeric( {$this->ref_cod_instituicao} ) && is_string( {$this->nm_tipo} ) \n-->"; return false; }
function Novo() { @session_start(); $this->pessoa_logada = $_SESSION['id_pessoa']; @session_write_close(); $obj = new clsPmieducarMaterialTipo(null, $this->pessoa_logada, null, $this->nm_tipo, $this->desc_tipo, null, null, 1, $this->ref_cod_instituicao); $cadastrou = $obj->cadastra(); if ($cadastrou) { echo "<script>\n\t\t\t\t\t\tif (parent.document.getElementById('ref_cod_material_tipo').disabled)\n\t\t\t\t\t\t\tparent.document.getElementById('ref_cod_material_tipo').options[0] = new Option('Selecione um tipo de material', '', false, false);\n\t\t\t\t\t\tparent.document.getElementById('ref_cod_material_tipo').options[parent.document.getElementById('ref_cod_material_tipo').options.length] = new Option('{$this->nm_tipo}', '{$cadastrou}', false, false);\n\t\t\t\t\t\tparent.document.getElementById('ref_cod_material_tipo').value = '{$cadastrou}';\n\t\t\t\t\t\tparent.document.getElementById('ref_cod_material_tipo').disabled = false;\n\t\t\t\t\t\twindow.parent.fechaExpansivel('div_dinamico_'+(parent.DOM_divs.length-1));\n\t\t\t \t</script>"; // $this->mensagem .= "Cadastro efetuado com sucesso.<br>"; // header( "Location: educar_material_tipo_lst.php" ); die; return true; } $this->mensagem = "Cadastro não realizado.<br>"; echo "<!--\nErro ao cadastrar clsPmieducarMaterialTipo\nvalores obrigatorios\nis_numeric( {$this->pessoa_logada} ) && is_numeric( {$this->ref_cod_instituicao} ) && is_string( {$this->nm_tipo} ) \n-->"; return false; }