'; } elseif($seenvalue[1] == '!=') { $operator = '!='; } else { $operator = '='; } $filter .= " AND lastseen".$operator."'".$lastseen."'"; } if(isset($getstring)) { $dbdata_full = $mysqlcon->prepare("SELECT COUNT(*) FROM $dbname.user WHERE (uuid LIKE :searchvalue OR cldbid LIKE :searchvalue OR name LIKE :searchvalue)$filter"); $dbdata_full->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); $dbdata_full->execute(); } else { $getstring = ''; $dbdata_full = $mysqlcon->query("SELECT COUNT(*) FROM $dbname.user"); } if(!isset($_GET["seite"])) { $seite = 1; } else { $seite = preg_replace('/\D/', '', $_GET["seite"]); } $adminlogin = 0; $keysort = ''; $keyorder = ''; if (isset($_GET['sort'])) { $keysort = strip_tags(htmlspecialchars($_GET['sort'])); } if ($keysort != 'name' && $keysort != 'uuid' && $keysort != 'cldbid' && $keysort != 'rank' && $keysort != 'lastseen' && $keysort != 'count' && $keysort != 'idle' && $keysort != 'active') { $keysort = 'nextup'; } if (isset($_GET['order'])) { $keyorder = strip_tags(htmlspecialchars($_GET['order'])); } $keyorder = ($keyorder == 'desc' ? 'desc' : 'asc'); if (isset($_GET['admin'])) { if($_SESSION['username'] == $webuser && $_SESSION['password'] == $webpass && $_SESSION['clientip'] == getclientip()) { $adminlogin = 1; } } require_once('nav.php'); $countentries = 0; $sumentries = $dbdata_full->fetch(PDO::FETCH_NUM); if(!isset($_GET["user"])) { $user_pro_seite = 50; } elseif($_GET['user'] == "all") { $user_pro_seite = $sumentries[0]; } else { $user_pro_seite = preg_replace('/\D/', '', $_GET["user"]); } $start = $seite * $user_pro_seite - $user_pro_seite; if ($keysort == 'active' && $keyorder == 'asc') { $dbdata = $mysqlcon->prepare("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user WHERE (uuid LIKE :searchvalue OR cldbid LIKE :searchvalue OR name LIKE :searchvalue)$filter ORDER BY (count - idle) LIMIT :start, :userproseite"); $dbdata->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); $dbdata->bindValue(':start', (int) $start, PDO::PARAM_INT); $dbdata->bindValue(':userproseite', (int) $user_pro_seite, PDO::PARAM_INT); $dbdata->execute(); } elseif ($keysort == 'active' && $keyorder == 'desc') { $dbdata = $mysqlcon->prepare("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user WHERE (uuid LIKE :searchvalue OR cldbid LIKE :searchvalue OR name LIKE :searchvalue)$filter ORDER BY (idle - count) LIMIT :start, :userproseite"); $dbdata->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); $dbdata->bindValue(':start', (int) $start, PDO::PARAM_INT); $dbdata->bindValue(':userproseite', (int) $user_pro_seite, PDO::PARAM_INT); $dbdata->execute(); } elseif ($searchstring == '') { $dbdata = $mysqlcon->prepare("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user WHERE 1=1$filter ORDER BY $keysort $keyorder LIMIT :start, :userproseite"); $dbdata->bindValue(':start', (int) $start, PDO::PARAM_INT); $dbdata->bindValue(':userproseite', (int) $user_pro_seite, PDO::PARAM_INT); $dbdata->execute(); } else { $dbdata = $mysqlcon->prepare("SELECT uuid,cldbid,rank,count,name,idle,cldgroup,online,nextup,lastseen,ip,grpid FROM $dbname.user WHERE (uuid LIKE :searchvalue OR cldbid LIKE :searchvalue OR name LIKE :searchvalue)$filter ORDER BY $keysort $keyorder LIMIT :start, :userproseite"); $dbdata->bindValue(':searchvalue', '%'.$searchstring.'%', PDO::PARAM_STR); $dbdata->bindValue(':start', (int) $start, PDO::PARAM_INT); $dbdata->bindValue(':userproseite', (int) $user_pro_seite, PDO::PARAM_INT); $dbdata->execute(); } $seiten_anzahl_gerundet = ceil($sumentries[0] / $user_pro_seite); function pagination($keysort,$keyorder,$user_pro_seite,$seiten_anzahl_gerundet,$seite,$getstring) { ?> fetchAll(); foreach($uuids as $uuid) { $sqlhis[$uuid['uuid']] = array( "cldbid" => $uuid['cldbid'], "rank" => $uuid['rank'], "count" => $uuid['count'], "name" => $uuid['name'], "idle" => $uuid['idle'], "cldgroup" => $uuid['cldgroup'], "online" => $uuid['online'], "nextup" => $uuid['nextup'], "lastseen" => $uuid['lastseen'], "ip" => $uuid['ip'], "grpid" => $uuid['grpid'] ); $uidarr[] = $uuid['uuid']; $countentries = $countentries + 1; } if(!$dbdata = $mysqlcon->query("SELECT * FROM $dbname.job_check WHERE job_name='calc_user_lastscan'")) { $err_msg = ''.$mysqlcon->errorCode().'
'; } $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(file_exists('../icons/'.$servergroup['sgid'].'.png')) { $sqlhisgroup_file[$servergroup['sgid']] = true; } else { $sqlhisgroup_file[$servergroup['sgid']] = false; } } 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"; } } ?>
' , $lang['listrank'] , ''; 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 ($showcolas == 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=($seite-1)*$user_pro_seite; $exceptgrp=0; $exceptcld=0; $highest=0; $countallsum=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; $countallsum++; foreach ($grouptime as $time => $groupid) { $grpcount++; if ($activetime < $time || $grpcount == $countgrp && $nextup == 0 && $showhighest == 1 || $grpcount == $countgrp && $nextup == 0 && $adminlogin == 1) { 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) { if ($status == 1) { echo ''; } else { echo ''; } } if ($showcolot == 1 || $adminlogin == 1) { echo ''; } elseif ($sqlhisgroup_file[$sqlhis[$uid]['grpid']]===true) { echo ''; } else { echo ''; } } if ($showcolnx == 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 ($showcolsg == 1 || $adminlogin == 1) { if ($grpcount == $countgrp && $nextup == 0 && $showhighest == 1 || $grpcount == $countgrp && $nextup == 0 && $adminlogin == 1) { echo ''; $highest++; } elseif ($sqlhisgroup_file[$groupid]===true) { echo ''; } else { echo ''; } } echo ''; break; } elseif ($grpcount == $countgrp && $nextup == 0) { $highest++; } } } } else { echo ''; } echo '
' . $lang['listnick'] . '' . $lang['listnick'] . '' , $lang['listuid'] , '' , $lang['listcldbid'] , '' , $lang['listip'] , '' , $lang['listseen'] , '' , $lang['listsumo'] , '' , $lang['listsumi'] , '' , $lang['listsuma'] , '' , $lang['listacsg'] , '' . $lang['listnxup'] . '' . $lang['listnxup'] . '' , $lang['listnxsg'] , '
' , $sqlhis[$uid]['rank'] , '' , $sqlhis[$uid]['name'] , '' , $sqlhis[$uid]['name'] , '' , $uid , '' , $uid , '' , $sqlhis[$uid]['cldbid'] , '' , long2ip($sqlhis[$uid]['ip']) , '' , date('Y-m-d H:i:s',$lastseen), '' , date('Y-m-d H:i:s',$lastseen), ''; $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 ($showcolas == 1 || $adminlogin == 1) { $usergroupid = $sqlhis[$uid]['grpid']; if ($sqlhis[$uid]['grpid'] == 0) { echo 'groupicon  ' , $sqlhisgroup[$usergroupid] , '' , $sqlhisgroup[$usergroupid] , ''; $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 , '',$lang['highest'],'groupicon  ' , $sqlhisgroup[$groupid] , '' , $sqlhisgroup[$groupid] , '
' , $lang['noentry'] , '
'; if($user_pro_seite != "all") { pagination($keysort,$keyorder,$user_pro_seite,$seiten_anzahl_gerundet,$seite,$getstring); } ?>