// CONEXAO LOCAL
// mysql_connect('localhost','root','1234') or die ('Houve erro na tentativa de Conexao');
// mysql_select_db('plenaventura') or die ('Houve erro na tentativa de Conexao');
// CONEXAO REMOTA
mysql_connect('localhost','plenaventura','7FF&TRe46$5') or die ('DBMS Server Error');
mysql_select_db('vxsbnoej_plenaventura') or die ('Houve erro na tentativa de Conexao');
?>
@session_start();
foreach ($_GET as $chave=>$valor) $$chave=$valor;
foreach ($_POST as $chave=>$valor) $$chave=$valor;
foreach ($_SESSION as $chave=>$valor) $$chave=$valor;
$PHP_SELF = 'index.php';
if($_GET['changelang']){
$lang = $changelang;
$_SESSION['lang'] = $lang;
session_register("lang");
}
if($_GET['lang']){
$lang = "";
$lang = $_GET['lang'];
$_SESSION['lang'] = $lang;
//@session_register("lang");
echo "redirect...";
@header("Location: https://plenaventura.com.br");
}
if(!$_SESSION['lang']){
$lang = 1;
$_SESSION['lang'] = 1;
// session_register("lang");
}
function lang($string,$lang){
!$lang?$lang=1:'';
$word = @mysql_result(@mysql_query("SELECT value FROM lang_options WHERE id_lang = '$lang' AND label = '$string' LIMIT 0,1"),0,0);
return $word;
}
function situacao($s){
if($s=="A"){
$situacao = " ";
}
if($s=="I"){
$situacao = " ";
}
return $situacao;
}
if(!$id_usuario_adm){
$id_usuario_adm = $_SESSION['id_usuario_adm'];
}
function camposObrigatorios($campos){
$campos = explode(',',$campos);
for($i=0;$i$linha[$CDescricao]\n";
}
}
function verificaCPF($cpf) {
if ($cpf == 0) return 0;
if (strlen($cpf) <> 11) return 0;
$total1 = ($cpf[0] * 10) +
($cpf[1] * 9) +
($cpf[2] * 8) +
($cpf[3] * 7) +
($cpf[4] * 6) +
($cpf[5] * 5) +
($cpf[6] * 4) +
($cpf[7] * 3) +
($cpf[8] * 2);
$resto = $total1 % 11;
$digito1 = $resto < 2 ? 0 : 11 - $resto;
$total2 = ($cpf[0] * 11) +
($cpf[1] * 10) +
($cpf[2] * 9) +
($cpf[3] * 8) +
($cpf[4] * 7) +
($cpf[5] * 6) +
($cpf[6] * 5) +
($cpf[7] * 4) +
($cpf[8] * 3) +
($cpf[9] * 2);
$resto = $total2 % 11;
$digito2 = $resto < 2 ? 0 : 11 - $resto;
return (($cpf[9] == $digito1) && ($cpf[10] == $digito2));
}
function limpaNum($numero) {
$a = strlen($numero);
$myString = "";
for ($x=0;$x<$a;$x++) {
$i = ord($numero[$x]);
if ( $i>47 && $i<58 ){
$myString .= $numero[$x];
}
}
return $myString;
}
function find_descricao($CSelect, $CFrom, $CWhere, $CConteudo, $tipo, $Conexao=""){
if ($tipo == "int") {
$sql = "SELECT $CSelect FROM $CFrom WHERE $CWhere = $CConteudo";
}
if ($tipo == "text") {
$sql = "SELECT $CSelect FROM $CFrom WHERE $CWhere = '$CConteudo'";
}
//echo $sql;
if ($Conexao){
$resultado = @mysql_query($sql, $Conexao);
}else{
$resultado = @mysql_query($sql);
}
$linha = @mysql_fetch_array($resultado);
return $linha[$CSelect];
}
function reduzfoto($img_origem,$img_destino,$limite,$sufixo=""){
if (!file_exists($img_origem)) return false;
$arq = getimagesize($img_origem);
if ($arq[2]!=2){
return false;
}
$largura = $arq[0];
$altura = $arq[1];
if (($largura >= $limite) || ($altura >= $limite)){
if ($largura > $altura){
$altura = ($limite*$altura/$largura);
$largura = $limite;
}else if ($altura > $largura){
$largura = ($limite*$largura/$altura);
$altura = $limite;
}else if ($altura == $largura){
$altura = $limite;
$largura = $limite;
}
}else{
$largura = $largura;
$altura = $altura;
}
if ($arq[2]==1){ // Gif
if (!$img = ImageCreateFromGif($img_origem)) return false;
}
if ($arq[2]==2){ // Jpeg
if (!$img = ImageCreateFromJpeg($img_origem)) return false;
}
if ($arq[2]==3){ // png
if (!$img = ImageCreateFromPng($img_origem)) return false;
}
$img_nova = ImageCreateTrueColor($largura,$altura);
ImageCopyResampled($img_nova, $img, 0, 0, 0, 0, $largura,$altura, ImageSX($img), ImageSY($img));
ImageInterlace($img_nova,1);
$matriz_destino = split("/",$img_destino);
While(@list($key,$value)= each($matriz_destino)){
$img_nova_nome = strtolower($value);
$nome_img = $value;
}
$img_ponto = strpos($img_nova_nome,".");
$extencao = substr($img_nova_nome,$img_ponto,strlen($img_nova_nome));
$img_nova_nome = substr($img_nova_nome,0,$img_ponto);
$dir = str_replace($nome_img,"",$img_destino);
$img_destino = $dir.$img_nova_nome.$sufixo.$extencao;
$retorno = $img_nova_nome.$sufixo.$extencao;
if ($arq[2]==1){ // Gif
ImageGif($img_nova,$img_destino);
ImageDestroy($img_nova);
ImageDestroY($img);
}
if ($arq[2]==2){ // Jpeg
ImageJpeg($img_nova,$img_destino);
ImageDestroy($img_nova);
ImageDestroY($img);
}
if ($arq[2]==3){ // Jpeg
ImagePng($img_nova,$img_destino);
ImageDestroy($img_nova);
ImageDestroY($img);
}
if (file_exists($img_destino)){
return $retorno;
}
return false;
}
function zeros($numero,$tamanho) {
$a = strlen($numero);
$myString = "";
if ($tamanho > $a) {
for ($x = $tamanho-$a;$x;$x--) {
$myString .= "0";
}
}
$myString .= $numero;
return $myString;
}
function cabecalho($opcao){
$diasemana[0] = "Domingo";
$diasemana[1] = "Segunda-feira";
$diasemana[2] = "Terça-feira";
$diasemana[3] = "Quarta-feira";
$diasemana[4] = "Quinta-feira";
$diasemana[5] = "Sexta-feira";
$diasemana[6] = "Sábado";
$diasemanared[0] = "Domingo";
$diasemanared[1] = "Segunda";
$diasemanared[2] = "Terça";
$diasemanared[3] = "Quarta";
$diasemanared[4] = "Quinta";
$diasemanared[5] = "Sexta";
$diasemanared[6] = "Sábado";
$mesnome[1] = "janeiro";
$mesnome[2] = "fevereiro";
$mesnome[3] = "março";
$mesnome[4] = "abril";
$mesnome[5] = "maio";
$mesnome[6] = "junho";
$mesnome[7] = "julho";
$mesnome[8] = "agosto";
$mesnome[9] = "setembro";
$mesnome[10] = "outubro";
$mesnome[11] = "novembro";
$mesnome[12] = "dezembro";
$mesnomered[1] = "01";
$mesnomered[2] = "02";
$mesnomered[3] = "03";
$mesnomered[4] = "04";
$mesnomered[5] = "05";
$mesnomered[6] = "06";
$mesnomered[7] = "07";
$mesnomered[8] = "08";
$mesnomered[9] = "09";
$mesnomered[10] = "10";
$mesnomered[11] = "11";
$mesnomered[12] = "12";
$ano = date('Y');
$mes = date('n');
$dia = date('d');
$diasem = date('w');
$hora=getdate();
$horacerta=($hora['hours'].':'.date('i'));
if ($opcao == "datahora"){
$data = $diasemana[$diasem].', '.$dia.' de '.$mesnome[$mes].' de '.$ano.' | '.$horacerta;
}
if ($opcao == "datahorared"){
$data = $diasemana[$diasem].', '.$dia.'.'.$mesnomered[$mes].'.'.$ano.' | '.$horacerta;
}
if ($opcao == "data"){
$data = $diasemana[$diasem].', '.$dia.' de '.$mesnome[$mes].' de '.$ano;
}
if ($opcao == "datared"){
$data = $diasemanared[$diasem].', '.$dia.' / '.$mesnomered[$mes].' / '.$ano;
}
if ($opcao == "datainter"){
$data = $diasemanared[$diasem].', '.$dia.'.'.$mesnomered[$mes].'.'.$ano;
}
return $data;
}
function formatadata($data, $tipo){
$mesnome[1] = "janeiro";
$mesnome[2] = "fevereiro";
$mesnome[3] = "março";
$mesnome[4] = "abril";
$mesnome[5] = "maio";
$mesnome[6] = "junho";
$mesnome[7] = "julho";
$mesnome[8] = "agosto";
$mesnome[9] = "setembro";
$mesnome[10] = "outubro";
$mesnome[11] = "novembro";
$mesnome[12] = "dezembro";
if ($tipo == "data"){
$dia =($data[0].$data[1]);
$mes =($data[3].$data[4]);
$ano =($data[6].$data[7].$data[8].$data[9]);
$mes = $mes*1;
$datasaida = $dia." de ".$mesnome[$mes]." de ".$ano;
}
if ($tipo == "data2"){
$dia =($data[8].$data[9]);
$mes =($data[5].$data[6]);
$ano =($data[0].$data[1].$data[2].$data[3]);
$mes = $mes*1;
$datasaida = $dia." de ".$mesnome[$mes]." de ".$ano;
}
return $datasaida;
}
function difData($d1, $d2, $sep){
$d1 = explode($sep, $d1);
$d2 = explode($sep, $d2);
$timestamp1 = @mktime(0,0,0,$d1[1],$d1[0],$d1[2]);
$timestamp2 = @mktime(4,12,0,$d2[1],$d2[0],$d2[2]);
$segundos_diferenca = $timestamp1 - $timestamp2;
$dias_diferenca = $segundos_diferenca / (60 * 60 * 24);
$dias_diferenca = abs($dias_diferenca);
$dias_diferenca = floor($dias_diferenca);
return $dias_diferenca;
}
function geraTitulo($t,$m){
$menu = mysql_result(mysql_query("SELECT $t FROM menu WHERE id_menu = '$m'"),0,0);
echo $menu;
}
?>
PLENAVENTURA - Investimentos