//========================================================================== //Load variables //========================================================================== $db = new bd(); $search = $_POST['s']; $tabela = $_POST['_in']; //========================================================================== //Unset globals variables //========================================================================== unset($_POST); //========================================================================== //Tramento anti sql injection //========================================================================== $stringTratada = ""; $search = replaceTags(" (", ")", "", $search); $stringTratada = retira_acentos(cidade_anti_sql_injection($search)); //========================================================================== //Consulta //========================================================================== switch ($tabela) { case TABELA_MUNICIPIO: $SQL1 = "SELECT municipio.nome,estado.uf,municipio.id FROM municipio\n INNER JOIN estado ON (estado.id = municipio.fk_estado)\n WHERE sem_acento(municipio.nome) ILIKE '{$stringTratada}%' ORDER BY municipio.nome LIMIT 9"; break; case TABELA_REGIAOMETROPOLITANA: // $SQL1 = "SELECT rm.nome, estado.uf, rm.id FROM rm // INNER JOIN estado ON (estado.id = rm.fk_estado) // WHERE sem_acento(rm.nome) ILIKE '$stringTratada%' ORDER BY rm.nome LIMIT 9"; $SQL1 = "SELECT rm.nome as nome, 0 as uf, rm.id FROM rm\n WHERE sem_acento(rm.nome) ILIKE '{$stringTratada}%' AND rm.ativo = TRUE ORDER BY rm.nome LIMIT 9"; break; case TABELA_ESTADO: $SQL1 = "SELECT nome, 0 as uf, id FROM estado\n WHERE sem_acento(nome) ILIKE '{$stringTratada}%' ORDER BY nome LIMIT 9";
$NomesMun = retira_acentos($NomesMun); $NomesMunEst = minJunt($NomesMun, $Uf); $Espac = array('municipio', 'municipio'); $Ideal = array('nulo', 'nulo'); $idAnos = array('3', '3'); $Anos = array('2010', '2010'); } if ($municipio1Arvore != '0' || $municipio2Arvore != '0') { $arvore = new Arvore($municipio1Arvore, $municipio2Arvore); $ids = $arvore->getIds(); $idAnos = $arvore->getidAnos(); $Anos = $arvore->getAnos(); $NomesMun = $arvore->getNomesMun(); $Uf = $arvore->getUf(); $NomesMunImp = setNomeImp($NomesMun, $Uf); $NomesMun = retira_acentos($NomesMun); $NomesMunEst = minJunt($NomesMun, $Uf); $Ideal = $arvore->getIdeal(); $Espac = $arvore->getEspac(); } else { if ($municipio1Arvore == 0 && $municipio2Arvore == 0 && $aleatorio == false) { $ids = array('0', '0'); $idAnos = array('0', '0'); $Anos = array('0', '0'); $NomesMun = array('0', '0'); $Ideal = array('0', '0'); $Espac = array('0', '0'); $Uf = array('0', '0'); $NomesMunEst = array('0', '0'); $NomesMunImp = array('0', '0'); }
<?php if (empty($_SERVER['HTTP_X_REQUESTED_WITH']) || strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') { header("Location: {$path_dir}404"); } require_once '../../../config/config_path.php'; require_once '../../../config/config_gerais.php'; require_once '../util/protect_sql_injection.php'; ini_set("display_errors", 0); ob_start("ob_gzhandler"); function retira_acentos($texto) { $array1 = array("á", "à", "â", "ã", "ä", "é", "è", "ê", "ë", "í", "ì", "î", "ï", "ó", "ò", "ô", "õ", "ö", "ú", "ù", "û", "ü", "ç", "Á", "À", "Â", "Ã", "Ä", "É", "È", "Ê", "Ë", "Í", "Ì", "Î", "Ï", "Ó", "Ò", "Ô", "Õ", "Ö", "Ú", "Ù", "Û", "Ü", "Ç"); $array2 = array("a", "a", "a", "a", "a", "e", "e", "e", "e", "i", "i", "i", "i", "o", "o", "o", "o", "o", "u", "u", "u", "u", "c", "A", "A", "A", "A", "A", "E", "E", "E", "E", "I", "I", "I", "I", "O", "O", "O", "O", "O", "U", "U", "U", "U", "C"); return str_replace($array1, $array2, $texto); } $consulta = $_POST["consulta"]; //========================================================================== //Tramento anti sql injection //========================================================================== $stringTratada = ""; $stringTratada = retira_acentos(cidade_anti_sql_injection($consulta)); //========================================================================== //Consulta //========================================================================== $sql_lugares = ""; $sql_indicadores = ""; if (file_exists("../preconsultas/{$stringTratada}.json")) { include "../preconsultas/{$stringTratada}.json"; }
function envia_SMS($token, $cod_usuario_alvo, $perfil_usuario_alvo, $titulo, $mensagem, $direcao) { $titulo = str_replace ( '\"', '', $titulo ); $mensagem = str_replace ( '\"', '', $mensagem ); $mensagem = retira_acentos ( $mensagem ); $queryEmail = "select concat('55',Trim(celular)) as celular, sms_ativo from $perfil_usuario_alvo where Trim(LENGTH(celular)) =10 and sms_ativo = 'S' and cod_" . $perfil_usuario_alvo . " = $cod_usuario_alvo"; $resultEmail = mysql_query ( $queryEmail ) or erro_fatal ( "O acesso aos dados do usuario falhou : " . mysql_error () ); $line = mysql_fetch_array ( $resultEmail, MYSQL_ASSOC ); $cel_alvo = str_replace ( " ", "", $line ['celular'] ); if ($cel_alvo != "") { ini_set ( "soap.wsdl_cache_enabled", "0" ); // $client = new // SoapClient("https://www.smsbahia.com.br/app/webservices/servico/servicocmk.php?wsdl"); $client = new SoapClient ( "http://www.randernet.com/smsbahia/app/webservices/servico/servicocmk.php?wsdl" ); try { $obj = $client->enviarTorpedo ( $token, 'CIDE', $cel_alvo, 'VAGA', $mensagem . " " . $cel_alvo, null, 8, 22, null ); // print_r($obj); } catch ( Exception $e ) { echo "ERRO: " . $e->getMessage (); } foreach ( $obj as $tokenResul ) { $errorCode = $tokenResul->result; } switch ($errorCode) { case 91 : $msg = "Erro genérico"; break; case 95 : $msg = "Operadora não encontrada"; break; case 96 : $msg = "Usuário sem créditos"; break; case 97 : $msg = "Erro de agendamento"; break; case 98 : $msg = "Quantidade de caracteres exedida"; break; case 100 : $msg = "Mensagem Enviada com sucesso"; break; } echo "<b>Enviando SMS: " . $cel_alvo . "</b>"; echo (" - " . $errorCode . " : " . $msg . "<br><br>"); } return $errorCode; }
public function analisaFrame() { function retira_acentos($texto) { return strtr($texto, "áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ", "aaaaeeiooouucAAAAEEIOOOUUC"); } $url = $this->_urlFrame; $uf = retira_acentos($this->compradorEstado); $uf = strtolower($uf); $uf = str_replace(' ', '_', $uf); $_state_sigla = array('acre' => 'AC', 'alagoas' => 'AL', 'amapa' => 'AP', 'amazonas' => 'AM', 'bahia' => 'BA', 'ceara' => 'CE', 'distrito_federal' => 'DF', 'espirito_santo' => 'ES', 'goias' => 'GO', 'maranhao' => 'MA', 'mato_grosso' => 'MT', 'mato_grosso_do_sul' => 'MS', 'minas_gerais' => 'MG', 'para' => 'PA', 'paraiba' => 'PB', 'parana' => 'PR', 'pernambuco' => 'PE', 'piaui' => 'PI', 'rio_de_janeiro' => 'RJ', 'rio_grande_do_norte' => 'RN', 'rio_grande_do_sul' => 'RS', 'rondonia' => 'RO', 'roraima' => 'RR', 'santa_catarina' => 'SC', 'sao_paulo' => 'SP', 'sergipe' => 'SE', 'tocatins' => 'TO'); $uf = $_state_sigla[$uf]; $url .= '?login='******'&senha=' . $this->getPassword(); $url .= '&nomeComprador=' . $this->compradorNome; $url .= '&ruaComprador=' . $this->compradorRua; $url .= '&numeroComprador=' . $this->compradorNumero; $url .= '&bairroComprador=' . $this->compradorBairro; //Atualizacao $url .= '&complementoComprador=' . $this->compradorComplemento; //Atualizacao $url .= '&cidadeComprador=' . $this->compradorCidade; $url .= '&ufComprador=' . $uf; $url .= '&paisComprador=' . $this->compradorPais; $url .= '&cepComprador=' . $this->compradorCep; $url .= '&dddComprador=' . $this->compradorDddTelefone1; $url .= '&telefoneComprador=' . $this->compradorTelefone1; $url .= '&dddCelularComprador=' . $this->compradorDddCelular; // Atualizacao $url .= '&celularComprador=' . $this->compradorCelular; // Atualizacao $url .= '&dddComprador2=' . $this->compradorDddCelular; // Atualizacao $url .= '&telefoneComprador2=' . $this->compradorCelular; // Atualizacao $url .= '&cpfComprador=' . $this->compradorCpfCnpj; $url .= '&emailComprador=' . $this->compradorEmail; $url .= '&nomeEntrega=' . $this->entregaNome; $url .= '&ruaEntrega=' . $this->entregaRua; $url .= '&numeroEntrega=' . $this->entregaNumero; $url .= '&cidadeEntrega=' . $this->entregaCidade; $url .= '&complementoEntrega=' . $this->entregaComplemento; // Atualizacao $url .= '&bairroEntrega=' . $this->entregaBairro; // Atualizacao $url .= '&ufEntrega=' . $uf; $url .= '&paisEntrega=' . $this->entregaPais; $url .= '&cepEntrega=' . $this->entregaCep; $url .= '&dddEntrega=' . $this->entregaDddTelefone1; $url .= '&telefoneEntrega=' . $this->entregaTelefone1; $url .= '&dddCelularEntrega=' . $this->entregaDddCelular; // Atualizacao $url .= '&celularEntrega=' . $this->entregaCelular; // Atualizacao $url .= '&dddEntrega2=' . $this->entregaDddCelular; // Atualizacao $url .= '&telefoneEntrega2=' . $this->entregaCelular; // Atualizacao $url .= '&ip=' . $this->compradorIp; // Atualizacao $url .= '&codigoPedido=' . $this->codigoPedido; $url .= '&quantidadeItensDistintos=' . $this->itensDistintos; $url .= '&quantidadeTotalItens=' . $this->itensTotal; $url .= '&valorTotalCompra=' . $this->valorTotalCompra * 100; $url .= '&dataCompra=' . $this->dataCompra; $url .= '&metodoPagamentos=' . $this->metodoPagamento; $url .= '&numeroParcelasPagamentos=' . $this->numeroParcelas; $url .= '&valorPagamentos=' . $this->valorPedido * 100; $url = retira_acentos($url); /* $datetime = new Datetime(); $datetime->setTimezone('America/Sao_Paulo'); $name = $datetime->format("Y-m-d"); $data = var_export(parse_url($url), true); Mage::log($datetime->format("h:m:s").'-'.$data."\n--------------------------------------------------", null, $name.'-fcontrol.log', true); */ echo '<iframe height="115" frameborder="0" width="300" src="' . $url . '"></iframe>'; }