Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.61 KB | None | 0 0
  1. <?php
  2.  
  3. if (!$link = mysql_connect('ovh-1.instamcnet.com', 'root', 'bVgZWyCz7XGn')) {
  4. echo 'Não foi possível conectar ao mysql';
  5. exit;
  6. }
  7.  
  8. if (!mysql_select_db('new_pokemon_1', $link)) {
  9. echo 'Não foi possível selecionar o banco de dados';
  10. exit;
  11. }
  12.  
  13.  
  14. //////////////////////////
  15. // DEFINIÇÂO DOS RANKS //
  16. //////////////////////////
  17. $ranks = array();
  18. // NOME DA TABELA ---- TITULO DO MENU
  19. $ranks['Estatistica_SKYWARS_KILLS'] = 'Kills';
  20. $ranks['Estatistica_SKYWARS_VITORIAS'] = 'Vitorias';
  21. include("head.php");
  22. ?>
  23.  
  24. <div class="row">
  25. <div class="col-md-13" style='text-align:center;'>
  26.  
  27. <div class="tabs-wrapper tabs-alt tabs__vertical">
  28. <div class="clearfix">
  29. <!-- Nav tabs -->
  30. <ul class="nav nav-tabs col-md-13" style="margin-left:0px;margin-bottom:-24px;">
  31.  
  32. <?php
  33. #GAMBETA
  34. $foi = false;
  35. foreach ($ranks as $nomeTabela => $titulo) {
  36. if(!$foi){
  37. echo '<li class ="active"><a href="#tab4-'.$titulo.'" data-toggle="tab">'.$titulo.'</a></li>';
  38. $foi = true;
  39. }else{
  40. echo '<li><a href="#tab4-'.$titulo.'" data-toggle="tab">'.$titulo.'</a></li>';
  41. }
  42.  
  43. }
  44. ?>
  45.  
  46. </ul>
  47.  
  48. <!-- Tab panes -->
  49. <div class="tab-content col-md-13">
  50. <?php
  51. $foi = false;
  52. foreach ($ranks as $nomeTabela => $titulo) {
  53.  
  54. if($foi){
  55. echo '<div class="tab-pane fade in" id="tab4-'.$titulo.'">';
  56.  
  57. }else{
  58. echo '<div class="tab-pane fade in active" id="tab4-'.$titulo.'">';
  59. $foi = true;
  60. }
  61. ?>
  62.  
  63. <table class="table table-striped-vertical table-four-cols" >
  64. <thead>
  65. <tr>
  66. <th style="background:#1B8804;"><span style="color:white;">Skin</span></th>
  67. <th style="background:#0C9B1E;"><span style="color:white;">Nick</span></th>
  68. <th style="background:#1B8804;"><span style="color:white;">Pontos</span></th>
  69. <th style="background:#0C9B1E;"><span style="color:white;">Progresso</span></th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <?php
  74. $nivelMax = 0;
  75. $sql = "select nome, pontos, posicaoRank from instamc_rank.".$nomeTabela." order by pontos desc limit 50;";
  76. $result = mysql_query($sql, $link);
  77. if ($result) {
  78. // output data of each row
  79. $contador =1;
  80. while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
  81. if($nivelMax==0)
  82. $nivelMax = $row["pontos"];
  83. $pct = ($row["pontos"]*100)/$nivelMax;
  84. echo"<tr><td>";
  85. echo "<b>".$contador."º </b><img style=\"\padding-left: 70px;\" src='//cravatar.eu/helmhead/".$row["nome"]."/32.png'/>";
  86. $contador++;
  87. echo "</td><td>".$row["nome"]. "</td><td>".$row["pontos"]."</td>";
  88. echo '<td><div class="progress progress-striped active"><div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="'.$row["pontos"].'" aria-valuemin="0" aria-valuemax="'.$nivelMax.'" style="width: '.$pct.'%; background-color:rgb(66, 142, 29)"><span class="sr-only"></span></div></div></td>';
  89. echo "</tr>";
  90. }
  91. } else {
  92. //die('Could not get data: ' . mysql_error());
  93. echo "EROO </br>". mysql_error();
  94. }
  95. //$link->close();
  96. ?>
  97. </tbody>
  98. </table>
  99. </div>
  100. <?php } ?>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement