/*--------------------- Configuracao do cach ------------------*/ //if(APPLICATION_ENV == "development") //$cache = new \Doctrine\Common\Cache\ArrayCache; //else if(APPLICATION_ENV == "production") // $cache = new \Doctrine\Common\Cache\ApcCache(); /*-------------------------------------------------------------*/ //$config = new Configuration(); //$config->setMetadataCacheImpl($cache); //$driverImpl = $config->newDefaultAnnotationDriver('./Entities'); //$config->setMetadataDriverImpl($driverImpl); //$config->setQueryCacheImpl($cache); //$config->setProxyDir($raizConfig .'/Entities/Proxies'); //$config->setProxyNamespace('MyProject\Proxies'); //$config->setAutoGenerateProxyClasses(true); //global $em; $em = getEm(); //EntityManager::create($conn, $config); function getEm() { $em = EntityManager::create(getConn(), getConfig()); return $em; } function getConfig() { $cache = new \Doctrine\Common\Cache\ArrayCache(); $config = new Configuration(); $config->setMetadataCacheImpl($cache); $driverImpl = $config->newDefaultAnnotationDriver('./Entities'); $config->setMetadataDriverImpl($driverImpl); $config->setQueryCacheImpl($cache); $config->setProxyDir($raizConfig . '/Entities/Proxies');
include_once "{$raizGerador}/config.php"; $dataInicial = $_REQUEST["dataInicial"]; $dataFinal = $_REQUEST["dataFinal"]; $credenciado = $_REQUEST["credenciado"]; $convenio = $em->find("Entities\\Convenio", $_REQUEST['convenio']); $nomeConvenio = $convenio->getNome(); //echo $dataFinal; $dql = "Select p from Entities\\ProcedimentoExecutado p JOIN p.convenio co JOIN p.status s LEFT JOIN p.itensProcedimento i LEFT JOIN i.anestesista1 an1 where p.dataDigitacao BETWEEN :dataI AND :dataF AND ( s.descricao = 'Faturado' or s.descricao = 'Glosado')"; if (!empty($convenio)) { $dql .= " and co.id = :idConvenio "; } if ($credenciado > 0) { $dql .= " and ((an1.id = :idCredenciado and p.tipo='P') or (p.anestesista= :idCredenciado and p.tipo='C')) "; } //echo $dql; $q = getEm()->createQuery($dql); $q->setParameter("dataI", change_data_from_Br_to_bd($dataInicial)); $q->setParameter("dataF", change_data_from_Br_to_bd($dataFinal)); if (!empty($convenio)) { $q->setParameter("idConvenio", $convenio->getId()); } $nomeCredenciado = "SIAC - SERVICO INTEGRADO DE ANESTESIA DE CAMPINAS SC LTDA"; if ($credenciado > 0) { $q->setParameter("idCredenciado", $credenciado); $nomeCredenciado = $em->find("Entities\\Medico", $credenciado)->getNome(); } $procedimentos = $q->getResult(); //print_r($procedimentos); // $geradorRelatorioConferencia = new classes\GeradorPDFRelatorioConferencia("Relatorio de Conferencia", $nomeConvenio, $dataInicial, $dataFinal, $nomeCredenciado); //
<?php use Entities\Login; $usuarioValido = 0; $xml = ""; if (isset($_POST['usuario'])) { $usuario = $_POST['usuario']; $senha = $_POST['senha']; $salt = "KmR2@*)&+"; $rememberPass = isset($_POST['rememberPass']) ? $_POST['rememberPass'] : false; $dql = "select u from Entities\\Login u where u.username = :login and u.password = :senha"; $emLogin = getEm(); $q = $emLogin->createQuery($dql); $q->setParameter("login", $usuario); // echo md5($senha.$salt); $q->setParameter("senha", md5($senha . $salt)); // echo "Login: $usuario, senha : ".md5($senha.$salt); $logins = $q->getResult(); $login = ""; foreach ($logins as $login) { // echo "adsfas"; } if (!empty($login)) { session_start(); echo "a"; $dados = array(); $dados[0] = $usuario; $dados[1] = $senha; $dados["idLogin"] = $login->getId(); // $dados["autoridade"] = $login->getAutoridade(); // $dados["idFuncionario"] = $login->getFuncionario()->getId();