-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
70 lines (64 loc) · 1.89 KB
/
index.php
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html >
<head>
<title>MapaList Rotation</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="assets/bootstrap.min.css" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>
<body>
<div class="container">
<?php
require_once('lib/MapNameReplacer.php');
require_once('lib/ModeReplacer.php');
require_once('lib/NameSanitizer.php');
$ini_array = parse_ini_file("locations.ini");
$version = 4;
$n = 0;
foreach($ini_array as $name => $filename) {
echo " <div class=\"card\">
<div class=\"card-header\" role=\"tab\" id=\"heading".NameSanitizer($name)."\">
<h5 class=\"mb-0\">
<a class=\"collapsed\" data-toggle=\"collapse\" href=\"#collapse".NameSanitizer($name)."\" aria-expanded=\"false\" aria-controls=\"collapse".NameSanitizer($name)."\">
".$name."
</a>
</h5>
</div>
<div id=\"collapse".NameSanitizer($name)."\" class=\"collapse\" role=\"tabpanel\" aria-labelledby=\"heading".NameSanitizer($name)."\">
<div class=\"card-block\">
<table class=\"table table-striped\">
<tr>
<td>#</td>
<td>Map</td>
<td>Mode</td>
<td>Matchs</td>
</tr>";
$file = new SplFileObject($filename);
$file->setFlags(SplFileObject::READ_CSV | SplFileObject::READ_AHEAD | SplFileObject::SKIP_EMPTY | SplFileObject::DROP_NEW_LINE);
$file->setCsvControl(' ');
foreach ($file as $row) {
list($mapa, $modo, $vuelta) = $row;
printf("
<tr>
<td>".++$n."</td>
<td>%s</td>
<td>%s</td>
<td>%d</td>
</tr>",
MapNameReplacer($mapa,$version),
ModeReplacer($modo),
$vuelta
);
}
echo "
</table>
</div>
</div>
</div>";
}
?>
</div>
<script type="text/javascript" src="assets/jquery.min.js"></script>
<script type="text/javascript" src="assets/bootstrap.min.js"></script>
</body>
</html>