mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
* some changes
* moved some admin html code from php to twig templates (.html files) * minimum PHP version required by installer is now 5.1.2, cause of spl_autoload_register functon. * depracated Twig to version 1.20.0 cause of Autoloader * removed unused admin stylish template
This commit is contained in:
@@ -10,51 +10,31 @@
|
||||
*/
|
||||
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>
|
||||
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `accounts`;');
|
||||
$query = $query->fetch();
|
||||
$total_accounts = $query['how_much'];
|
||||
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `players`;');
|
||||
$query = $query->fetch();
|
||||
$total_players = $query['how_much'];
|
||||
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `guilds`;');
|
||||
$query = $query->fetch();
|
||||
$total_guilds = $query['how_much'];
|
||||
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `houses`;');
|
||||
$query = $query->fetch();
|
||||
$total_houses = $query['how_much'];
|
||||
|
||||
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
||||
|
||||
echo $twig->render('admin.statistics.html', array(
|
||||
'total_accounts' => $total_accounts,
|
||||
'total_players' => $total_players,
|
||||
'total_guilds' => $total_guilds,
|
||||
'total_houses' => $total_houses,
|
||||
'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'),
|
||||
'points' => $points
|
||||
));
|
||||
?>
|
Reference in New Issue
Block a user