-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_pb.php
More file actions
53 lines (53 loc) · 1.38 KB
/
get_pb.php
File metadata and controls
53 lines (53 loc) · 1.38 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
49
50
51
52
53
<?php
include "LFSWorldSDK.php";
$SDK = new LFSWorldSDK("35cP2S05Cvj3z7564aXKyw0Mqf1Hhx7P", true);
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo empty($_GET["racer"])
? 'Please Input a Racer\'s Name'
: "Page for " . urlencode($_GET["racer"]); ?></title>
</head>
<body>
<?php if (empty($_GET["racer"])): ?>
<form target="_SELF" method="GET">
<label for="racer">LFS Username:</label><input type="textbox" id="racer" name="racer" /><br />
<input type="submit" value="Get Info" />
</form>
<?php else:
$pb = $SDK->get_pb($_GET["racer"]);
$keys = array_keys($pb[0]);
?>
<table>
<thead>
<tr>
<th>ID</th>
<?php foreach ($keys as $key): ?>
<th><?php echo $key; ?></th>
<?php endforeach; ?>
</tr>
</thead>
<tbody>
<?php foreach ($pb 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;case "split1":
case "split2":
case "split3":
case "laptime": ?>
<td><?php echo LFSWorldSDK::convert_lfsw_time($val[$k]); ?></td>
<?php break;default: ?>
<td><?php echo $val[$k]; ?></td>
<?php endswitch;
endforeach; ?>
</tr>
<?php endforeach;endif; ?>
</tbody>
</table>
</body>
</html>