Advertisement
Guest User

Untitled

a guest
Mar 31st, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. <?php
  2. $config_host = "localhost"; // Hospedagem
  3. $config_user = ""; // Usuario
  4. $config_pass = ""; // Senha
  5. $config_sql = ""; // SQL
  6. session_start();
  7. date_default_timezone_set("America/Sao_Paulo");
  8. $pdo = new PDO("mysql:host=".$config_host.";dbname=".$config_sql.";charset=UTF8;","".$config_user."","".$config_pass."");
  9. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
  10. $pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,true);
  11. $time = time();
  12. $ip = $_SERVER['REMOTE_ADDR'];
  13. if(isset($_SESSION['logado'])){
  14. $aa_data_c = $pdo->query("SELECT * FROM aa_usuarios WHERE usuario = '".$_SESSION['usuario']."' AND status='true' AND banido='false'");
  15. if($aa_data_c->rowCount() == 0){ header("Location:deslogar"); }
  16. $aa_data = $aa_data_c->fetch(PDO::FETCH_ASSOC);
  17. $online_time = time() - 1*30;
  18. $online = $pdo->query("UPDATE aa_usuarios SET online='true', online_time='".time()."' WHERE usuario='".$aa_data['usuario']."'");
  19. $online_remove = $pdo->query("UPDATE aa_usuarios SET online='false' WHERE online_time < '$online_time'");
  20. $logado = true;
  21. }else{
  22. $logado = false;
  23. }
  24. $ver_tema = $pdo->query("SELECT * FROM aa_ktema")->fetch(PDO::FETCH_ASSOC);
  25. //$ver_tema['tema'] = '3';
  26. if($ver_tema['tema'] == '1'){
  27. $tema_color = "tema_color_cinza.png";
  28. $tema_bg = "tema_bg_eee.png";
  29. $tema_lbg = "tema_lbg_esp.png";
  30. $tema_fonte = "#333";
  31. $tema_bg_menu = "rgba(0,0,0,0.2)";
  32. $tema_fonte_menu = "#FFF";
  33. }else if($ver_tema['tema'] == "2"){
  34. $tema_color = "tema_color_hlive.png";
  35. $tema_bg = "loginbg1.jpg";
  36. $tema_lbg = "loginbg1.jpg";
  37. $tema_fonte = "#FFF";
  38. $tema_bg_menu = "rgba(0,0,0,0.2)";
  39. $tema_fonte_menu = "#FFF";
  40. }else if($ver_tema['tema'] == "3"){
  41. $tema_color = "tema_color_laranja.png";
  42. $tema_bg = "tema_bg_eee.png";
  43. $tema_lbg = "tema_lbg_laranja.jpg";
  44. $tema_fonte = "#000";
  45. $tema_bg_menu = "rgba(255,255,255,0.2)";
  46. $tema_fonte_menu = "#FFF";
  47. }
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement