'; $adminlogin = 0; require_once('other/config.php'); if ($mysqlprob === false) { echo '',$sqlconerr,'
'; exit; } if (isset($_GET['lang'])) { $language = $_GET['lang']; } require_once('lang.php'); $keysort = ''; $keyorder = ''; if (isset($_GET['sort'])) { $keysort = $_GET['sort']; } if ($keysort != 'name' && $keysort != 'uuid' && $keysort != 'cldbid' && $keysort != 'lastseen' && $keysort != 'count' && $keysort != 'idle' && $keysort != 'active') { $keysort = 'nextup'; } if (isset($_GET['order'])) { $keyorder = $_GET['order']; } if ($keyorder == 'desc') { $keyorder = 'DESC'; } else { $keyorder = 'ASC'; } if (isset($_GET['admin'])) { if($_GET['admin'] == "true" && isset($_SESSION['username'])) { $adminlogin = 1; } } $countentries = 0; if ($keysort == 'active' && $keyorder == 'ASC') { $dbdata = $mysqlcon->query("SELECT * FROM $dbname.user ORDER BY (count - idle)"); } elseif ($keysort == 'active' && $keyorder == 'DESC') { $dbdata = $mysqlcon->query("SELECT * FROM $dbname.user ORDER BY (idle - count)"); } else { $dbdata = $mysqlcon->query("SELECT * FROM $dbname.user ORDER BY $keysort $keyorder"); } $sumentries = $dbdata->rowCount(); $uuids = $dbdata->fetchAll(); foreach($uuids as $uuid) { $sqlhis[$uuid['uuid']] = array( "cldbid" => $uuid['cldbid'], "count" => $uuid['count'], "name" => $uuid['name'], "idle" => $uuid['idle'], "cldgroup" => $uuid['cldgroup'], "online" => $uuid['online'], "nextup" => $uuid['nextup'], "lastseen" => $uuid['lastseen'], "ip" => $uuid['ip'] ); $uidarr[] = $uuid['uuid']; $countentries = $countentries + 1; } if(!$dbdata = $mysqlcon->query("SELECT * FROM $dbname.lastscan")) { echo '',$mysqlcon->errorCode(),'
'; exit; } $lastscan = $dbdata->fetchAll(); $scantime = $lastscan[0]['timestamp']; $livetime = time() - $scantime; $dbgroups = $mysqlcon->query("SELECT * FROM $dbname.groups"); $servergroups = $dbgroups->fetchAll(PDO::FETCH_ASSOC); foreach($servergroups as $servergroup) { $sqlhisgroup[$servergroup['sgid']] = $servergroup['sgidname']; } if($adminlogin == 1) { switch ($keyorder) { case "ASC": $keyorder2 = "desc&admin=true"; break; case "DESC": $keyorder2 = "asc&admin=true"; } } else { switch ($keyorder) { case "ASC": $keyorder2 = "desc"; break; case "DESC": $keyorder2 = "asc"; } } echo ''; if ($showcolrg == 1 || $adminlogin == 1) echo ''; if ($showcolcld == 1 || $adminlogin == 1) echo ($keysort == 'name') ? '' : ''; if ($showcoluuid == 1 || $adminlogin == 1) echo ''; if ($showcoldbid == 1 || $adminlogin == 1) echo ''; if ($adminlogin == 1) echo ''; if ($showcolls == 1 || $adminlogin == 1) echo ''; if ($showcolot == 1 || $adminlogin == 1) echo ''; if ($showcolit == 1 || $adminlogin == 1) echo ''; if ($showcolat == 1 || $adminlogin == 1) echo ''; if ($showcolnx == 1 || $adminlogin == 1) echo ($keysort == 'nextup') ? '' : ''; if ($showcolsg == 1 || $adminlogin == 1) echo ''; echo ''; ksort($grouptime); $countgrp = count($grouptime); if ($countentries > 0) { $countrank=0; $except=0; $highest=0; foreach ($uidarr as $uid) { $cldgroup = $sqlhis[$uid]['cldgroup']; $lastseen = $sqlhis[$uid]['lastseen']; $count = $sqlhis[$uid]['count']; $idle = $sqlhis[$uid]['idle']; $status = $sqlhis[$uid]['online']; $nextup = $sqlhis[$uid]['nextup']; $sgroups = explode(",", $cldgroup); $active = $count - $idle; if ($substridle == 1) { $activetime = $count - $idle; } else { $activetime = $count; } $grpcount=0; $highest++; foreach ($grouptime as $time => $groupid) { $grpcount++; if (array_intersect($sgroups, $exceptgroup) && $showexgrp != 1 && $adminlogin != 1) { $except++; break; } if (in_array($uid, $exceptuuid) && $showexcld != 1 && $adminlogin != 1) { $except++; break; } if ($activetime < $time || ($grpcount == $countgrp && $adminlogin == 1 && $nextup == 0)) { if($nextup == 0 && $grpcount == $countgrp) { $neededtime = 0; } elseif ($status == 1) { $neededtime = $time - $activetime - $livetime; } else { $neededtime = $time - $activetime; } echo ''; if ($showcolrg == 1 || $adminlogin == 1) { $countrank++; echo ''; } if ($adminlogin == 1) { echo ''; } elseif ($showcolcld == 1) { echo ''; } if ($adminlogin == 1) { echo ''; } elseif ($showcoluuid == 1) { echo ''; } if ($showcoldbid == 1 || $adminlogin == 1) echo ''; if ($adminlogin == 1) echo ''; if ($showcolls == 1 || $adminlogin == 1) { echo ''; } if ($showcolot == 1 || $adminlogin == 1) { echo ''; } elseif (!in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) { $timecount = 0; echo $timecount , ''; } elseif (in_array($uid, $exceptuuid)) { echo $lang['listexuid'] , ''; } elseif (array_intersect($sgroups, $exceptgroup)) { echo $lang['listexgrp'] , ''; } else { echo $lang['errukwn']; } } if ($grpcount == $countgrp && $neededtime == 0) { echo ''; } elseif ($showcolsg == 1 || $adminlogin == 1) { echo ''; } echo ''; break; } } } } else { echo ''; } echo '
' , $lang['listrank'] , '' . $lang['listnick'] . '' . $lang['listnick'] . '' , $lang['listuid'] , '' , $lang['listcldbid'] , '' , $lang['listip'] , '' , $lang['listseen'] , '' , $lang['listsumo'] , '' , $lang['listsumi'] , '' , $lang['listsuma'] , '' . $lang['listnxup'] . '' . $lang['listnxup'] . '' , $lang['listnxsg'] , '
' , $countrank , '' , $sqlhis[$uid]['name'] , '' , $sqlhis[$uid]['name'] , '' , $uid , '' , $uid , '' , $sqlhis[$uid]['cldbid'] , '' , long2ip($sqlhis[$uid]['ip']) , '' , date('Y-m-d H:i:s',$lastseen); echo ''; $dtF = new DateTime("@0"); $dtT = new DateTime("@$count"); $timecount = $dtF->diff($dtT)->format($timeformat); echo $timecount; } if ($showcolit == 1 || $adminlogin == 1) { echo ''; $dtF = new DateTime("@0"); $dtT = new DateTime("@$idle"); $timecount = $dtF->diff($dtT)->format($timeformat); echo $timecount; } if ($showcolat == 1 || $adminlogin == 1) { echo ''; $dtF = new DateTime("@0"); $dtT = new DateTime("@$active"); $timecount = $dtF->diff($dtT)->format($timeformat); echo $timecount; } if ($showcolnx == 1 || $adminlogin == 1) { echo ''; $dtF = new DateTime("@0"); $dtT = new DateTime("@$neededtime"); $timecount = $dtF->diff($dtT)->format($timeformat); if (!in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup) && $neededtime > 0) { echo $timecount , 'highest rank reached' , $sqlhisgroup[$groupid] , '
' , $lang['noentry'] , '
'; if ($showgen == 1 || $adminlogin == 1) { $reached = $highest - $countrank; $buildtime = microtime(true) - $starttime; echo '' , sprintf($lang['sitegen'], $buildtime, $sumentries) , ' (',$countrank,' showing; ',$except,' exceptions; ',$reached,' highest rank)'; } ?>