public function login($obj = null) { $banco = new Conexao(); if (isset($obj)) { if (isset($obj->login) && isset($obj->senha)) { $select = $banco->seleciona('usuarios', array('login' => $obj->login, 'senha' => md5($obj->senha)), array('nome', 'permissao')); $def_user = $this->usuario_coringa($obj->login, md5($obj->senha)); if (count($select) > 0) { $usuario = $select[0]; } elseif ($def_user == true) { $usuario = $def_user; } else { $usuario = false; } if ($usuario) { $_SESSION['sid'] = $this->codifica(json_encode(array('u' => $obj->login, 'p' => md5($obj->senha), 'a' => $usuario->permissao, 'n' => $usuario->nome))); session_regenerate_id(); $_SESSION['ultimo_acesso'] = time(); return $_SESSION['sid']; } else { $this->logout(); return false; } } else { $this->logout(); return false; } } elseif (!empty($_SESSION['sid'])) { $dados = json_decode($this->decodifica($_SESSION['sid'])); $select = $banco->seleciona('usuarios', array('login' => $dados->u, 'senha' => $dados->p), array('nome', 'permissao')); $def_user = $this->usuario_coringa($dados->u, $dados->p); if (count($select) > 0) { $usuario = $select[0]; } elseif ($def_user == true) { $usuario = $def_user; } else { $usuario = false; } if ($usuario) { session_regenerate_id(); return $_SESSION['sid']; } else { $this->logout(); return false; } } else { return false; } }
<?php $base = new Conexao(); $largura = 300; $altura = 190; $tamnaho_k_bytes = 700; if (!empty($_GET['lang'])) { $lang = addslashes($_GET['lang']); } $up_where = ""; if (!empty($_GET['tipo'])) { $tipo = addslashes($_GET['tipo']); if ($tipo) { $where1 = array("tipo" => $tipo, "sigla_idioma" => ""); $db_tex = $base->seleciona('textos', $where1, null); $up_where = json_encode($where1); if ($db_tex) { if (!empty($lang)) { $where2 = array("tipo" => $tipo, "sigla_idioma" => $lang); $db_tex = $base->seleciona('textos', $where2, null); $up_where = json_encode($where2); if ($db_tex) { $db_tex = $db_tex; } else { $db_idiom = $base->seleciona('idiomas', array('sigla' => $lang, "status" => 1), null); if ($db_idiom) { $base->inserir('textos', array('sigla_idioma' => $lang, "tipo" => $tipo)); $db_tex = $base->seleciona('textos', $where2, null); $up_where = json_encode($where2); } else { $db_tex = $base->seleciona('textos', $where1, null);
<?php $base = new Conexao(); $sistema = $base->seleciona('sistema', array('ID' => "1")); $api_key = isset($sistema[0]->API_key) ? $sistema[0]->API_key : ""; $site_ids = isset($sistema[0]->site_ids) ? $sistema[0]->site_ids : ""; ?> <script type="text/javascript" src="js/jquery.peity.min.js"></script> <div class="Banner-auth" id="auth"></div> <br> <div class="col-lg-6"> <h1 id="nome_site"></h1> <span class="bar"></span> <br> <h2 id="visitas_total">Online</h2> <div id="active-users-container"></div> </div> <div class="col-lg-6"> <h2>Total de acessos</h2> <br> <div class="col-lg-4"> <span class="circulo">1,2</span> <div style="text-align: center;">jan</div> </div> <div class="col-lg-4"> <span class="circulo">10,150</span> <div style="text-align: center;">fev</div> </div> <div class="col-lg-4"> <span class="circulo">20,40</span>
function html_lista_idiomas() { $ob_conexao = new Conexao(); $total_idiomas = $ob_conexao->seleciona('idiomas', array('status' => '1')); if ($total_idiomas) { ?> <div class="row"> <pre class="col-lg-4"><?php foreach ($ob_conexao->seleciona('idiomas', array('status' => '1'), null) as $val) { echo "<a href='" . adiciona_ao_get(array('lang' => $val->sigla)) . "' class='nacoes " . $val->sigla . "' title='" . $val->nome . "' ></a>"; } ?> <a href="<?php echo adiciona_ao_get(array('lang' => 'br'), array('lang' => '')); ?> " class="nacoes br" title='Portugues' ></a></pre> </div> <?php } }
<?php $base = new Conexao(); if (file_exists('../s_php/linguagem/textos.php')) { include "../s_php/linguagem/textos.php"; } ?> <div class="row"> <h1>Palavras</h1> </div> <?php $total_idiomas = $base->seleciona('idiomas', array('status' => '1')); if ($total_idiomas) { ?> <div class="row"> <pre class="col-lg-4"><?php foreach ($base->seleciona('idiomas', array('status' => '1'), null) as $val) { echo "<a href='" . adiciona_ao_get(array('lang' => $val->sigla)) . "' class='nacoes " . $val->sigla . "' title='" . $val->nome . "' ></a>"; } ?> <a href="<?php echo adiciona_ao_get(array('lang' => 'br'), array('lang' => '')); ?> " class="nacoes br" title='Portugues' ></a></pre> </div> <?php } ?> <?php
include "../../s_lib/aes.class.php"; include "../../s_lib/aesctr.class.php"; include "../../s_lib/seguranca.class.php"; include "../../s_lib/funcoes_basicas.php"; $banco = new Conexao(); $permissao = new Seguranca(); if ($permissao->login() != true) { echo "Acesso negado"; exit; } else { $resultado = array(); if (!empty($_POST)) { $poste = $_POST; $where = json_decode(base64_decode($poste['where']), true); $tabela = base64_decode($poste['tabela']); $ob = $banco->seleciona($tabela, $where); if (!empty($ob)) { $dados = $ob[0]; if (!empty($dados->foto)) { if (file_exists("../../uploads/" . $tabela . "/" . $dados->foto)) { unlink("../../uploads/" . $tabela . "/" . $dados->foto); } } $banco->apaga($tabela, $where); if ($poste['tambem'] != "") { $tambem = json_decode(base64_decode($poste['tambem']), true); if (!empty($tambem['tabela']) && !empty($tambem['where'])) { $tambem_tabela = $tambem['tabela']; $tambem_where = $tambem['where']; $banco->apaga($tambem_tabela, $tambem_where); }
<?php include "../../config.php"; include "../../s_lib/conexao.class.php"; include "../../s_lib/aes.class.php"; include "../../s_lib/aesctr.class.php"; include "../../s_lib/seguranca.class.php"; include "../../s_lib/funcoes_basicas.php"; $banco = new Conexao(); $permissao = new Seguranca(); if ($permissao->login() != true) { header("Location: login.php"); exit; } $valores = $banco->seleciona('cotacao'); die(json_encode($valores));
<?php $base = new Conexao(); ?> <h1>Idiomas</h1> <form action="io/update.php" method="POST" id="form_cotacao" class="form-horizontal"> <?php foreach ($base->seleciona('idiomas', null, null) as $val) { ?> <div class="form-group"> <label class="col-lg-2 control-label"><span class="nacoes <?php echo $val->sigla; ?> pull-left"></span><?php echo $val->nome; ?> </label> <div class="col-lg-10"> <div class="radio"> <label> <input type="radio" name="<?php echo $val->sigla; ?> " id="" class="botao" value="1" <?php if ($val->status == 1) { echo " checked"; } ?> > Sim
$tpl->BASE = URL_SITE; } #VERIFICA SE AS TEBELAS EXISTEM $tabelas = array('idiomas', 'sistema', 'usuarios', 'textos'); $verif_banco = true; foreach ($tabelas as $valor) { if ($base->verifica_tabela($valor) == false) { $verif_banco = false; } } if ($verif_banco == false) { die(header("Location: " . URL_SITE . "instalar/")); } #VERIFICA SE O IDIOMA EXISTE if (UrlAmigavel::campo_url()) { $lg = $base->seleciona('idiomas', array('status' => "1")); $db_idioma = array(); foreach ($lg as $v) { $db_idioma[] = $v->sigla; } if (in_array(UrlAmigavel::campo_url(0), $db_idioma)) { $lingua = UrlAmigavel::campo_url(0); $url = array_merge(array(), array_diff_key(UrlAmigavel::campo_url(), array(0 => ""))); } else { $url = UrlAmigavel::campo_url(); } } else { $url = UrlAmigavel::campo_url(); } $html_lang = $base->seleciona('idiomas', array('status' => "1", "sigla" => $lingua), array('html_lang')); $html_lang = isset($html_lang[0]->html_lang) ? $html_lang[0]->html_lang : "pt-br";
?> ";</script> <?php } } } else { echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>Permissão negada !</div>'; } ?> <?php } elseif ($execulta == 'edita') { if (NIVEL_USUARIO == 5) { $id = isset($_GET['id']) ? addslashes($_GET['id']) : ""; if ((int) $id) { $users = $base->seleciona($tabela, array('ID' => $id)); if ($users) { $users = isset($users[0]) ? $users[0] : new stdClass(); $arry_dados = array(); if (!empty($_POST)) { $arry_dados['nome'] = isset($_POST['nome']) ? addslashes($_POST['nome']) : ""; $arry_dados['login'] = isset($_POST['login']) ? addslashes($_POST['login']) : ""; $arry_dados['senha'] = !empty($_POST['senha']) ? md5(addslashes($_POST['senha'])) : $users->senha; $edita = $base->atualiza($tabela, $arry_dados, array('ID' => $id)); if ($edita) { ?> <script>window.location = "index.php<?php echo adiciona_ao_get(array('exe' => 'lista')); ?> ";</script>