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($_GET['admin'] == "true" && isset($_SESSION['username'])) {
$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['listnick'] . ' | ' : '' . $lang['listnick'] . ' | '; if ($showcoluuid == 1 || $adminlogin == 1) echo '' , $lang['listuid'] , ' | '; if ($showcoldbid == 1 || $adminlogin == 1) echo '' , $lang['listcldbid'] , ' | '; if ($adminlogin == 1) echo '' , $lang['listip'] , ' | '; if ($showcolls == 1 || $adminlogin == 1) echo '' , $lang['listseen'] , ' | '; if ($showcolot == 1 || $adminlogin == 1) echo '' , $lang['listsumo'] , ' | '; if ($showcolit == 1 || $adminlogin == 1) echo '' , $lang['listsumi'] , ' | '; if ($showcolat == 1 || $adminlogin == 1) echo '' , $lang['listsuma'] , ' | '; if ($showcolas == 1 || $adminlogin == 1) echo '' , $lang['listacsg'] , ' | '; if ($showcolnx == 1 || $adminlogin == 1) echo ($keysort == 'nextup') ? '' . $lang['listnxup'] . ' | ' : '' . $lang['listnxup'] . ' | '; if ($showcolsg == 1 || $adminlogin == 1) echo '' , $lang['listnxsg'] , ' | '; echo '||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ' , $sqlhis[$uid]['rank'] , ' | '; } if ($adminlogin == 1) { echo '' , $sqlhis[$uid]['name'] , ' | '; } elseif ($showcolcld == 1) { echo '' , $sqlhis[$uid]['name'] , ' | '; } if ($adminlogin == 1) { echo '' , $uid , ' | '; } elseif ($showcoluuid == 1) { echo '' , $uid , ' | '; } if ($showcoldbid == 1 || $adminlogin == 1) echo '' , $sqlhis[$uid]['cldbid'] , ' | '; if ($adminlogin == 1) echo '' , long2ip($sqlhis[$uid]['ip']) , ' | '; if ($showcolls == 1 || $adminlogin == 1) { if ($status == 1) { echo '' , date('Y-m-d H:i:s',$lastseen), ' | '; } else { echo '' , date('Y-m-d H:i:s',$lastseen), ' | '; } } if ($showcolot == 1 || $adminlogin == 1) { 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 ($showcolas == 1 || $adminlogin == 1) { $usergroupid = $sqlhis[$uid]['grpid']; if ($sqlhis[$uid]['grpid'] == 0) { echo ' | '; } elseif ($sqlhisgroup_file[$sqlhis[$uid]['grpid']]===true) { echo ' | ' , $sqlhisgroup[$usergroupid] , ' | '; } } 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 , ' | '; } 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 '',$lang['highest'],' | '; $highest++; } elseif ($sqlhisgroup_file[$groupid]===true) { echo '' , $sqlhisgroup[$groupid] , ' | '; } } echo '||
| ' , $lang['noentry'] , ' | ||||||||||||||||||