query("SELECT `s`.`uuid`,`s`.`count_week`,`s`.`idle_week`,`u`.`name`,`u`.`online`,`u`.`cldgroup` 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")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC); $texttime = $lang['sttw0013']; } else { $db_arr = $mysqlcon->query("SELECT `s`.`uuid`,`s`.`count_week`,`s`.`idle_week`,`u`.`name`,`u`.`online`,`u`.`cldgroup` 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")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC); $texttime = $lang['sttw0003']; } $count_timestamps = $mysqlcon->query("SELECT COUNT(DISTINCT(`timestamp`)) AS `count` from `$dbname`.`user_snapshot`")->fetch(); $sumentries = count($db_arr) - 10; $count10 = 0; $top10_sum = 0; $top10_idle_sum = 0; foreach ($db_arr as $uuid => $client) { $sgroups = array_flip(explode(",", $client['cldgroup'])); if (!isset($exceptuuid[$uuid]) && !array_intersect_key($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($count = $count10; $count10 < 10; $count10++) { $client_data[$count] = array( 'name' => "unkown", 'count' => "0", 'online' => "0" ); } $sum = $mysqlcon->query("SELECT SUM(`count_week`) AS `count`, SUM(`idle_week`) AS `idle` FROM `$dbname`.`stats_user`")->fetch(); $others_sum = round(($sum['count']/3600)) - $top10_sum; $others_idle_sum = round(($sum['idle']/3600)) - $top10_idle_sum; function get_percentage($max_value, $value) { return (round(($value/$max_value)*100)); } require_once('nav.php'); ?>

#1st

 
',$client_data[0]['name']; ?>

#2nd

 
',$client_data[1]['name']; ?>

#3rd

 
',$client_data[2]['name']; ?>
#4th
',$client_data[3]['name']; ?>
#5th
',$client_data[4]['name']; ?>
#6th
',$client_data[5]['name']; ?>

#7th
',$client_data[6]['name']; ?>

#8th
',$client_data[7]['name']; ?>

#9th
',$client_data[8]['name']; ?>

#10th
',$client_data[9]['name']; ?>

#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'].')' ?>