query("SELECT uuid,name,count,idle,grpid,online FROM $dbname.user ORDER BY (count - idle) DESC"); } else { $dbdata = $mysqlcon->query("SELECT uuid,name,count,idle,grpid,online FROM $dbname.user ORDER BY count 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'] - $client['idle']; } else { $hours = $client['count']; } $top10_sum = round(($client['count']/3600)) + $top10_sum; $top10_idle_sum = round(($client['idle']/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) FROM $dbname.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) FROM $dbname.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'].')' ?>