Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <link rel="stylesheet" href="style.css" />
- <title>Nanotech hunger games stats</title>
- </head>
- <body>
- <?php
- $request = file_get_contents('./stats.php', FILE_USE_INCLUDE_PATH);
- $jsonObject =json_decode($request);
- echo $jsonObject;
- foreach($jsonObject as $key => $value)
- {
- $userInfos = $value; ?>
- <p class="user">
- <strong>Pseudo</strong>: <?php echo ($userInfos->{'username'});
- echo '<br/>';
- echo 'Il a joué : ';
- if($userInfos->{'games'} == 1)
- {
- echo ($userInfos->{'games'} . ' partie');
- }
- else
- {
- echo ($userInfos->{'games'} . ' parties');
- }?>, a tué <?php
- if($userInfos->{'kills'} == 0)
- {
- echo "aucune personne";
- }
- elseif($userInfos->{'kills'} == 1)
- {
- echo ($userInfos->{'kills'} . ' personne');
- }
- else
- {
- echo ($userInfos->{'kills'} . ' personnes');
- }?>, est mort <?php
- if($userInfos->{'deaths'} == 0)
- {
- echo "aucune fois ";
- }
- else
- {
- echo ($userInfos->{'deaths'} . ' fois ');
- }?>et a gagné <?php
- if($userInfos->{'wonGames'} == 0)
- {
- echo "aucune partie";
- }
- elseif($userInfos->{'wonGames'} == 1)
- {
- echo ($userInfos->{'wonGames'} . ' partie');
- }
- else
- {
- echo ($userInfos->{'wonGames'} . ' parties');
- }?>. Il a été spectateur <?php
- if($userInfos->{'spectatorGames'} == 0)
- {
- echo "aucune fois ";
- }
- else
- {
- echo ($userInfos->{'spectatorGames'} . ' fois ');
- }?>et a choisit le kit aléatoire <?php
- if($userInfos->{'chooseRandomKit'} == 0)
- {
- echo "aucune fois";
- }
- else
- {
- echo ($userInfos->{'chooseRandomKit'} . ' fois');
- }?>.<br />
- <table>
- <tr class="desc">
- <td class="desc">Kits</td>
- <?php foreach($userInfos->{'kits'} as $kitsKey => $kitsValue)
- { ?>
- <td><?php echo $kitsKey;?></td>
- <?php }?>
- </tr>
- <tr>
- <td class="desc">Parties</td>
- <?php foreach($userInfos->{'kits'} as $kitsKey => $kitsValue)
- { ?>
- <td><?php echo ($kitsValue->{'uses'});?></td>
- <?php }?>
- </tr>
- <tr>
- <td class="desc">Victoires</td>
- <?php foreach($userInfos->{'kits'} as $kitsKey => $kitsValue)
- { ?>
- <td><?php if(isset($kitsValue->{'won'}) == null)
- {
- echo '0';
- }
- else
- {
- echo ($kitsValue->{'won'});
- }?></td>
- <?php }?>
- </tr>
- </table>
- </p>
- <?php }?>
- </td>
- </tr>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement