$value) { $notinuuid .= "'".$uuid."',"; } $notinuuid = substr($notinuuid, 0, -1); } else { $notinuuid = "'0'"; } $notingroup = ''; $andnotgroup = ''; if($cfg['rankup_excepted_group_id_list'] != NULL) { foreach($cfg['rankup_excepted_group_id_list'] as $group => $value) { $notingroup .= "'".$group."',"; $andnotgroup .= " AND `u`.`cldgroup` NOT LIKE ('".$group.",%') AND `u`.`cldgroup` NOT LIKE ('%,".$group.",%') AND `u`.`cldgroup` NOT LIKE ('%,".$group."')"; } $notingroup = substr($notingroup, 0, -1); } else { $notingroup = '0'; } if ($cfg['rankup_time_assess_mode'] == 1) { $order = "(`s`.`count_month` - `s`.`idle_month`)"; $texttime = $lang['sttw0013']; } else { $order = "`s`.`count_month`"; $texttime = $lang['sttw0003']; } $timeago = time() - 2592000; $db_arr = $mysqlcon->query("SELECT `s`.`uuid`,`s`.`count_month`,`s`.`idle_month`,`u`.`name`,`u`.`online`,`u`.`cldgroup` FROM `$dbname`.`stats_user` `s`, `$dbname`.`user` `u` WHERE `u`.`uuid` = `s`.`uuid` AND `s`.`removed`!=1 AND `u`.`lastseen`>{$timeago} AND `u`.`uuid` NOT IN ({$notinuuid}) AND `u`.`cldgroup` NOT IN ({$notingroup}) {$andnotgroup} AND `s`.`idle_month`<`s`.`count_month` AND `s`.`count_month`>=0 AND `s`.`idle_month`>=0 ORDER BY $order DESC LIMIT 10")->fetchAll(PDO::FETCH_UNIQUE|PDO::FETCH_ASSOC); $count_ids = $mysqlcon->query("SELECT COUNT(DISTINCT(`id`)) AS `count` from `$dbname`.`user_snapshot`")->fetch(); $count10 = 0; $top10_sum = 0; $top10_idle_sum = 0; foreach ($db_arr as $uuid => $client) { if ($cfg['rankup_time_assess_mode'] == 1) { $hours = $client['count_month'] - $client['idle_month']; } else { $hours = $client['count_month']; } $top10_sum += $client['count_month']; $top10_idle_sum += $client['idle_month']; $client_data[$count10] = array( 'name' => htmlspecialchars($client['name']), 'title' => htmlspecialchars($client['name']), 'count' => $hours, 'online' => $client['online'] ); $count10++; } for($count10 = $count10; $count10 <= 10; $count10++) { $client_data[$count10] = array( 'name' => "".$lang['unknown']."", 'title' => $lang['unknown'], 'count' => 0, 'online' => 0 ); } $sum = $mysqlcon->query("SELECT SUM(`s`.`count_month`) AS `count`, SUM(`s`.`idle_month`) AS `idle`, COUNT(*) AS `user` FROM `$dbname`.`stats_user` `s`, `$dbname`.`user` `u` WHERE `u`.`uuid` = `s`.`uuid` AND `s`.`removed`!=1 AND `u`.`lastseen`>{$timeago} AND `u`.`uuid` NOT IN ({$notinuuid}) AND `u`.`cldgroup` NOT IN ({$notingroup}) {$andnotgroup} AND `s`.`idle_month`<`s`.`count_month` AND `s`.`count_month`>=0 AND `s`.`idle_month`>=0;")->fetch(); $top10_sum = round(($top10_sum/3600)); $top10_idle_sum = round(($top10_idle_sum/3600)); $others_sum = round(($sum['count']/3600)) - $top10_sum; $others_idle_sum = round(($sum['idle']/3600)) - $top10_idle_sum; $sumentries = $sum['user'] - 10; ?>

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