Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <h1 style="font-family: trebuchet ms">Online Members</h1>
- <?php
- $gang = $_GET['group'];
- $squad = $_GET['squad'];
- if (!isset($gang) || isset($squad)) {
- $content = file_get_contents('http://jarno.pro/stuff/api/ab.php?squad='. $squad .'');
- } else {
- $content = file_get_contents('http://jarno.pro/stuff/api/ab.php?gang='. $gang .'');
- }
- $hexToHex = array('#1e01ff' => '#00a2ff', '#ff01b4' => '#04ff00');
- $result = json_decode($content);
- //print_r( $result);
- echo('<table width=70%>');
- echo('<tr>');
- echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
- echo('Name');
- echo('</td>');
- echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
- echo('Occupation');
- echo('</td>');
- echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
- echo('Cash');
- echo('</td>');
- echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
- echo('Playtime');
- echo('</td>');
- echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
- echo('Group');
- echo('</td>');
- echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
- echo('Squad');
- echo('</td>');
- echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
- echo('Ping');
- echo('</td>');
- echo('<td style="font-family:trebuchet ms; text-decoration:bold;">');
- echo('Country');
- echo('</td>');
- echo('</tr>');
- foreach ($result as $item) {
- for ($k = 0; $k <= sizeof($item); $k++) {
- $name = $item[$k]->name ;
- $occ = $item[$k]->occupation ;
- $team = $item[$k]->team;
- $colorR = $item[$k]->color[0];
- $colorG = $item[$k]->color[1];
- $colorB = $item[$k]->color[2];
- $color = sprintf("#%02x%02x%02x", $colorR, $colorG, $colorB);
- echo('<tr>');
- echo('<td style="color: '. $hexToHex[$color] .'; font-family:trebuchet MS;">');
- echo($name);
- echo('</td>');
- echo('<td style="font-family:trebuchet MS;">');
- echo($occ);
- echo('</td>');
- echo('<td style="font-family:trebuchet MS;">');
- if ($item[$k]->cash > 0) {
- echo('$ '. number_format($item[$k]->cash) .'');
- }
- echo('</td>');
- echo('<td style="font-family:trebuchet MS;">');
- if ($item[$k]->playtime / 60 > 0) {
- echo(''. $item[$k]->playtime / 60 .' H');
- }
- echo('</td>');
- echo('<td style="font-family:trebuchet MS;">');
- echo($item[$k]->gang);
- echo('</td>');
- echo('<td style="font-family:trebuchet MS;">');
- echo($item[$k]->squad);
- echo('</td>');
- echo('<td style="font-family:trebuchet MS;">');
- echo($item[$k]->ping);
- echo('</td>');
- echo('<td style="font-family:trebuchet MS;">');
- echo($item[$k]->country);
- echo('</td>');
- echo('</tr>');
- }
- }
- echo('</table>');
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement