include_once '../../includes.sys/ini.php'; include_once '../../includes.sys/metodos.php'; include_once '../DAO/NucleoDAO.php'; include_once '../Nucleo.class.php'; checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true'); include_once '../../head.php'; $acesso = listarAcesso(); if (!in_array(110, $acesso)) { echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/projeto/documentos/fase_projeto.php";</script>'; } $DAO = new NucleoDAO(); $nucleo = new Nucleo(); //Verifica se foi executado a acao de salvar if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') { $id = limpaTexto($_POST['id']); $nucleo->setNome(limpaTexto($_POST['nome'])); $nucleo->setCodigo(limpaTexto($_POST['codigo'])); $nucleo->setId($id); $nome = $nucleo->getNome(); if (preg_match("/[0-9]/", $nucleo->getCodigo())) { //Verifica se o nome esta em branco if ($nucleo->getNome() != "" && $nucleo->getCodigo() != "") { $retorno = $DAO->Atualizar($nucleo); if ($retorno == true) { echo '<script language= "JavaScript">alert("Registro alterado com sucesso");</script>'; echo '<script language= "JavaScript">location.href="index.php";</script>'; } else { echo $retorno . 'asdasd'; } } } else {