Exemple #1
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/FasesProjetoDAO.php';
include_once '../FasesProjeto.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(125, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/projeto/documentos/fase_projeto.php";</script>';
}
$DAO = new FasesProjetoDAO();
$fasesProjeto = new FasesProjeto();
//Verifica se foi executado a acao de salvar
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'editar') {
    $id = limpaTexto($_POST['id']);
    $fasesProjeto->setNome(limpaTexto($_POST['nome']));
    $fasesProjeto->setCodigo(limpaTexto($_POST['codigo']));
    $fasesProjeto->setId($id);
    $nome = $fasesProjeto->getNome();
    if (!preg_match("/[0-9]/", $fasesProjeto->getCodigo())) {
        //Verifica se o nome esta em branco
        if ($fasesProjeto->getNome() != "" && $fasesProjeto->getCodigo() != "") {
            $retorno = $DAO->Atualizar($fasesProjeto);
            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';
            }
Exemple #2
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/FasesProjetoDAO.php';
include_once '../FasesProjeto.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(127, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/projeto/documentos/fase_projeto.php";</script>';
}
$fasesProjeto = new FasesProjeto();
$DAO = new FasesProjetoDAO();
if (!empty($_GET['cmd']) && $_GET['cmd'] == 'del') {
    $id = ValidateInteger(INPUT_GET, 'id');
    $retorno = $DAO->Deletar($id);
    if ($retorno == 1) {
        echo '<script language= "JavaScript">alert("Categoria removido com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        print_r($retorno);
    }
}
?>
	<!-- topbar ends -->
		<div class="container-fluid">
		<div class="row-fluid">
				
			<!-- left menu starts -->
			<div class="span2 main-menu-span">
Exemple #3
0
<?php

include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/FasesProjetoDAO.php';
include_once '../FasesProjeto.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(124, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/projeto/documentos/fase_projeto.php";</script>';
}
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $fasesProjeto = new FasesProjeto();
    $DAO = new FasesProjetoDAO();
    $fasesProjeto->setNome(limpaTexto($_POST['nome']));
    $fasesProjeto->setCodigo(strtoupper(limpaTexto($_POST['codigo'])));
    $fasesProjeto->setUsuario(userId());
    //Verifica se o nome foi preenchido
    if (!preg_match("/[0-9]/", $fasesProjeto->getCodigo())) {
        if ($fasesProjeto->getNome() != "" && $fasesProjeto->getCodigo() != "") {
            $retorno = $DAO->Gravar($fasesProjeto);
            if ($retorno == true) {
                echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
                echo '<script language= "JavaScript">location.href="new.php";</script>';
            }
        } else {
            echo '<script language= "JavaScript">alert("Preencha o(s) campo(s)");</script>';
        }
    } else {