Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.70 KB | None | 0 0
  1. <html>
  2.  
  3. <body>
  4.  
  5.     <h1 style="font-family: trebuchet ms">Online Members</h1>
  6.     <?php
  7. $gang = $_GET['group'];
  8. $squad = $_GET['squad'];
  9. if (!isset($gang) || isset($squad)) {
  10.     $content =     file_get_contents('http://jarno.pro/stuff/api/ab.php?squad='. $squad .'');
  11. } else {
  12.  
  13.     $content =     file_get_contents('http://jarno.pro/stuff/api/ab.php?gang='. $gang .'');
  14. }
  15.  
  16. $hexToHex = array('#1e01ff' => '#00a2ff', '#ff01b4' => '#04ff00');
  17.  
  18. $result  = json_decode($content);
  19.  
  20. //print_r( $result);
  21.  
  22.     echo('<table width=70%>');
  23.     echo('<tr>');
  24.  
  25.     echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
  26.     echo('Name');
  27.     echo('</td>');
  28.  
  29.     echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
  30.     echo('Occupation');
  31.     echo('</td>');
  32.  
  33.     echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
  34.     echo('Cash');
  35.     echo('</td>');
  36.  
  37.     echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
  38.     echo('Playtime');
  39.     echo('</td>');
  40.  
  41.     echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
  42.     echo('Group');
  43.     echo('</td>');
  44.  
  45.     echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
  46.     echo('Squad');
  47.     echo('</td>');
  48.  
  49.     echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
  50.     echo('Ping');
  51.     echo('</td>');
  52.  
  53.     echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
  54.     echo('Country');
  55.     echo('</td>');
  56.  
  57.     echo('</tr>');
  58.  
  59. foreach ($result as $item) {
  60.  
  61.     for ($k = 0; $k <= sizeof($item); $k++) {
  62.         $name = $item[$k]->name ;
  63.         $occ = $item[$k]->occupation ;
  64.         $team = $item[$k]->team;
  65.         $colorR = $item[$k]->color[0];
  66.         $colorG = $item[$k]->color[1];
  67.         $colorB = $item[$k]->color[2];
  68.         $color = sprintf("#%02x%02x%02x", $colorR, $colorG, $colorB);
  69.         echo('<tr>');
  70.         echo('<td style="color: '. $hexToHex[$color] .'; font-family:trebuchet MS;">');
  71.         echo($name);
  72.         echo('</td>');
  73.         echo('<td style="font-family:trebuchet MS;">');
  74.         echo($occ);
  75.         echo('</td>');
  76.         echo('<td style="font-family:trebuchet MS;">');
  77.         if ($item[$k]->cash > 0) {
  78.             echo('$ '. number_format($item[$k]->cash) .'');
  79.         }
  80.         echo('</td>');
  81.         echo('<td style="font-family:trebuchet MS;">');
  82.         if ($item[$k]->playtime / 60 > 0) {
  83.             echo(''. $item[$k]->playtime / 60 .' H');
  84.         }
  85.         echo('</td>');
  86.         echo('<td style="font-family:trebuchet MS;">');
  87.         echo($item[$k]->gang);
  88.         echo('</td>');
  89.         echo('<td style="font-family:trebuchet MS;">');
  90.         echo($item[$k]->squad);
  91.         echo('</td>');
  92.         echo('<td style="font-family:trebuchet MS;">');
  93.         echo($item[$k]->ping);
  94.         echo('</td>');
  95.         echo('<td style="font-family:trebuchet MS;">');
  96.         echo($item[$k]->country);
  97.         echo('</td>');
  98.         echo('</tr>');
  99.     }
  100. }
  101. echo('</table>');
  102. ?>
  103.  
  104. </body>
  105.  
  106. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement