-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathstats.php
41 lines (32 loc) · 1.12 KB
/
stats.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
<?php
require_once 'includes/inc.global.php';
$meta['title'] = 'Statistics';
$meta['head_data'] = '
<script type="text/javascript" src="scripts/stats.js">></script>
';
$hints = array(
'View '.GAME_NAME.' Player statistics.' ,
);
$contents = '';
// grab the wins and losses for the players
$list = GamePlayer::get_list(true);
$table_meta = array(
'sortable' => true ,
'no_data' => '<p>There are no player stats to show</p>' ,
'caption' => 'Player Stats' ,
'init_sort_column' => array(1 => 1) ,
);
$table_format = array(
array('Player', 'username') ,
array('Wins', 'wins') ,
array('Losses', 'losses') ,
array('Win-Loss', '###([[[wins]]] - [[[losses]]])', null, ' class="color"') ,
array('Win %', '###((0 != ([[[wins]]] + [[[losses]]])) ? perc([[[wins]]] / ([[[wins]]] + [[[losses]]]), 1) : 0)') ,
array('Last Online', '###date(Settings::read(\'long_date\'), strtotime(\'[[[last_online]]]\'))', null, ' class="date"') ,
);
$contents .= get_table($table_format, $list, $table_meta);
// TODO: possibly add game stats ???
echo get_header($meta);
echo get_item($contents, $hints, $meta['title']);
call($GLOBALS);
echo get_footer( );