Advertisement
Guest User

Untitled

a guest
May 25th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.69 KB | None | 0 0
  1.  
  2. <?php
  3.  
  4. $server = "127.0.0.1";
  5. $user = "root";
  6. $pass = "WAtufTuZ";
  7. $dbname = "strafemc";
  8. ?>
  9. <!DOCTYPE html>
  10. <html lang="fr">
  11. <head>
  12. <title>StatsBeta - StrafeMC</title>
  13. <meta charset="utf-8">
  14. <meta name="viewport" content="width=device-width, initial-scale=1">
  15. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  16. <link href="https://fonts.googleapis.com/css?family=Baloo|Cabin|Exo|Exo+2|Francois+One|Open+Sans+Condensed:300|Oswald|Poppins" rel="stylesheet">
  17. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  18. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  19. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
  20. <link href="css/index.css" rel="stylesheet">
  21. <script>
  22. $(document).ready(function(){
  23. $('[data-toggle="tooltip"]').tooltip();
  24. $('.dropdown-toggle').dropdown();
  25. });
  26. $(document).ready(function(){
  27. // Add smooth scrolling to all links in navbar + footer link
  28. $(".navbar a, footer a[href='#header1']").on('click', function(event) {
  29.  
  30. // Make sure this.hash has a value before overriding default behavior
  31. if (this.hash !== "") {
  32.  
  33. // Prevent default anchor click behavior
  34. event.preventDefault();
  35.  
  36. // Store hash
  37. var hash = this.hash;
  38.  
  39. // Using jQuery's animate() method to add smooth page scroll
  40. // The optional number (900) specifies the number of milliseconds it takes to scroll to the specified area
  41. $('html, body').animate({
  42. scrollTop: $(hash).offset().top
  43. }, 900, function(){
  44.  
  45. // Add hash (#) to URL when done scrolling (default click behavior)
  46. window.location.hash = hash;
  47. });
  48. } // End if
  49. });
  50. })
  51. </script>
  52. <style>
  53.  
  54. .statsImage{
  55. filter: drop-shadow(0px 0px 6px);
  56. }
  57.  
  58. .colT{
  59. font-size: 15px;
  60. font-family: 'Exo', sans-serif;
  61. }
  62.  
  63. .container-fluid {
  64. padding-top: 160px;
  65. padding-bottom: 160px;
  66. }
  67.  
  68. .paginationW{
  69. line-height: 17px;
  70. font-size: 25px;
  71. }
  72. </style>
  73. </head>
  74. <body class="background">
  75.  
  76. <!-- NAV !-->
  77.  
  78.  
  79. <!-- TITRE !-->
  80.  
  81. <div id="header1" class="jumbotron">
  82. <h1>StrafeMC</h1>
  83. <h3>Beta Stats for Practice / KitMap</h3>
  84. </div>
  85.  
  86. <!-- TABLEAU DES STATS !-->
  87.  
  88.  
  89.  
  90.  
  91. <?php
  92.  
  93. $id = $_GET['id'];
  94.  
  95. // CONNECTION A DATABASE
  96.  
  97. $connection = new mysqli($server, $user, $pass, $dbname);
  98. if ($connection->connect_error) {
  99. die("Connection failed: " . $connection->connect_error);
  100. }
  101.  
  102.  
  103. // SELECTIONER LE JOUEUR AVEC CE NOM
  104. $sql = ("SELECT * FROM players WHERE pseudo = '$id'");
  105. $result = $connection->query($sql);
  106. while($row = mysqli_fetch_assoc($result)){
  107.  
  108. $playerid = $row['playerid'];
  109. $uuid = $row['uuid'];
  110. $rank = $row['rank'];
  111. $name = $row['pseudo'];
  112. $ranked = $row['ranked'];
  113. $isonline = $row['isonline'];
  114. $rank = $row['rank'];
  115.  
  116. }
  117.  
  118. // SI VARIABLE $ID n'existe pas OU n'est pas mis OU n'existe pas dans la base de donnée
  119. if(is_null($name)){
  120. echo'
  121. <div class="container-fluid colT">
  122. <div class="text-center">
  123.  
  124. <h2><span class="glyphicon glyphicon-warning-sign"></span> Ce joueur est introuvable dans notre base de donnée. <span class="glyphicon glyphicon-warning-sign"></span></h2>
  125.  
  126. </div>
  127. </div>
  128. ';
  129. return;
  130. }
  131.  
  132. // SELECTIONER LES STATS KITMAP DE CE NOM
  133. $sqla = ("SELECT * FROM `kitmap-stats` WHERE 'playerid' = '$playerid'");
  134. $resulta = $connection->query($sqla);
  135. while($rowa = mysqli_fetch_assoc($resulta)){
  136. $death = $rowa['deaths'];
  137. $kill = $rowa['kills'];
  138. $koth = $rowa['koth'];
  139. $factionID = $rowa['factionUUID'];
  140. $factionR = $rowa['factionRole'];
  141. if($factionR == 0){
  142. $role = "Membre";
  143. }else if($factionR == 1){
  144. $role = "Captain";
  145. }else if($factionR == 2){
  146. $role = "Leader";
  147. }
  148.  
  149. }
  150.  
  151. echo'
  152.  
  153. <div class="container-fluid colT">
  154. <div class="row">
  155. <div class="col-sm-2">
  156. </div>
  157.  
  158. <div class="col-sm-3">
  159. <h1 class="text-center">'.$name.'</h1>
  160. <br>
  161. <div class="statsImage text-center">
  162. <img src="https://visage.surgeplay.com/full/225/'.$uuid.'">
  163. </div>
  164. <br>
  165. <br>
  166. <br>
  167. <ul class="nav nav-pills nav-stacked">
  168. <li class="active"><a data-toggle="tab" href="#KitMap">KitMap</a></li>
  169. <li><a data-toggle="tab" href="#practice">Practice</a></li>
  170. </ul>
  171. </div>
  172.  
  173. <div class="col-sm-4">
  174. <div class="tab-content">
  175. <div id="KitMap" class="tab-pane fade in active paginationW">
  176.  
  177. <h1><strong><kbd>KitMap</kbd></strong></h1>
  178. <br>
  179. <p>Kill : '.$kill.'</p>
  180. <p>Mort : '.$death.'</p>
  181. <p>Capture de KoTH : '.$koth.'</p>
  182.  
  183.  
  184. ';
  185.  
  186. if($factionID = "none"){
  187.  
  188. echo'
  189.  
  190. <p>Aucune Faction</p>
  191. </div>
  192.  
  193. ';
  194.  
  195. }else{
  196.  
  197. $sqlb = ("SELECT * FROM `kitmap-faction` WHERE 'uuid' = '$factionID'");
  198. $resultb = $connection->query($sqlb);
  199.  
  200. while($rowb = mysqli_fetch_assoc($resultb)){
  201. $faction = $rowb['name'];
  202. }
  203.  
  204.  
  205. echo'
  206. <p>Membre: </p>
  207. <p>Faction : '.$faction.'</p>
  208. <p>Role : '.$role.'</p>
  209.  
  210.  
  211. <table class="table">
  212. <thead>
  213. <th>#</th>
  214. <th>Joueur</th>
  215. <th>Role</th>
  216. </thead>
  217. <tbody>
  218. ';
  219. // SELECTIOND ES JOIUEURS QUI ONT LA MEME FACTION
  220. $sqlc = ("SELECT * FROM `kitmap-stats` WHERE 'uuid' = '$factionID'");
  221. $resultc = $connection->query($sqlc);
  222. while($rowc = mysqli_fetch_assoc($resultc)){
  223. $playerid2 = $rowc['playerid'];
  224. $factionRole2 = $rowcs['factionRole'];
  225.  
  226. if($factionRole2 == 0){
  227. $role2 = "Membre";
  228. }else if($factionRole2 == 1){
  229. $role2 = "Captain";
  230. }else if($factionRole2 == 2){
  231. $role2 = "Leader";
  232. }
  233.  
  234. $sqld = ("SELECT * FROM players WHERE 'playerid' = '$playerid2'");
  235. $resultd = $connection->query($sqld);
  236. while($rowd = mysqli_fetch_assoc($resultd)){
  237. $name2 = $rowd['pseudo'];
  238. }
  239.  
  240. echo'
  241. <tr>
  242. <td><img src="https://crafatar.com/avatars/'.$name2.'/?size=22" data-toggle="tooltip" data-placement="top" title="'.$name2.'"></td>
  243. <td><a href="stats.php?id='.$name2.'" target="_BLANK">'.$name2.'</a></td>
  244. <td>'.$role2.'</td>
  245. </tr>
  246.  
  247. ';
  248. }
  249.  
  250. echo'
  251.  
  252. </tbody>
  253. </table>
  254. </div>
  255. ';
  256. }
  257.  
  258.  
  259. $sqle = ("SELECT * FROM `practice-elos` WHERE 'playerid' = '$playerid'");
  260. $resulte = $connection->query($sqle);
  261. while($rowe = mysqli_fetch_assoc($resulte)){
  262. $pots = $rowe['pots'];
  263. $debuff = $rowe['debuff'];
  264. $archer = $rowe['archer'];
  265. $combo = $rowe['combo'];
  266. $soup = $rowe['soup'];
  267. $iron = $rowe['iron'];
  268. $axepvp = $rowe['axepvp'];
  269. $builduhc = $rowe['builduhc'];
  270. $gapple = $rowe['gapple'];
  271. $global = $rowe['global'];
  272. }
  273.  
  274. echo'
  275. <div id="practice" class="tab-pane fade">
  276.  
  277. <h1><strong><kbd>Practice</kbd></strong></h1>
  278. <table class="table">
  279. <thead>
  280. <th>#GameType</th>
  281. <th>Elos</th>
  282. </thead>
  283. <tbody>
  284. <tr>
  285. <td>Global</td>
  286. <td>'.$global.'</td>
  287. </tr>
  288. <tr>
  289. <td>NoDebuff</td>
  290. <td>'.$pots.'</td>
  291. </tr>
  292. <tr>
  293. <td>Debuff</td>
  294. <td>'.$debuff.'</td>
  295. </tr>
  296. <tr>
  297. <td>Archer</td>
  298. <td>'.$archer.'</td>
  299. </tr>
  300. <tr>
  301. <td>Combo</td>
  302. <td>'.$combo.'</td>
  303. </tr>
  304. <tr>
  305. <td>Soup</td>
  306. <td>'.$soup.'</td>
  307. </tr>
  308. <tr>
  309. <td>Iron</td>
  310. <td>'.$iron.'</td>
  311. </tr>
  312. <tr>
  313. <td>AxePvP</td>
  314. <td>'.$axepvp.'</td>
  315. </tr>
  316. <tr>
  317. <td>BuildUHC</td>
  318. <td>'.$builduhc.'</td>
  319. </tr>
  320. <tr>
  321. <td>GApple</td>
  322. <td>'.$gapple.'</td>
  323. </tr>
  324. </tbody>
  325. </table>
  326. </div>
  327. </div>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332.  
  333. ';
  334.  
  335. ?>
  336.  
  337.  
  338. </body>
  339. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement