forked from kort/kort-home
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatistics_en.php
236 lines (229 loc) · 11.9 KB
/
statistics_en.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?php
/**
* kort - List of all proposed solutions with their specific information
*/
/** Load the ClassLoader */
require_once('./php/ClassLoader.php');
Kort\ClassLoader::registerAutoLoader();
use Helper\HttpHelper;
$statisticsUrl = 'http://play.kort.ch/server/webservices/statistics/';
$http = new HttpHelper();
$result = $http->get($statisticsUrl);
$statistics = json_decode($result, true);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Kort - Statistics</title>
<meta charset="utf-8">
<link rel="icon" href="./resources/images/kort-favicon.ico" type="image/png" />
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link rel="stylesheet" type="text/css" href="resources/styles/styles.css">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="lib/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="index_en.html">Kort</a>
<ul class="nav">
<li><a href="index_en.html"><i class="nav-icon icon-home"></i> Home</a></li>
<li><a href="screenshots_en.html"><i class="nav-icon icon-picture"></i> Screenshots</a></li>
<li><a href="developers_en.html"><i class="nav-icon icon-user"></i> Developers</a></li>
<li class="active"><a href="statistics_en.php"><i class="nav-icon icon-tasks icon-white"></i> Statistics</a></li>
<li><a href="proposals_en.php"><i class="nav-icon icon-ok-sign"></i> Solutions</a></li>
<li><a href="statistics.php"><i class="nav-icon icon-home icon-white"></i> Deutsch</a></li>
</ul>
<p><a href="http://play.kort.ch" target="_blank" class="btn btn-success" type="button">Play now! <i class="icon-play-circle icon-white"></i></a></p>
</div>
</div>
</div>
<header class="jumbotron subhead">
<div class="container">
<h1>Statistics</h1>
<p>Facts about Kort</p>
</div>
</header>
<div class="content statistics">
<div class="container">
<div class="row">
<div class="span12">
<?php
if (!empty($statistics)) {
$values = $statistics['return'][0];
?>
<h3>Users</h3>
<div class="row">
<div class="span3">
<img class="statistics-image" src="resources/images/statistics/user.png" />
</div>
<div class="span5">
<?php
echo "<table class='table table-striped stats'>\n";
echo "<tr>\n";
echo "<th>OpenStreetMap</th>\n";
echo "<td>" . $values['osm_user_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>Google</th>\n";
echo "<td>" . $values['google_user_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>Facebook</th>\n";
echo "<td>" . $values['fb_user_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th class='important'>Total</th>\n";
echo "<td>" . $values['user_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>There from active</th>\n";
echo "<td>" . $values['active_user_count'] . "</td>\n";
echo "</tr>\n";
echo "</table>\n";
?>
</div>
</div>
<h3>Tasks</h3>
<div class="row">
<div class="span3">
<img class="statistics-image" src="resources/images/statistics/fixes.png" />
</div>
<div class="span5">
<?php
echo "<table class='table table-striped stats'>\n";
echo "<tr>\n";
echo "<th class='important'>Solved Tasks</th>\n";
echo "<td>" . $values['fix_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>There from unsolvable</th>\n";
echo "<td>" . $values['falsepositive_fix_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>There from fully examined</th>\n";
echo "<td>" . $values['validated_fix_count'] . "</td>\n";
echo "</tr>\n";
echo "</table>\n";
?>
</div>
</div>
<h3>Examinations</h3>
<div class="row">
<div class="span3">
<img class="statistics-image" src="resources/images/statistics/votes.png" />
</div>
<div class="span5">
<?php
echo "<table class='table table-striped stats'>\n";
echo "<tr>\n";
echo "<th>Yet to be examined proposals for solutions</th>\n";
echo "<td>" . $values['incomplete_fix_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th class='important'>Made examinations</th>\n";
echo "<td>" . $values['vote_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>There from marked as correct</th>\n";
echo "<td>" . $values['valid_vote_count'] . "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>There from marked as uncorrect</th>\n";
echo "<td>" . $values['invalid_vote_count'] . "</td>\n";
echo "</tr>\n";
echo "</table>\n";
?>
</div>
</div>
<h3>Won awards</h3>
<div class="row">
<div class="span12">
<?php
$badgesUrl = 'http://play.kort.ch/resources/images/badges/';
echo "<div class='kort-badge'>\n";
echo "<img src='" . $badgesUrl . "fix_count_10.png' />\n";
echo "<p>10 Tasks: <span class='value'>" . $values['ten_missions_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge'>\n";
echo "<img src='" . $badgesUrl . "fix_count_50.png' />\n";
echo "<p>50 Tasks: <span class='value'>" . $values['fifty_missions_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge'>\n";
echo "<img src='" . $badgesUrl . "fix_count_100.png' />\n";
echo "<p>100 Tasks: <span class='value'>" . $values['hundred_missions_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge clear'>\n";
echo "<img src='" . $badgesUrl . "vote_count_10.png' />\n";
echo "<p>10 Examinations: <span class='value'>" . $values['ten_checks_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge'>\n";
echo "<img src='" . $badgesUrl . "vote_count_100.png' />\n";
echo "<p>100 Examinations: <span class='value'>" . $values['hundred_checks_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge'>\n";
echo "<img src='" . $badgesUrl . "vote_count_1000.png' />\n";
echo "<p>1000 Examinations: <span class='value'>" . $values['thousand_checks_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge clear'>\n";
echo "<img src='" . $badgesUrl . "highscore_place_3.png' />\n";
echo "<p>3. Place: <span class='value'>" . $values['third_place_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge'>\n";
echo "<img src='" . $badgesUrl . "highscore_place_2.png' />\n";
echo "<p>2. Place: <span class='value'>" . $values['second_place_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge'>\n";
echo "<img src='" . $badgesUrl . "highscore_place_1.png' />\n";
echo "<p>1. Place: <span class='value'>" . $values['first_place_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge clear'>\n";
echo "<img src='" . $badgesUrl . "fix_count_1.png' />\n";
echo "<p>1. Task: <span class='value'>" . $values['first_mission_badge_count'] . "</span></p>\n";
echo "</div>\n";
echo "<div class='kort-badge'>\n";
echo "<img src='" . $badgesUrl . "vote_count_1.png' />\n";
echo "<p>1. Examination: <span class='value'>" . $values['first_check_badge_count'] . "</span></p>\n";
echo "</div>\n";
?>
</div>
</div>
<?php
} else {
echo "<div class=\"alert alert-error\">Error loading statistics.</div>\n";
}
?>
</div>
</div>
</div>
</div>
<footer>
<div class="container">
<p class="pull-left">© 2013 Stefan Oderbolz, Jürg Hunziker</p>
<p class="pull-right"><a href="http://www.hsr.ch/informatik" target="_blank"><img class="image-hsr-logo" src="resources/images/hsr_logo.png" /></a></p>
<p class="pull-right"><a href="http://www.hsr.ch/informatik" target="_blank">Study computer science at the HSR</a></p>
</div>
</footer>
<a href="https://github.com/kort/kort" target="_blank"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 1500;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub"></a>
<!-- UserVoice widget -->
<script type="text/javascript">
var uvOptions = {};
(function() {
var uv = document.createElement('script'); uv.type = 'text/javascript'; uv.async = true;
uv.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'widget.uservoice.com/ciFv45SRa04ZQzkujVJKw.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(uv, s);
})();
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-37644286-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>