Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $server = "127.0.0.1";
- $user = "root";
- $pass = "WAtufTuZ";
- $dbname = "strafemc";
- ?>
- <!DOCTYPE html>
- <html lang="fr">
- <head>
- <title>StatsBeta - StrafeMC</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <link href="https://fonts.googleapis.com/css?family=Baloo|Cabin|Exo|Exo+2|Francois+One|Open+Sans+Condensed:300|Oswald|Poppins" rel="stylesheet">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <link href="css/index.css" rel="stylesheet">
- <script>
- $(document).ready(function(){
- $('[data-toggle="tooltip"]').tooltip();
- $('.dropdown-toggle').dropdown();
- });
- $(document).ready(function(){
- // Add smooth scrolling to all links in navbar + footer link
- $(".navbar a, footer a[href='#header1']").on('click', function(event) {
- // Make sure this.hash has a value before overriding default behavior
- if (this.hash !== "") {
- // Prevent default anchor click behavior
- event.preventDefault();
- // Store hash
- var hash = this.hash;
- // Using jQuery's animate() method to add smooth page scroll
- // The optional number (900) specifies the number of milliseconds it takes to scroll to the specified area
- $('html, body').animate({
- scrollTop: $(hash).offset().top
- }, 900, function(){
- // Add hash (#) to URL when done scrolling (default click behavior)
- window.location.hash = hash;
- });
- } // End if
- });
- })
- </script>
- <style>
- .statsImage{
- filter: drop-shadow(0px 0px 6px);
- }
- .colT{
- font-size: 15px;
- font-family: 'Exo', sans-serif;
- }
- .container-fluid {
- padding-top: 160px;
- padding-bottom: 160px;
- }
- .paginationW{
- line-height: 17px;
- font-size: 25px;
- }
- </style>
- </head>
- <body class="background">
- <!-- NAV !-->
- <!-- TITRE !-->
- <div id="header1" class="jumbotron">
- <h1>StrafeMC</h1>
- <h3>Beta Stats for Practice / KitMap</h3>
- </div>
- <!-- TABLEAU DES STATS !-->
- <?php
- $id = $_GET['id'];
- // CONNECTION A DATABASE
- $connection = new mysqli($server, $user, $pass, $dbname);
- if ($connection->connect_error) {
- die("Connection failed: " . $connection->connect_error);
- }
- // SELECTIONER LE JOUEUR AVEC CE NOM
- $sql = ("SELECT * FROM players WHERE pseudo = '$id'");
- $result = $connection->query($sql);
- while($row = mysqli_fetch_assoc($result)){
- $playerid = $row['playerid'];
- $uuid = $row['uuid'];
- $rank = $row['rank'];
- $name = $row['pseudo'];
- $ranked = $row['ranked'];
- $isonline = $row['isonline'];
- $rank = $row['rank'];
- }
- // SI VARIABLE $ID n'existe pas OU n'est pas mis OU n'existe pas dans la base de donnée
- if(is_null($name)){
- echo'
- <div class="container-fluid colT">
- <div class="text-center">
- <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>
- </div>
- </div>
- ';
- return;
- }
- // SELECTIONER LES STATS KITMAP DE CE NOM
- $sqla = ("SELECT * FROM `kitmap-stats` WHERE 'playerid' = '$playerid'");
- $resulta = $connection->query($sqla);
- while($rowa = mysqli_fetch_assoc($resulta)){
- $death = $rowa['deaths'];
- $kill = $rowa['kills'];
- $koth = $rowa['koth'];
- $factionID = $rowa['factionUUID'];
- $factionR = $rowa['factionRole'];
- if($factionR == 0){
- $role = "Membre";
- }else if($factionR == 1){
- $role = "Captain";
- }else if($factionR == 2){
- $role = "Leader";
- }
- }
- echo'
- <div class="container-fluid colT">
- <div class="row">
- <div class="col-sm-2">
- </div>
- <div class="col-sm-3">
- <h1 class="text-center">'.$name.'</h1>
- <br>
- <div class="statsImage text-center">
- <img src="https://visage.surgeplay.com/full/225/'.$uuid.'">
- </div>
- <br>
- <br>
- <br>
- <ul class="nav nav-pills nav-stacked">
- <li class="active"><a data-toggle="tab" href="#KitMap">KitMap</a></li>
- <li><a data-toggle="tab" href="#practice">Practice</a></li>
- </ul>
- </div>
- <div class="col-sm-4">
- <div class="tab-content">
- <div id="KitMap" class="tab-pane fade in active paginationW">
- <h1><strong><kbd>KitMap</kbd></strong></h1>
- <br>
- <p>Kill : '.$kill.'</p>
- <p>Mort : '.$death.'</p>
- <p>Capture de KoTH : '.$koth.'</p>
- ';
- if($factionID = "none"){
- echo'
- <p>Aucune Faction</p>
- </div>
- ';
- }else{
- $sqlb = ("SELECT * FROM `kitmap-faction` WHERE 'uuid' = '$factionID'");
- $resultb = $connection->query($sqlb);
- while($rowb = mysqli_fetch_assoc($resultb)){
- $faction = $rowb['name'];
- }
- echo'
- <p>Membre: </p>
- <p>Faction : '.$faction.'</p>
- <p>Role : '.$role.'</p>
- <table class="table">
- <thead>
- <th>#</th>
- <th>Joueur</th>
- <th>Role</th>
- </thead>
- <tbody>
- ';
- // SELECTIOND ES JOIUEURS QUI ONT LA MEME FACTION
- $sqlc = ("SELECT * FROM `kitmap-stats` WHERE 'uuid' = '$factionID'");
- $resultc = $connection->query($sqlc);
- while($rowc = mysqli_fetch_assoc($resultc)){
- $playerid2 = $rowc['playerid'];
- $factionRole2 = $rowcs['factionRole'];
- if($factionRole2 == 0){
- $role2 = "Membre";
- }else if($factionRole2 == 1){
- $role2 = "Captain";
- }else if($factionRole2 == 2){
- $role2 = "Leader";
- }
- $sqld = ("SELECT * FROM players WHERE 'playerid' = '$playerid2'");
- $resultd = $connection->query($sqld);
- while($rowd = mysqli_fetch_assoc($resultd)){
- $name2 = $rowd['pseudo'];
- }
- echo'
- <tr>
- <td><img src="https://crafatar.com/avatars/'.$name2.'/?size=22" data-toggle="tooltip" data-placement="top" title="'.$name2.'"></td>
- <td><a href="stats.php?id='.$name2.'" target="_BLANK">'.$name2.'</a></td>
- <td>'.$role2.'</td>
- </tr>
- ';
- }
- echo'
- </tbody>
- </table>
- </div>
- ';
- }
- $sqle = ("SELECT * FROM `practice-elos` WHERE 'playerid' = '$playerid'");
- $resulte = $connection->query($sqle);
- while($rowe = mysqli_fetch_assoc($resulte)){
- $pots = $rowe['pots'];
- $debuff = $rowe['debuff'];
- $archer = $rowe['archer'];
- $combo = $rowe['combo'];
- $soup = $rowe['soup'];
- $iron = $rowe['iron'];
- $axepvp = $rowe['axepvp'];
- $builduhc = $rowe['builduhc'];
- $gapple = $rowe['gapple'];
- $global = $rowe['global'];
- }
- echo'
- <div id="practice" class="tab-pane fade">
- <h1><strong><kbd>Practice</kbd></strong></h1>
- <table class="table">
- <thead>
- <th>#GameType</th>
- <th>Elos</th>
- </thead>
- <tbody>
- <tr>
- <td>Global</td>
- <td>'.$global.'</td>
- </tr>
- <tr>
- <td>NoDebuff</td>
- <td>'.$pots.'</td>
- </tr>
- <tr>
- <td>Debuff</td>
- <td>'.$debuff.'</td>
- </tr>
- <tr>
- <td>Archer</td>
- <td>'.$archer.'</td>
- </tr>
- <tr>
- <td>Combo</td>
- <td>'.$combo.'</td>
- </tr>
- <tr>
- <td>Soup</td>
- <td>'.$soup.'</td>
- </tr>
- <tr>
- <td>Iron</td>
- <td>'.$iron.'</td>
- </tr>
- <tr>
- <td>AxePvP</td>
- <td>'.$axepvp.'</td>
- </tr>
- <tr>
- <td>BuildUHC</td>
- <td>'.$builduhc.'</td>
- </tr>
- <tr>
- <td>GApple</td>
- <td>'.$gapple.'</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- ';
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement