myaac/system/pages/admin/statistics.php
slawkens1 a177c93e97 Some big update
* added option to change character name in accountmanagement
* added automatic database updater (data migrations)
* renamed events to hooks
* moved hooks to database
* now you can use hooks in plugins
* set account.type field to 5, if TFS 1.0+
* added example plugin
* new, latest google analytics code
* fixed bug with loading account.name that has numbers in it
* fixed many bugs in player editor in admin panel
* added error handling to plugin manager and some more verification in
file has been correctly unpacked/uploaded
* fixed Statistics page in admin panel when using account.number
* fixed bug when creating/recovering account on servers with
account.salt field (TFS 0.3 for example)
* fixed forum showing thread with html tags (added from news manager)
* new, actual code for youtube videos in movies
* fixed showing vocation images when using
$config['online_vocations_images']
* many fixes in polls (also importing proper schema)
* fixed hovering on buttons in kathrine template (on accountmanagement
page)
* many fixes in signatures
* added missing gesior signature system
2017-05-11 04:13:16 +02:00

60 lines
1.7 KiB
PHP

<?php
/**
* Statistics
*
* @package MyAAC
* @author Slawkens <slawkens@gmail.com>
* @copyright 2017 MyAAC
* @version 0.0.6
* @link http://my-aac.org
*/
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Statistics';
?>
<table>
<tr>
<td>
<table class="table">
<tr><th colspan="2">Statistics</th></tr>
<tr><td>Total accounts:</td>
<?php
$query = $db->query('SELECT count(*) as `how_much` FROM `accounts`;');
$query = $query->fetch();
echo '<td>' . $query['how_much'] . '</td></tr>';
?>
<tr><td>Total players:</td>
<?php
$query = $db->query('SELECT count(*) as `how_much` FROM `players`;');
$query = $query->fetch();
echo '<td>' . $query['how_much'] . '</td></tr>';
?>
<tr><td>Total guilds:</td>
<?php
$query = $db->query('SELECT count(*) as `how_much` FROM `guilds`;');
$query = $query->fetch();
echo '<td>' . $query['how_much'] . '</td></tr>';
?>
<tr><td>Total houses:</td>
<?php
$query = $db->query('SELECT count(*) as `how_much` FROM `houses`;');
$query = $query->fetch();
echo '<td>' . $query['how_much'] . '</td></tr>';
?>
</table>
</td>
<td>
<table class="table">
<tr><th colspan="3">TOP 10 - Most wealth accounts</th></tr>
<tr><th>#</th><th>Account <?php echo (USE_ACCOUNT_NAME ? 'name' : 'number'); ?></th><th>Premium points</th></tr>
<?php
$query = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
$i = 0;
foreach($query as $result)
{
echo '<tr><td>' . ++$i . '.</td><td>' . $result['name'] . '</td><td>' . $result['premium_points'] . '</td></tr>';
}
?>
</table>
</td>
</tr>
</table>