-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_counters.php
More file actions
48 lines (48 loc) · 1.22 KB
/
get_counters.php
File metadata and controls
48 lines (48 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
include "LFSWorldSDK.php";
$SDK = new LFSWorldSDK("35cP2S05Cvj3z7564aXKyw0Mqf1Hhx7P", true);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo empty($_GET["type"])
? "Please Input Car or Tracks Short Name"
: "Page for " . urlencode($_GET["type"]); ?></title>
</head>
<body>
<?php if (empty($_GET["type"])): ?>
<form target="_SELF" method="GET">
<label for="type">Car or Track:</label><input type="textbox" id="type" name="type" /><br />
<input type="submit" value="Get Info" />
</form>
<?php else:
$data = $SDK->get_counters($_GET["type"]);
$keys = array_keys($data[0]);
?>
<table>
<thead>
<tr>
<th>KEY</th>
<?php foreach ($keys as $key): ?>
<th><?php echo $key; ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($data as $key => $val): ?>
<tr>
<th><?php echo $key; ?></th>
<?php foreach ($keys as $k):
switch ($k): case "track": ?>
<td><?php echo LFSWorldSDK::convert_track_name($val[$k], true); ?></td>
<?php break;default: ?>
<td><?php echo $val[$k]; ?></td>
<?php endswitch;
endforeach; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</body>
</html>