Esempio n. 1
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', '../../');
<?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";
}
Esempio n. 3
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!";
}