query("SELECT s.uuid,s.count_week,s.idle_week,u.name,u.online,u.grpid FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY (s.count_week - s.idle_week) DESC"); } else { $dbdata = $mysqlcon->query("SELECT s.uuid,s.count_week,s.idle_week,u.name,u.online,u.grpid FROM $dbname.stats_user AS s INNER JOIN $dbname.user AS u ON s.uuid = u.uuid WHERE s.removed='0' ORDER BY s.count_week DESC"); } $sumentries = $dbdata->rowCount() - 10; $db_arr = $dbdata->fetchAll(); $count10 = 0; $top10_sum = 0; $top10_idle_sum = 0; foreach ($db_arr as $client) { $sgroups = explode(",", $client['grpid']); if (!in_array($client['uuid'], $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) { if ($count10 == 10) break; if ($substridle == 1) { $hours = $client['count_week'] - $client['idle_week']; } else { $hours = $client['count_week']; } $top10_sum = round(($client['count_week']/3600)) + $top10_sum; $top10_idle_sum = round(($client['idle_week']/3600)) + $top10_idle_sum; $client_data[$count10] = array( 'name' => $client['name'], 'count' => $hours, 'online' => $client['online'] ); $count10++; } } for($count10 = $count10; $count10 <= 10; $count10++) { $client_data[$count10] = array( 'name' => "unkown", 'count' => "0", 'online' => "0" ); } $all_sum_data = $mysqlcon->query("SELECT SUM(count_week) FROM $dbname.stats_user"); $all_sum_data_res = $all_sum_data->fetchAll(); $others_sum = round(($all_sum_data_res[0][0]/3600)) - $top10_sum; $all_idle_sum_data = $mysqlcon->query("SELECT SUM(idle_week) FROM $dbname.stats_user"); $all_idle_sum_data_res = $all_idle_sum_data->fetchAll(); $others_idle_sum = round(($all_idle_sum_data_res[0][0]/3600)) - $top10_idle_sum; function get_percentage($max_value, $value) { return (round(($value/$max_value)*100)); } require_once('nav.php'); ?>

#1st

>

#2nd

>

#3rd

>
#4th
>
#5th
>
#6th
>

#7th
>

#8th
>

#9th
>

#10th
>

#1 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#2 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#3 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#4 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#5 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#6 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#7 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#8 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#9 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>

#10 '.$lang['stix0024'].')' : ' (Status: '.$lang['stix0025'].')' ?>