-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrating.php
193 lines (143 loc) · 6.11 KB
/
rating.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<?php
// header("Location: error.php");
// exit;
require_once("core/config.php");
session_start();
require_once("core/db.php");
require_once("core/functions.php");
test();
exit;
if (isset($_GET['gameid'])) {
$path = RATING_GAMES_PATH . "/" . $_GET['gameid'] . "/" . GAMESTATES_DAT_FILE_NAME;
file_force_download($path);
unset($_GET['gameid']);
header("Location: /");
}
//$games_info = GetALLSandboxGames();
$games_info = GetALLRaingGames();
$sources = GetALLUsersSourceInfoOnlyCompiledANDUsed();
?>
<!doctype html>
<html>
<?php
require_once("core/head.php");
?>
<body>
<?php
require_once("core/header.php");
?>
<div id="content-wrapper" class=" mui-container-fluid">
<div class="mui-container-fluid mui-panel">
<div class="mui-container-fluid ">
<a href="<?= $_SERVER['REQUEST_URI'] ?>" class="right">
<button type="button" class="mui-btn mui-btn--raised">Обновить
</button>
</a>
<div class="mui--text-display1">Рейтинговые игры</div>
<div class="mui-container-fluid">
<table class="mui-table mui-table--bordered table_center users_info_table">
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th><i class="fa fa-clock-o"></i> Дата начала</th>
<th><i class="fa fa-cogs"></i> Статус</th>
<th><i class="fa fa-users"></i> Участники</th>
<th><i class="fa fa-trophy"></i> Результат</th>
<th><i class="fa fa-exclamation-circle"></i> Ошибки</th>
<th><i class="fa fa-eye"></i> Визуализация</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
if (isset($games_info)) {
foreach ($games_info as $game) {
$game['result'] = json_decode($game['result'], true);
?>
<tr>
<td>
<?= $i ?>
</td>
<td class="user_id">
<?= $game['id'] ?>
</td>
<td>
<?= date("d/m/Y H:i:s", $game['datetime']) ?>
</td>
<td class="bold">
<span
<?php
if ($game['status'] == 'ok') {
echo " class='text_green'>";
echo "Проверено";
} elseif ($game['status'] == 'error') {
echo " class='text_red'>";
echo "Ошибка во время проверки";
} elseif ($game['status'] == 'work') {
echo " class='text_blue'>";
echo "Выполняется";
} else {
echo ">";
echo "В очереди";
}
?>
</span>
</td>
<td>
<?php
foreach ($game['users'] as $game_user) { ?>
<?= $game_user['name'] ?>
<br>
<?php
} ?>
</td>
<td>
<?php
if ($game['result'] != "") {
foreach ($game['result'] as $result) {
echo $result['Name'] . " - " . $result['Points'] . "<br>";
}
}
?>
</td>
<td>
<?php
if ($game['errors'] != "") {
?>
<a class="pointer open_hide_info">Ошибки</a>
<div class="hidden_content">
<?= $game['errors'] ?>
</div>
<?php
} ?>
</td>
<td>
<?php if ($game['status'] == 'ok') { ?>
<a href="?gameid=<?= $game['id'] ?>" dataid="<?= $game['id'] ?>"
class="download_visualize_info_btn">
<button type="button" class="mui-btn mui-btn--small mui-btn--primary">
Скачать
</button>
</a>
<?php } ?>
</td>
</tr>
<?php
$i++;
}
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php
require_once("core/footer.php");
?>
<script>
new WOW().init();
</script>
</body>
</html>