Example #1
0
<?php

session_start();
$nivelAcesso = "../../:2:3:4";
include_once "../../utils/controladorAcesso.php";
include_once "../../utils/funcoes.php";
$empDel = antiSQL(isset($_POST["slEmpRef"]) ? $_POST["slEmpRef"] : NULL);
if ($empDel != NULL) {
    include_once "../../utils/ConectarMySQL.class.php";
    $conexao = new ConectarMySQL();
    include_once "../../dao/DAOLog.class.php";
    $log = new DAOLog($_SESSION["pessoa"], 5, $_SESSION["nivel"], $_SESSION["codigo"], 2, "id=\\'" . $slEmpRef . "\\'", "../../", $conexao);
    include_once "../../dao/DAOEmpresa.class.php";
    $dao = new DAOEmpresa(NULL, "../../", $conexao);
    if ($dao->deletar($empDel) && $log->cadastrar()) {
        $conexao->commit();
    } else {
        $conexao->rollback();
    }
    header("Location: delEmpresa.php?del=ok");
    die;
}
$del = antiSQL(isset($_GET["del"]) ? $_GET["del"] : NULL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Untitled Document</title>
		<style type="text/css">
			<!--
$cadastrar = isset($_GET["cadastrar"]) ? $_GET["cadastrar"] : NULL;
if ($cadastrar == "sim") {
    foreach ($_POST as $nomeCampo => $valor) {
        $comando = "\$" . $nomeCampo . "= antiSQL(isset(\$_POST['{$nomeCampo}']) ? '" . $valor . "' : NULL);";
        eval($comando);
    }
    include_once $toRoot . "utils/ConectarMySQL.class.php";
    include_once $toRoot . "beans/Empresa.class.php";
    include_once $toRoot . "beans/Funcionario.class.php";
    include_once $toRoot . "beans/Log.class.php";
    include_once $toRoot . "dao/DAOEmpresa.class.php";
    include_once $toRoot . "dao/DAOFuncionario.class.php";
    include_once $toRoot . "dao/DAOLog.class.php";
    $conexao = new ConectarMySql($toRoot);
    $empresa = new Empresa($tfNomEmp);
    $daoEmpresa = new DAOEmpresa($empresa, $conexao);
    $daoEmpresa->cadastrar();
    $empresa = $daoEmpresa->getAtual();
    $log = new Log(3, 7, $tfNomEmp . " cadastrado!");
    $daoLog = new DAOLog($log, $conexao);
    $daoLog->cadastrar();
    $funcionario = new Funcionario($empresa->codigo, $_SESSION["codigo"]);
    $daoFuncionario = new DAOFuncionario($funcionario, $conexao);
    $daoFuncionario->cadastrar();
    $log->alvCodigo = 6;
    $log->descricao = "Empresa cadastrado!";
    $daoLog->setLog($log);
    $daoLog->cadastrar();
    $conexao->fechar();
    $cadastrar = true;
}
Example #3
0
<?php

session_start();
$nivelAcesso = "../../:2:3:4";
include_once "../../utils/controladorAcesso.php";
include_once "../../utils/funcoes.php";
$slEmpRef = antiSQL(isset($_POST["slEmpRef"]) ? $_POST["slEmpRef"] : NULL);
$desc = antiSQL(isset($_POST["tfEmpDesc"]) ? $_POST["tfEmpDesc"] : NULL);
if ($desc != NULL && $slEmpRef != NULL) {
    include_once "../../utils/ConectarMySQL.class.php";
    $conexao = new ConectarMySQL();
    include_once "../../dao/DAOEmpresa.class.php";
    include_once "../../dao/DAOLog.class.php";
    $dao = new DAOEmpresa($desc, "../../", $conexao);
    $log = new DAOLog($_SESSION["pessoa"], 4, $_SESSION["nivel"], $_SESSION["codigo"], 2, "id=\\'" . $slEmpRef . "\\'", "../../", $conexao);
    if ($dao->alterar($slEmpRef) && $log->cadastrar()) {
        $conexao->commit();
    } else {
        $conexao->rollback();
    }
    header("Location: altEmpresa.php?alt=ok");
    die;
}
$alt = antiSQL(isset($_GET["alt"]) ? $_GET["alt"] : NULL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Untitled Document</title>
		<style type="text/css">
Example #4
0
<?php

session_start();
$nivelAcesso = "../../:2:3:4";
include_once "../../utils/controladorAcesso.php";
include_once "../../utils/funcoes.php";
$desc = antiSQL(isset($_POST["tfEmpDesc"]) ? $_POST["tfEmpDesc"] : NULL);
if ($desc != NULL) {
    include_once "../../utils/ConectarMySQL.class.php";
    $conexao = new ConectarMySQL();
    include_once "../../dao/DAOEmpresa.class.php";
    $dao = new DAOEmpresa($desc, "../../", $conexao);
    include_once "../../dao/DAOLog.class.php";
    $log = new DAOLog($_SESSION["pessoa"], 3, $_SESSION["nivel"], $_SESSION["codigo"], 2, "valor=\\'" . $desc . "\\'", "../../", $conexao);
    if ($dao->cadastrar() && $log->cadastrar()) {
        $conexao->commit();
    } else {
        $conexao->rollback();
    }
    header("Location: cadEmpresa.php?cad=ok");
    die;
}
$cad = antiSQL(isset($_GET["cad"]) ? $_GET["cad"] : NULL);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Untitled Document</title>
		<style type="text/css">
			<!--
<?php

session_start();
$toRoot = "../";
$nivelAcesso = $toRoot . ":1:3:4";
include_once $toRoot . "utils/controladorAcesso.php";
include_once $toRoot . "utils/funcoes.php";
setVoltar("selecionarEmpresa.php");
$voltar = $_SESSION["voltar"];
$selecionar = isset($_GET["selecionar"]) ? $_GET["selecionar"] : NULL;
if ($selecionar == "sim") {
    include_once $toRoot . "beans/Empresa.class.php";
    include_once $toRoot . "dao/DAOEmpresa.class.php";
    include_once $toRoot . "utils/ConectarMySQL.class.php";
    foreach ($_POST as $nomeCampo => $valor) {
        $comando = "\$" . $nomeCampo . "= antiSQL(isset(\$_POST['{$nomeCampo}']) ? '" . $valor . "' : NULL);";
        eval($comando);
    }
    $conexao = new ConectarMySql($toRoot);
    $bean = new Empresa();
    $dao = new DAOEmpresa($bean, $conexao);
    $bean = $dao->getEmpresa($slEmp);
    $_SESSION["empresa"] = $bean->codigo;
    $_SESSION["empresaNome"] = $bean->nome;
    $conexao->fechar();
    $selecionar = "ok";
}
Example #6
0
<?php

session_start();
$nivelAcesso = "../../:2:3:4";
include_once "../../utils/controladorAcesso.php";
include_once "../../utils/funcoes.php";
$slEmpRef = antiSQL(isset($_POST["slEmpRef"]) ? $_POST["slEmpRef"] : NULL);
if ($slEmpRef != NULL) {
    include_once "../../utils/ConectarMySQL.class.php";
    $conexao = new ConectarMySQL();
    include_once "../../dao/DAOEmpresa.class.php";
    include_once "../../beans/Empresa.class.php";
    $dao = new DAOEmpresa(NULL, "../../", $conexao);
    $empresa = new Empresa(NULL, NULL);
    $empresa = $dao->getEmpresa($slEmpRef);
    $conexao->commit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<style type="text/css">
			<!--
			@import url("../../scripts/css/geral.css");
			-->
		</style>
		<script type="text/javascript" language="javascript" src="../../scripts/javascript/ajax.js"></script>
		<script type="text/javascript" language="javascript">
			window.onload = function(){
				loadContent('../pesquisar/getEmpresasSL.php', 'slEmpRef', '../../');
Example #7
0
<?php

session_start();
$nivelAcesso = "../../:2:3:4";
include_once "../../utils/controladorAcesso.php";
include_once "../../utils/funcoes.php";
$key = antiSQL(isset($_GET["key"]) ? $_GET["key"] : NULL);
if ($key != NULL) {
    include_once "../../utils/ConectarMySQL.class.php";
    $conexao = new ConectarMySQL();
    include_once "../../dao/DAOEmpresa.class.php";
    include_once "../../beans/Empresa.class.php";
    $dao = new DAOEmpresa(NULL, "../../", $conexao);
    $empresa = new Empresa(NULL, NULL);
    $empresa = $dao->getEmpresa($key);
    $conexao->commit();
    echo '<div id="A">' . utf8_encode($empresa->getDescricao()) . '</div>';
} else {
    echo "ERRO!";
}