made changes

This commit is contained in:
Newcomer1989
2015-03-27 20:18:21 +01:00
parent 4cff3f3317
commit 309907ab30
13 changed files with 2222 additions and 1710 deletions

View File

@@ -1,12 +1,25 @@
<!doctype html>
<!doctype html>
<html>
<head>
<title>TS-N.NET Ranksystem - Installation</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="other/style.css.php" />
<script type="text/javascript" src="jquerylib/jquery.js"></script>
<script type="text/javascript">
function showpwd()
{
$('#pass')[0].type = 'text';
}
function hidepwd()
{
$('#pass')[0].type = 'password';
}
</script>
</head>
<body>
<?php
$language='en';
if(isset($_GET['lang']))
{
$language=$_GET['lang'];
@@ -15,58 +28,98 @@ if(isset($_GET['lang']))
require_once('other/dbconfig.php');
require_once('lang.php');
echo $test;
if(isset($_POST['confweb']))
{
require_once('other/dbconfig.php');
$user=$_POST['user'];
$pass=$_POST['pass'];
$mysqlcon=mysqli_connect($db['host'], $db['user'], $db['pass'], $db['dbname']);
if(!$mysqlcon->query("INSERT INTO config (webuser,webpass,tshost,tsquery,tsvoice,tsuser,tspass,language,queryname,queryname2,grouptime,resetbydbchange,msgtouser,upcheck,uniqueid,updateinfotime,currvers,exceptuuid,exceptgroup,dateformat,showexgrp,showexcld,showcolcld,showcoluuid,showcoldbid,showcolot,showcolit,showcolat,showcolnx,showcolsg,bgcolor,hdcolor,txcolor,hvcolor,ifcolor,wncolor,sccolor,showgen) VALUES ('$user','$pass','localhost','10011','9987','serveradmin','querypass','en','http://ts-n.net/ranksystem.php','http://www.ts-n.net/ranksystem.php','31536000=>47,31536060=>50','1','1','1','xrTKhT/HDl4ea0WoFDQH2zOpmKg=,9odBYAU7z2E2feUz965sL0/MyBom=','7200','0.10-beta','xrTKhT/HDl4ea0WoFDQH2zOpmKg=','2,6','%a days, %h hours, %i mins, %s secs','1','1','1','1','1','1','1','1','1','1','#101010','#909090','#707070','#FFFFFF','#3366CC','#CC0000','#008000','1')"))
$dbserver = $db['type'].':host='.$db['host'].';dbname='.$db['dbname'];
try {
$mysqlcon = new PDO($dbserver, $db['user'], $db['pass']);
} catch (PDOException $e) {
$sqlconerr = 'SQL Connection failed: '.$e->getMessage();
exit;
}
if($mysqlcon->exec("INSERT INTO config (webuser,webpass,tshost,tsquery,tsvoice,tsuser,language,queryname,queryname2,grouptime,resetbydbchange,msgtouser,upcheck,uniqueid,updateinfotime,currvers,exceptuuid,exceptgroup,dateformat,showexgrp,showexcld,showcolcld,showcoluuid,showcoldbid,showcolot,showcolit,showcolat,showcolnx,showcolsg,bgcolor,hdcolor,txcolor,hvcolor,ifcolor,wncolor,sccolor,showgen,showcolrg,showcolls) VALUES ('$user','$pass','localhost','10011','9987','serveradmin','en','http://ts-n.net/ranksystem.php','www.ts-n.net/ranksystem.php','31536000=>47,31536060=>50','1','1','1','xrTKhT/HDl4ea0WoFDQH2zOpmKg=,9odBYAU7z2E2feUz965sL0/MyBom=','7200','0.11-beta','xrTKhT/HDl4ea0WoFDQH2zOpmKg=','2,6','%a days, %h hours, %i mins, %s secs','1','1','1','1','1','1','1','1','1','1','#101010','#909090','#707070','#FFFFFF','#3366CC','#CC0000','#008000','1','1','1')") === false)
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor>';
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
else
{
echo'<sccolor>'.$lang['isntwiusr'].'</sccolor><br><br>';
echo'<wncolor>'.sprintf($lang['isntwidel'],"<a href=\"webinterface.php\">webinterface.php</a>").'</wncolor>';
echo'<span class="sccolor">'.$lang['isntwiusr'].'</span><br><br>';
echo'<span class="wncolor">'.sprintf($lang['isntwidel'],"<a href=\"webinterface.php\">webinterface.php</a>").'</span>';
}
}
elseif($db['host']!='hostname')
{
echo'<wncolor>'.sprintf($lang['isntwidel'],"<a href=\"webinterface.php\">webinterface.php</a>").'</wncolor>';
echo'<span class="wncolor">'.sprintf($lang['isntwidel'],"<a href=\"webinterface.php\">webinterface.php</a>").'</span>';
}
else
{
if(isset($_POST['installdb']))
{
$type=$_POST['type'];
$host=$_POST['host'];
$user=$_POST['user'];
$pass=$_POST['pass'];
$dbname=$_POST['dbname'];
$mysqlcon=mysqli_connect($host, $user, $pass);
if(empty($host) or empty($user) or empty($pass) or empty($dbname) or mysqli_connect_errno())
$dbserver = $type.':host='.$host.';dbname='.$dbname;
$dbserver2 = $type.':host='.$host;
try {
$mysqlcon = new PDO($dbserver, $user, $pass);
} catch (PDOException $e) {
try {
$mysqlcon = new PDO($dbserver2, $user, $pass);
} catch (PDOException $e) {
$sqlconerr = 'SQL Connection failed: '.$e->getMessage();
}
}
if(empty($host) || empty($user) || empty($pass) || empty($dbname) || isset($sqlconerr))
{
echo '<form name="form" method="post">
<table class="tabledefault">
<tr><td class="center" colspan="2"><b><h1>'.$lang['instdb'].'</h1></b></td></tr>
<tr><td class="right" colspan="2">Language: <select name="lang" onchange="location.href=this.form.lang.options[this.form.lang.selectedIndex].value"><option>&nbsp;</option><option value="install.php?lang=en">english</option><option value="install.php?lang=de">deutsch</option><option value="install.php?lang=ru">русский</option></select></td></tr>
<tr><td class="center" colspan="2"><span class="size1"><b>'.$lang['instdb'].'</span></td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td class="red" colspan="2">'.$lang['isntwidberr'].'</td></tr>';
if(mysqli_connect_errno())
{ echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td class="red" colspan="2">'.$lang['isntwidbmsg'].mysqli_connect_error().'</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr>'; }
if(empty($host))
{ echo '<tr><td class="tdred">'.$lang['isntwidbhost'].'</td><td class="tdleft"><input type="text" name="host" value="',$host,'" style="width:35%"></td></tr>'; } else
{ echo '<tr><td class="tdright">'.$lang['isntwidbhost'].'</td><td class="tdleft"><input type="text" name="host" value="',$host,'" style="width:35%"></td></tr>'; }
if(empty($user))
{ echo '<tr><td class="tdred">'.$lang['isntwidbusr'].'</td><td class="tdleft"><input type="text" name="user" value="',$user,'" style="width:35%;"></td></tr>'; } else
{ echo '<tr><td class="tdright">'.$lang['isntwidbusr'].'</td><td class="tdleft"><input type="text" name="user" value="',$user,'" style="width:35%;"></td></tr>'; }
if(empty($pass))
{ echo '<tr><td class="tdred">'.$lang['isntwidbpass'].'</td><td class="tdleft"><input type="text" name="pass" value="',$pass,'" style="width:35%;"></td></tr>'; } else
{ echo '<tr><td class="tdright">'.$lang['isntwidbpass'].'</td><td class="tdleft"><input type="text" name="pass" value="',$pass,'" style="width:35%;"></td></tr>'; }
if(empty($dbname))
{ echo '<tr><td class="tdred">'.$lang['isntwidbname'].'</td><td class="tdleft"><input type="text" name="dbname" value="',$dbname,'" style="width:35%"></td></tr>'; } else
{ echo '<tr><td class="tdright">'.$lang['isntwidbname'].'</td><td class="tdleft"><input type="text" name="dbname" value="',$dbname,'" style="width:35%"></td></tr>'; }
<tr><td class="wncolor" colspan="2">'.$lang['isntwidberr'].'</td></tr>';
if(isset($sqlconerr)) {
echo '<tr><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td class="wncolor" colspan="2">'.$lang['isntwidbmsg'].$sqlconerr.'</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td></tr>';
}
echo '<tr><td class="tdred">'.$lang['isntwidbtype'].'</td>
<td class="tdleft"><select name="type" style="width:35%">
<option value="cubrid">cubrid - Cubrid</option>
<option value="dblib">dblib - FreeTDS / Microsoft SQL Server / Sybase</option>
<option value="firebird">firebird - Firebird/Interbase 6</option>
<option value="ibm">ibm - IBM DB2</option>
<option value="informix">informix - IBM Informix Dynamic Server</option>
<option value="mysql" selected="selected">mysql - MySQL 3.x/4.x/5.x [recommend]</option>
<option value="oci">oci - Oracle Call Interface</option>
<option value="odbc">odbc - ODBC v3 (IBM DB2, unixODBC und win32 ODBC)</option>
<option value="pgsql">pgsql - PostgreSQL</option>
<option value="sqlite">sqlite - SQLite 3 und SQLite 2</option>
<option value="sqlsrv">sqlsrv - Microsoft SQL Server / SQL Azure</option>
<option value="4d">4d - 4D</option>
</select></td></tr>';
if(empty($host)) {
echo '<tr><td class="tdred">'.$lang['isntwidbhost'].'</td><td class="tdleft"><input type="text" name="host" value="',$host,'" style="width:35%"></td></tr>';
} else {
echo '<tr><td class="tdright">'.$lang['isntwidbhost'].'</td><td class="tdleft"><input type="text" name="host" value="',$host,'" style="width:35%"></td></tr>';
}
if(empty($user)) {
echo '<tr><td class="tdred">'.$lang['isntwidbusr'].'</td><td class="tdleft"><input type="text" name="user" value="',$user,'" style="width:35%;"></td></tr>';
} else {
echo '<tr><td class="tdright">'.$lang['isntwidbusr'].'</td><td class="tdleft"><input type="text" name="user" value="',$user,'" style="width:35%;"></td></tr>';
}
if(empty($pass)) {
echo '<tr><td class="tdred">'.$lang['isntwidbpass'].'</td><td class="tdleft"><input type="password" name="pass" id="pass" value="',$pass,'" ondblclick="showpwd()" onblur="hidepwd()" style="width:35%;"></td></tr>';
} else {
echo '<tr><td class="tdright">'.$lang['isntwidbpass'].'</td><td class="tdleft"><input type="password" name="pass" id="pass" value="',$pass,'" ondblclick="showpwd()" onblur="hidepwd()" style="width:35%;"></td></tr>';
}
if(empty($dbname)) {
echo '<tr><td class="tdred">'.$lang['isntwidbname'].'</td><td class="tdleft"><input type="text" name="dbname" value="',$dbname,'" style="width:35%"></td></tr>';
} else {
echo '<tr><td class="tdright">'.$lang['isntwidbname'].'</td><td class="tdleft"><input type="text" name="dbname" value="',$dbname,'" style="width:35%"></td></tr>';
}
echo '<tr><td>&nbsp;</td><td class="tdleft"><br><input type="submit" name="installdb" class="button" value="'.$lang['instdbsubm'].'" style="width:150px"></td></tr>
</table></form>';
@@ -74,6 +127,7 @@ else
else
{
$newconfig='<?php
$db[\'type\']="'.$type.'";
$db[\'host\']="'.$host.'";
$db[\'user\']="'.$user.'";
$db[\'pass\']="'.$pass.'";
@@ -87,81 +141,109 @@ $db[\'dbname\']="'.$dbname.'";
else
{
echo '<br><br>'.$lang['instdb'].'<br>';
$mysqlcon->query("DROP DATABASE $dbname");
if(!$mysqlcon->query("CREATE DATABASE $dbname"))
$mysqlcon->exec("DROP DATABASE $dbname");
if($mysqlcon->exec("CREATE DATABASE $dbname") === false)
{
echo $lang['instdberr'].'<wncolor>'.$mysqlcon->error.'</wncolor>';
echo $lang['instdberr'].'<span class="wncolor">'.$mysqlcon->errorCode().'</span>';
}
else
{
echo'<sccolor>'.sprintf($lang['instdbsuc'],$dbname).'</sccolor>';
echo'<span class="sccolor">'.sprintf($lang['instdbsuc'],$dbname).'</span>';
$count++;
}
echo '<br><br>'.$lang['insttb'].'<br>';
if(!$mysqlcon->query("CREATE TABLE $dbname.user (uuid text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,cldbid int(10) NOT NULL,count int(11) NOT NULL,ip int(10) NOT NULL,name text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,lastseen int(10) NOT NULL,grpid int(10) NOT NULL,nextup int(11) NOT NULL,idle int(11) NOT NULL,cldgroup text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,online int(1) NOT NULL)"))
if($mysqlcon->exec("CREATE TABLE $dbname.user (uuid varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci PRIMARY KEY,cldbid bigint(10) NOT NULL default '0',count bigint(11) NOT NULL default '0',ip bigint(10) NOT NULL default '0',name text CHARACTER SET utf8 COLLATE utf8_unicode_ci,lastseen bigint(11) NOT NULL default '0',grpid bigint(10) NOT NULL default '0',nextup bigint(11) NOT NULL default '0',idle bigint(11) NOT NULL default '0',cldgroup text CHARACTER SET utf8 COLLATE utf8_unicode_ci,online int(1) NOT NULL default '0')") === false)
{
echo $lang['insttberr'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
echo $lang['insttberr'].'<span class="wncolor">'.$mysqlcon->errorCode().'.</span><br>';
}
else
{
echo '<sccolor>'.sprintf($lang['insttbsuc'],'user').'</sccolor><br>';
echo '<span class="sccolor">'.sprintf($lang['insttbsuc'],'user').'</span><br>';
$count++;
}
if(!$mysqlcon->query("CREATE TABLE $dbname.upcheck (timestamp int(10) NOT NULL)"))
if($mysqlcon->exec("CREATE TABLE $dbname.upcheck (timestamp bigint(11) NOT NULL default '0')") === false)
{
echo $lang['insttberr'].'<wncolor>'.$mysqlcon->error.'.</wncolor>';
$mysqlcon->query("INSERT INTO $dbname.upcheck (timestamp) VALUES ('1')");
echo $lang['insttberr'].'<span class="wncolor">'.$mysqlcon->errorCode().'.</span>';
}
else
{
echo '<sccolor>'.sprintf($lang['insttbsuc'],'upcheck').'</sccolor><br>';
if($mysqlcon->exec("INSERT INTO $dbname.upcheck SET timestamp='1'") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.$mysqlcon->errorCode().'.</span>';
} else {
echo '<span class="sccolor">'.sprintf($lang['insttbsuc'],'upcheck').'</span><br>';
$count++;
}
}
if($mysqlcon->exec("CREATE TABLE $dbname.lastscan (timestamp bigint(11) NOT NULL default '0')") === false)
{
echo $lang['insttberr'].'<span class="wncolor">'.$mysqlcon->errorCode().'.</span>';
}
else
{
echo '<span class="sccolor">'.sprintf($lang['insttbsuc'],'lastscan').'</span><br>';
$count++;
}
if(!$mysqlcon->query("CREATE TABLE $dbname.groups (sgid int(10) NOT NULL,sgidname text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL)"))
if($mysqlcon->exec("CREATE TABLE $dbname.groups (sgid bigint(10) PRIMARY KEY,sgidname text CHARACTER SET utf8 COLLATE utf8_unicode_ci,iconid bigint(10) NOT NULL default '0')") === false)
{
echo $lang['insttberr'].'<span class="red">'.$mysqlcon->error.'.</span><br>';
echo $lang['insttberr'].'<span class="wncolor">'.$mysqlcon->errorCode().'.</span><br>';
}
else
{
echo '<sccolor>'.sprintf($lang['insttbsuc'],'groups').'</sccolor><br>';
echo '<span class="sccolor">'.sprintf($lang['insttbsuc'],'groups').'</span><br>';
$count++;
}
if(!$mysqlcon->query("CREATE TABLE $dbname.config (webuser text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,webpass text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,tshost text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,tsquery int(5) NOT NULL,tsvoice int(5) NOT NULL,tsuser text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,tspass text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,language text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,queryname text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,queryname2 text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,grouptime text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,resetbydbchange int(1) NOT NULL,msgtouser int(1) NOT NULL,upcheck int(1) NOT NULL,uniqueid text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,updateinfotime int(11) NOT NULL,currvers text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,substridle int(1) NOT NULL,exceptuuid text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,exceptgroup text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,dateformat text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,showexgrp int(1) NOT NULL,showexcld int(1) NOT NULL,showcolcld int(1) NOT NULL,showcoluuid int(1) NOT NULL,showcoldbid int(1) NOT NULL,showcolot int(1) NOT NULL,showcolit int(1) NOT NULL,showcolat int(1) NOT NULL,showcolnx int(1) NOT NULL,showcolsg int(1) NOT NULL,bgcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,hdcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,txcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,hvcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,ifcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,wncolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,sccolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,showgen int(1) NOT NULL)"))
if($mysqlcon->exec("CREATE TABLE $dbname.config (webuser text CHARACTER SET utf8 COLLATE utf8_unicode_ci,webpass text CHARACTER SET utf8 COLLATE utf8_unicode_ci,tshost text CHARACTER SET utf8 COLLATE utf8_unicode_ci,tsquery int(5) NOT NULL default '0',tsvoice int(5) NOT NULL default '0',tsuser text CHARACTER SET utf8 COLLATE utf8_unicode_ci,tspass text CHARACTER SET utf8 COLLATE utf8_unicode_ci,language text CHARACTER SET utf8 COLLATE utf8_unicode_ci,queryname text CHARACTER SET utf8 COLLATE utf8_unicode_ci,queryname2 text CHARACTER SET utf8 COLLATE utf8_unicode_ci,grouptime text CHARACTER SET utf8 COLLATE utf8_unicode_ci,resetbydbchange int(1) NOT NULL default '0',msgtouser int(1) NOT NULL default '0',upcheck int(1) NOT NULL default '0',uniqueid text CHARACTER SET utf8 COLLATE utf8_unicode_ci,updateinfotime int(8) NOT NULL default '0',currvers text CHARACTER SET utf8 COLLATE utf8_unicode_ci,substridle int(1) NOT NULL default '0',exceptuuid text CHARACTER SET utf8 COLLATE utf8_unicode_ci,exceptgroup text CHARACTER SET utf8 COLLATE utf8_unicode_ci,dateformat text CHARACTER SET utf8 COLLATE utf8_unicode_ci,showexgrp int(1) NOT NULL default '0',showexcld int(1) NOT NULL default '0',showcolcld int(1) NOT NULL default '0',showcoluuid int(1) NOT NULL default '0',showcoldbid int(1) NOT NULL default '0',showcolot int(1) NOT NULL default '0',showcolit int(1) NOT NULL default '0',showcolat int(1) NOT NULL default '0',showcolnx int(1) NOT NULL default '0',showcolsg int(1) NOT NULL default '0',bgcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci,hdcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci,txcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci,hvcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci,ifcolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci,wncolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci,sccolor text CHARACTER SET utf8 COLLATE utf8_unicode_ci,showgen int(1) NOT NULL default '0',showcolrg int(1) NOT NULL default '0',showcolls int(1) NOT NULL default '0',slowmode int(1) NOT NULL default '0')") === false)
{
echo $lang['insttberr'].'<wncolor>'.$mysqlcon->error.'.</wncolor>';
echo $lang['insttberr'].'<span class="wncolor">'.$mysqlcon->errorCode().'.</span>';
}
else
{
echo '<sccolor>'.sprintf($lang['insttbsuc'],'config').'</sccolor><br>';
echo '<span class="sccolor">'.sprintf($lang['insttbsuc'],'config').'</span><br>';
$count++;
}
if($count>1)
{
echo '<form name="form" method="post">
<table class="tabledefault">
<tr><td class="center" colspan="2"><b><h1>'.$lang['isntwiusrh'].'</h1></b></td></tr>
<tr><td class="center" colspan="2"><span class="size1">'.$lang['isntwiusrh'].'</span></td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td class="center" colspan="2">'.$lang['isntwiusrdesc'].'</td></tr>
<tr><td class="tdright">'.$lang['user'].'</td><td class="tdleft"><input type="text" name="user" value="" style="width:35%"></td></tr>
<tr><td class="tdright">'.$lang['pass'].'</td><td class="tdleft"><input type="text" name="pass" value="" style="width:35%;"></td></tr>
<tr><td class="tdright">'.$lang['pass'].'</td><td class="tdleft"><input type="password" name="pass" id="pass" value="" ondblclick="showpwd()" onblur="hidepwd()" style="width:35%;"></td></tr>
<tr><td>&nbsp;</td><td class="tdleft"><br><input type="submit" name="confweb" class="button" value="'.$lang['isntwiusrcr'].'" style="width:150px"></td></tr>
</table></form>';
}
}
fclose($handle);
}
}
else
{
} elseif (!is_writable('./other/dbconfig.php')) {
echo '<span class="wncolor">',$lang['isntwicfg'],'</span>';
} else {
echo '<form name="form" method="post">
<table class="tabledefault">
<tr><td class="right" colspan="2">Language: <select name="lang" onchange="location.href=this.form.lang.options[this.form.lang.selectedIndex].value"><option></option><option value="install.php?lang=en">english</option><option value="install.php?lang=de">deutsch</option><option value="install.php?lang=ru">русский</option></select></td></tr>
<tr><td class="center" colspan="2"><b><h1>'.$lang['insttb'].'</h1></b></td></tr>
<tr><td class="right" colspan="2">Language: <select name="lang" onchange="location.href=this.form.lang.options[this.form.lang.selectedIndex].value"><option>&nbsp;</option><option value="install.php?lang=en">english</option><option value="install.php?lang=de">deutsch</option><option value="install.php?lang=ru">русский</option></select></td></tr>
<tr><td class="center" colspan="2"><span class="size1">'.$lang['instdb'].'</span></td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td class="center" colspan="2">'.$lang['isntwidb'].'</td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
<tr><td class="tdright">'.$lang['isntwidbtype'].'</td>
<td class="tdleft"><select name="type" style="width:35%">
<option value="cubrid">cubrid - Cubrid</option>
<option value="dblib">dblib - FreeTDS / Microsoft SQL Server / Sybase</option>
<option value="firebird">firebird - Firebird/Interbase 6</option>
<option value="ibm">ibm - IBM DB2</option>
<option value="informix">informix - IBM Informix Dynamic Server</option>
<option value="mysql" selected="selected">mysql - MySQL 3.x/4.x/5.x [recommend]</option>
<option value="oci">oci - Oracle Call Interface</option>
<option value="odbc">odbc - ODBC v3 (IBM DB2, unixODBC und win32 ODBC)</option>
<option value="pgsql">pgsql - PostgreSQL</option>
<option value="sqlite">sqlite - SQLite 3 und SQLite 2</option>
<option value="sqlsrv">sqlsrv - Microsoft SQL Server / SQL Azure</option>
<option value="4d">4d - 4D</option>
</select></td></tr>
<tr><td class="tdright">'.$lang['isntwidbhost'].'</td><td class="tdleft"><input type="text" name="host" value="" style="width:35%"></td></tr>
<tr><td class="tdright">'.$lang['isntwidbusr'].'</td><td class="tdleft"><input type="text" name="user" value="" style="width:35%;"></td></tr>
<tr><td class="tdright">'.$lang['isntwidbpass'].'</td><td class="tdleft"><input type="text" name="pass" value="" style="width:35%;"></td></tr>
<tr><td class="tdright">'.$lang['isntwidbpass'].'</td><td class="tdleft"><input type="password" name="pass" id="pass" value="" ondblclick="showpwd()" onblur="hidepwd()" style="width:35%;"></td></tr>
<tr><td class="tdright">'.$lang['isntwidbname'].'</td><td class="tdleft"><input type="text" name="dbname" value="" style="width:35%"></td></tr>
<tr><td>&nbsp;</td><td class="tdleft"><br><input type="submit" name="installdb" class="button" value="'.$lang['instdbsubm'].'" style="width:150px"></td></tr>
</table></form>';

1045
lang.php

File diff suppressed because it is too large Load Diff

View File

@@ -1,225 +1,246 @@
<?PHP
session_start();
$starttime = microtime(true);
?>
<!doctype html>
<html>
<head>
<title>TS-N.NET Ranksystem</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="other/style.css.php" />
<?php
echo'</head><body>';
$starttime=microtime(true);
<?PHP
echo '</head><body>';
$adminlogin = 0;
require_once('other/config.php');
if ($mysqlprob === false) {
echo '<span class="wncolor">',$sqlconerr,'</span><br>';
exit;
}
if (isset($_GET['lang'])) {
$language = $_GET['lang'];
}
require_once('lang.php');
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL-Database: ".mysqli_connect_error();
$keysort = '';
$keyorder = '';
if (isset($_GET['sort'])) {
$keysort = $_GET['sort'];
}
$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($keysort!='uuid' && $keysort!='cldbid' && $keysort!='count' && $keysort!='name' && $keysort!='idle' && $keysort!='active')
{
$keysort='nextup';
if (isset($_GET['order'])) {
$keyorder = $_GET['order'];
}
if(isset($_GET['order']))
{
$keyorder=$_GET['order'];
if ($keyorder == 'desc') {
$keyorder = 'DESC';
} else {
$keyorder = 'ASC';
}
if($keyorder=='desc')
{
$keyorder='DESC';
}
else
{
$keyorder='ASC';
}
$countentries=0;
if($keysort=='active' && $keyorder=='ASC')
{
$dbdata=$mysqlcon->query("SELECT * FROM user ORDER BY (count - idle)");
}
elseif($keysort=='active' && $keyorder=='DESC')
{
$dbdata=$mysqlcon->query("SELECT * FROM user ORDER BY (idle - count)");
}
else
{
$dbdata=$mysqlcon->query("SELECT * FROM user ORDER BY $keysort $keyorder");
}
while($uuid=$dbdata->fetch_assoc())
{
if($uuid['uuid']!="lastscantime")
{
$sqlhis[$uuid['uuid']]=array("cldbid"=>$uuid['cldbid'],"count"=>$uuid['count'],"name"=>$uuid['name'],"idle"=>$uuid['idle'],"cldgroup"=>$uuid['cldgroup'],"online"=>$uuid['online']);
$uidarr[]=$uuid['uuid'];
$countentries=$countentries+1;
}
else
{
$scantime=$uuid['lastseen'];
if (isset($_GET['admin'])) {
if($_GET['admin'] == "true" && isset($_SESSION['username'])) {
$adminlogin = 1;
}
}
$sumentries=$dbdata->num_rows;
$lifetime=time() - $scantime;
$dbgroups=$mysqlcon->query("SELECT * FROM groups");
while($servergroup=$dbgroups->fetch_assoc())
{
$sqlhisgroup[$servergroup['sgid']]=$servergroup['sgidname'];
$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 '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
exit;
}
switch($keyorder)
{
case "ASC": $keyorder2="desc"; break;
case "DESC": $keyorder2="asc";
$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'];
}
echo'<table class="tabledefault"><tr>';
if($showcolcld==1) echo ($keysort=='name') ? '<th><a href="?sort=name&amp;order='.$keyorder2.'"><hdcolor>'.$lang['listnick'].'</hdcolor></a></th>' : '<th><a href="?sort=name&amp;order='.$keyorder.'"><hdcolor>'.$lang['listnick'].'</hdcolor></a></th>';
if($showcoluuid==1) echo '<th><a href="?sort=uuid&amp;order='.$keyorder2.'"><hdcolor>'.$lang['listuid'].'</hdcolor></a></th>';
if($showcoldbid==1) echo'<th><a href="?sort=cldbid&amp;order='.$keyorder2.'"><hdcolor>'.$lang['listcldbid'].'</hdcolor></a></th>';
if($showcolot==1) echo'<th><a href="?sort=count&amp;order='.$keyorder2.'"><hdcolor>'.$lang['listsumo'].'</hdcolor></a></th>';
if($showcolit==1) echo'<th><a href="?sort=idle&amp;order='.$keyorder2.'"><hdcolor>'.$lang['listsumi'].'</hdcolor></a></th>';
if($showcolat==1) echo'<th><a href="?sort=active&amp;order='.$keyorder2.'"><hdcolor>'.$lang['listsuma'].'</hdcolor></a></th>';
if($showcolnx==1) echo ($keysort=='nextup') ? '<th><a href="?sort=nextup&amp;order='.$keyorder2.'"><hdcolor>'.$lang['listnxup'].'</hdcolor></a></th>' : '<th><a href="?sort=nextup&amp;order='.$keyorder.'"><hdcolor>'.$lang['listnxup'].'</hdcolor></a></th>';
if($showcolsg==1) echo'<th><a href="?sort=nextsgrp&amp;order='.$keyorder2.'"><hdcolor>'.$lang['listnxsg'].'</hdcolor></a></th>';
echo'</tr>';
if($adminlogin == 1) {
switch ($keyorder) {
case "ASC":
$keyorder2 = "desc&amp;admin=true";
break;
case "DESC":
$keyorder2 = "asc&amp;admin=true";
}
} else {
switch ($keyorder) {
case "ASC":
$keyorder2 = "desc";
break;
case "DESC":
$keyorder2 = "asc";
}
}
echo '<table class="tabledefault"><tr>';
if ($showcolrg == 1 || $adminlogin == 1)
echo '<th>' , $lang['listrank'] , '</th>';
if ($showcolcld == 1 || $adminlogin == 1)
echo ($keysort == 'name') ? '<th><a href="?sort=name&amp;order=' . $keyorder2 . '" ><span class="hdcolor">' . $lang['listnick'] . '</span></a></th>' : '<th><a href="?sort=name&amp;order=' . $keyorder2 . '"><span class="hdcolor">' . $lang['listnick'] . '</span></a></th>';
if ($showcoluuid == 1 || $adminlogin == 1)
echo '<th><a href="?sort=uuid&amp;order=' , $keyorder2 , '"><span class="hdcolor">' , $lang['listuid'] , '</span></a></th>';
if ($showcoldbid == 1 || $adminlogin == 1)
echo '<th><a href="?sort=cldbid&amp;order=' , $keyorder2 , '"><span class="hdcolor">' , $lang['listcldbid'] , '</span></a></th>';
if ($adminlogin == 1)
echo '<th><a href="?sort=ip&amp;order=' , $keyorder2 , '"><span class="hdcolor">' , $lang['listip'] , '</span></a></th>';
if ($showcolls == 1 || $adminlogin == 1)
echo '<th><a href="?sort=lastseen&amp;order=' , $keyorder2 , '"><span class="hdcolor">' , $lang['listseen'] , '</span></a></th>';
if ($showcolot == 1 || $adminlogin == 1)
echo '<th><a href="?sort=count&amp;order=' , $keyorder2 , '"><span class="hdcolor">' , $lang['listsumo'] , '</span></a></th>';
if ($showcolit == 1 || $adminlogin == 1)
echo '<th><a href="?sort=idle&amp;order=' , $keyorder2 , '"><span class="hdcolor">' , $lang['listsumi'] , '</span></a></th>';
if ($showcolat == 1 || $adminlogin == 1)
echo '<th><a href="?sort=active&amp;order=' , $keyorder2 , '"><span class="hdcolor">' , $lang['listsuma'] , '</span></a></th>';
if ($showcolnx == 1 || $adminlogin == 1)
echo ($keysort == 'nextup') ? '<th><a href="?sort=nextup&amp;order=' . $keyorder2 . '"><span class="hdcolor">' . $lang['listnxup'] . '</span></a></th>' : '<th><a href="?sort=nextup&amp;order=' . $keyorder2 . '"><span class="hdcolor">' . $lang['listnxup'] . '</span></a></th>';
if ($showcolsg == 1 || $adminlogin == 1)
echo '<th><a href="?sort=nextsgrp&amp;order=' , $keyorder2 , '"><span class="hdcolor">' , $lang['listnxsg'] , '</span></a></th>';
echo '</tr>';
ksort($grouptime);
if($countentries>0)
{
foreach($uidarr as $uid)
{
$cldgroup=$sqlhis[$uid]['cldgroup'];
$count=$sqlhis[$uid]['count'];
$idle=$sqlhis[$uid]['idle'];
$status=$sqlhis[$uid]['online'];
$sgroups=explode(",",$cldgroup);
$active=$count - $idle;
if($substridle==1)
{
$activetime=$count - $idle;
}
else
{
$activetime=$count;
}
foreach($grouptime as $time => $groupid)
{
$showrow=1;
if(array_intersect($sgroups, $exceptgroup) && $showexgrp!=1)
{
$showrow=0;
}
if(in_array($uid, $exceptuuid) && $showexcld!=1)
{
$showrow=0;
}
if($activetime<$time && $showrow==1)
{
if($status==1)
{
$neededtime=$time - $activetime - $lifetime;
} else
{
$neededtime=$time - $activetime;
}
echo'<tr>';
if($showcolcld==1)
{
echo'<td class="center">'.$sqlhis[$uid]['name'].'</td>';
}
if($showcoluuid==1)
{
echo'<td class="center">'.$uid.'</td>';
}
if($showcoldbid==1)
{
echo'<td class="center">'.$sqlhis[$uid]['cldbid'].'</td>';
}
if($showcolot==1)
{
echo'<td class="center">';
$dtF=new DateTime("@0");
$dtT=new DateTime("@$count");
$timecount=$dtF->diff($dtT)->format($timeformat);
echo $timecount;
}
if($showcolit==1)
{
echo'<td class="center">';
$dtF=new DateTime("@0");
$dtT=new DateTime("@$idle");
$timecount=$dtF->diff($dtT)->format($timeformat);
echo $timecount;
}
if($showcolat==1)
{
echo'<td class="center">';
$dtF=new DateTime("@0");
$dtT=new DateTime("@$active");
$timecount=$dtF->diff($dtT)->format($timeformat);
echo $timecount;
}
if($showcolnx==1)
{
echo'<td class="center">';
$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.'</td>';
}
elseif(!in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup))
{
$timecount=0;
echo $timecount.'</td>';
}
elseif(in_array($uid, $exceptuuid))
{
echo $lang['listexuid'].'</td>';
}
elseif(array_intersect($sgroups, $exceptgroup))
{
echo $lang['listexgrp'].'</td>';
}
else
{
echo $lang['errukwn'];
}
}
if($showcolsg==1)
{
echo'<td class="center">'.$sqlhisgroup[$groupid].'</td>';
}
echo'</tr>';
$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 '<tr>';
if ($showcolrg == 1 || $adminlogin == 1) {
$countrank++;
echo '<td class="center">' , $countrank , '</td>';
}
if ($adminlogin == 1) {
echo '<td class="center"><a href="http://www.tsviewer.com/index.php?page=search&action=ausgabe_user&nickname=' , $sqlhis[$uid]['name'] , '" target="_blank">' , $sqlhis[$uid]['name'] , '</a></td>';
} elseif ($showcolcld == 1) {
echo '<td class="center">' , $sqlhis[$uid]['name'] , '</td>';
}
if ($adminlogin == 1) {
echo '<td class="center"><a href="http://ts3index.com/?page=searchclient&uid=' , $uid , '" target="_blank">' , $uid , '</a></td>';
} elseif ($showcoluuid == 1) {
echo '<td class="center">' , $uid , '</td>';
}
if ($showcoldbid == 1 || $adminlogin == 1)
echo '<td class="center">' , $sqlhis[$uid]['cldbid'] , '</td>';
if ($adminlogin == 1)
echo '<td class="center"><a href="http://myip.ms/info/whois/' , long2ip($sqlhis[$uid]['ip']) , '" target="_blank">' , long2ip($sqlhis[$uid]['ip']) , '</a></td>';
if ($showcolls == 1 || $adminlogin == 1) {
echo '<td class="center">' , date('Y-m-d H:i:s',$lastseen);
echo '</td>';
}
if ($showcolot == 1 || $adminlogin == 1) {
echo '<td class="center">';
$dtF = new DateTime("@0");
$dtT = new DateTime("@$count");
$timecount = $dtF->diff($dtT)->format($timeformat);
echo $timecount;
}
if ($showcolit == 1 || $adminlogin == 1) {
echo '<td class="center">';
$dtF = new DateTime("@0");
$dtT = new DateTime("@$idle");
$timecount = $dtF->diff($dtT)->format($timeformat);
echo $timecount;
}
if ($showcolat == 1 || $adminlogin == 1) {
echo '<td class="center">';
$dtF = new DateTime("@0");
$dtT = new DateTime("@$active");
$timecount = $dtF->diff($dtT)->format($timeformat);
echo $timecount;
}
if ($showcolnx == 1 || $adminlogin == 1) {
echo '<td class="center">';
$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 , '</td>';
} elseif (!in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) {
$timecount = 0;
echo $timecount , '</td>';
} elseif (in_array($uid, $exceptuuid)) {
echo $lang['listexuid'] , '</td>';
} elseif (array_intersect($sgroups, $exceptgroup)) {
echo $lang['listexgrp'] , '</td>';
} else {
echo $lang['errukwn'];
}
}
if ($grpcount == $countgrp && $neededtime == 0) {
echo '<td class="center">highest rank reached</td>';
} elseif ($showcolsg == 1 || $adminlogin == 1) {
echo '<td class="center">' , $sqlhisgroup[$groupid] , '</td>';
}
echo '</tr>';
break;
}
}
}
} else {
echo '<tr><td colspan="6">' , $lang['noentry'] , '</td></tr>';
}
else
{
echo'<tr><td colspan="6">'.$lang['noentry'].'</td></tr>';
}
echo'</table>';
if($showgen==1)
{
$buildtime=microtime(true)-$starttime;
echo'<span class="tabledefault">'.sprintf($lang['sitegen'],$buildtime,$sumentries).'</span>';
echo '</table>';
if ($showgen == 1 || $adminlogin == 1) {
$reached = $highest - $countrank;
$buildtime = microtime(true) - $starttime;
echo '<span class="tabledefault">' , sprintf($lang['sitegen'], $buildtime, $sumentries) , ' (',$countrank,' showing; ',$except,' exceptions; ',$reached,' highest rank)</span>';
}
?>
</body>

View File

@@ -1,65 +1,83 @@
<?php
<?PHP
require_once('dbconfig.php');
$mysqlprob=true;
if(!$mysqlcon=mysqli_connect($db['host'], $db['user'], $db['pass'], $db['dbname']))
{
$mysqlprob=false;
$mysqlprob = true;
if(isset($db['type']) === false) {
$db['type']="mysql";
}
if($mysqlprob==false || !$config=$mysqlcon->query("SELECT * FROM config"))
{
$bgcolor='#101010';
$hdcolor='#909090';
$txcolor='#707070';
$hvcolor='#FFFFFF';
$ifcolor='#3366CC';
$wncolor='#CC0000';
$sccolor='#008000';
$showgen='1';
$dbname = $db['dbname'];
$dbserver = $db['type'].':host='.$db['host'].';dbname='.$db['dbname'];
if ($db['type'] == 'mysql') {
$dboptions = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8');
} else {
$dboptions = array();
}
else
{
$config=$config->fetch_row();
$ts['host']=$config[2];
$ts['query']=$config[3];
$ts['voice']=$config[4];
$ts['user']=$config[5];
$ts['pass']=$config[6];
$language=$config[7];
$queryname=$config[8];
$queryname2=$config[9];
$grouptimearr=explode(',',$config[10]);
foreach($grouptimearr as $entry)
{
list($key,$value)=explode('=>',$entry);
$grouptime[$key]=$value;
try {
$mysqlcon = new PDO($dbserver, $db['user'], $db['pass'], $dboptions);
} catch (PDOException $e) {
$sqlconerr = 'SQL Connection failed: '.$e->getMessage();
$mysqlprob = false;
}
if ($mysqlprob === false || !$config = $mysqlcon->query("SELECT * FROM config")) {
$bgcolor = '#101010';
$hdcolor = '#909090';
$txcolor = '#707070';
$hvcolor = '#FFFFFF';
$ifcolor = '#3366CC';
$wncolor = '#CC0000';
$sccolor = '#008000';
$showgen = '1';
} else {
$config = $config->fetchAll();
$ts['host'] = $config[0]['tshost'];
$ts['query'] = $config[0]['tsquery'];
$ts['voice'] = $config[0]['tsvoice'];
$ts['user'] = $config[0]['tsuser'];
$ts['pass'] = $config[0]['tspass'];
$webuser = $config[0]['webuser'];
$webpass = $config[0]['webpass'];
$language = $config[0]['language'];
$queryname = $config[0]['queryname'];
$queryname2 = $config[0]['queryname2'];
if(empty($config[0]['grouptime'])) {
$grouptime == $config[0]['grouptime'];
} else {
$grouptimearr = explode(',', $config[0]['grouptime']);
foreach ($grouptimearr as $entry) {
list($key, $value) = explode('=>', $entry);
$grouptime[$key] = $value;
}
}
$resetbydbchange=$config[11];
$msgtouser=$config[12];
$update=$config[13];
$uniqueid=explode(',',$config[14]);
$updateinfotime=$config[15];
$currvers=$config[16];
$substridle=$config[17];
$exceptuuid=explode(',',$config[18]);
$exceptgroup=explode(',',$config[19]);
$timeformat=$config[20];
$showexgrp=$config[21];
$showexcld=$config[22];
$showcolcld=$config[23];
$showcoluuid=$config[24];
$showcoldbid=$config[25];
$showcolot=$config[26];
$showcolit=$config[27];
$showcolat=$config[28];
$showcolnx=$config[29];
$showcolsg=$config[30];
$bgcolor=$config[31];
$hdcolor=$config[32];
$txcolor=$config[33];
$hvcolor=$config[34];
$ifcolor=$config[35];
$wncolor=$config[36];
$sccolor=$config[37];
$showgen=$config[38];
$resetbydbchange = $config[0]['resetbydbchange'];
$msgtouser = $config[0]['msgtouser'];
$update = $config[0]['upcheck'];
$uniqueid = explode(',', $config[0]['uniqueid']);
$updateinfotime = $config[0]['updateinfotime'];
$currvers = $config[0]['currvers'];
$substridle = $config[0]['substridle'];
$exceptuuid = explode(',', $config[0]['exceptuuid']);
$exceptgroup = explode(',', $config[0]['exceptgroup']);
$timeformat = $config[0]['dateformat'];
$showexgrp = $config[0]['showexgrp'];
$showexcld = $config[0]['showexcld'];
$showcolcld = $config[0]['showcolcld'];
$showcoluuid = $config[0]['showcoluuid'];
$showcoldbid = $config[0]['showcoldbid'];
$showcolot = $config[0]['showcolot'];
$showcolit = $config[0]['showcolit'];
$showcolat = $config[0]['showcolat'];
$showcolnx = $config[0]['showcolnx'];
$showcolsg = $config[0]['showcolsg'];
$bgcolor = $config[0]['bgcolor'];
$hdcolor = $config[0]['hdcolor'];
$txcolor = $config[0]['txcolor'];
$hvcolor = $config[0]['hvcolor'];
$ifcolor = $config[0]['ifcolor'];
$wncolor = $config[0]['wncolor'];
$sccolor = $config[0]['sccolor'];
$showgen = $config[0]['showgen'];
$showcolrg = $config[0]['showcolrg'];
$showcolls = $config[0]['showcolls'];
$slowmode = $config[0]['slowmode'];
}
?>

View File

@@ -1,4 +1,5 @@
<?php
$db['type']="type";
$db['host']="hostname";
$db['user']="dbuser";
$db['pass']="dbpass";

View File

@@ -1,18 +1,18 @@
<?php
<?PHP
$q = strtolower($_GET["q"]);
if (!$q) return;
if (!$q)
return;
require_once('config.php');
$dbuserlist=$mysqlcon->query("SELECT * FROM user ORDER BY online DESC");
$items=array();
while($userlist=$dbuserlist->fetch_assoc())
{
$items[$userlist['name']]=$userlist['uuid'];
$dbuserlist = $mysqlcon->query("SELECT * FROM user ORDER BY online DESC");
$items = array();
$dbuserlist = $dbuserlist->fetchAll();
foreach ($dbuserlist as $userlist) {
$items[$userlist['name']] = $userlist['uuid'];
}
foreach ($items as $key=>$value) {
if (strpos(strtolower($key), $q) !== false) {
echo "$key|$value\n";
}
foreach ($items as $key => $value) {
if (strpos(strtolower($key), $q) !== false) {
$key=str_replace('|','&#124;',$key);
echo "$key|$value\n";
}
}
?>

View File

@@ -1,22 +1,20 @@
<?php
header('Content-type: text/css');
require_once('config.php');
<?PHP
header('Content-type: text/css');
require_once('config.php');
?>
body{font-family:Century Gothic,sans-serif;font-size:15px;color:<?=$txcolor?>;background-color:<?=$bgcolor?>;}
body{font-family:Century Gothic,sans-serif;font-size:15px;color:<?= $txcolor ?>;background-color:<?= $bgcolor ?>;}
a:link{text-decoration:none;color:<?=$txcolor?>;}
a:visited{text-decoration:none;color:<?=$txcolor?>;}
a:hover{text-decoration:none;color:<?=$hvcolor?>;}
a:link{text-decoration:none;color:<?= $txcolor ?>;}
a:visited{text-decoration:none;color:<?= $txcolor ?>;}
a:hover{text-decoration:none;color:<?= $hvcolor ?>;}
th{font-weight:bold;text-align:center;}
.hdcolor{color:<?= $hdcolor ?>;}
.ifcolor{color:<?= $ifcolor ?>;}
.wncolor{color:<?= $wncolor ?>;}
.sccolor{color:<?= $sccolor ?>;}
hdcolor{color:<?=$hdcolor?>;}
ifcolor{color:<?=$ifcolor?>;}
wncolor{color:<?=$wncolor?>;}
sccolor{color:<?=$sccolor?>;}
.tabledefault{width:95%;top:10;left:10;border:0;text-align:center;font-family:Verdana;font-size:10pt;margin:0 auto;}
.tabledefault{width:95%;top:10;left:10;border:1;text-align:center;font-family:Verdana;font-size:10pt;margin:0 auto;}
.tablefunction{max-width:500px;width:100%;top:10;left:10;border:0;text-align:center;font-family:Verdana;font-size:10pt;margin:0 auto;}
.tablelogin{position:fixed;top:50%;left:50%;margin-top:-40px;margin-left:-150px;}
.tdleft{width:55%;text-align:left;}
@@ -27,12 +25,19 @@ sccolor{color:<?=$sccolor?>;}
.tdheadline{text-align:center;background-color:#0A1B2A;}
.tdheadline:hover{text-align:center;background-color:#0B243B;}
.tdheadlineimp{text-align:center;background-color:#003300;}
.tdheadlineimp:hover{text-align:center;background-color:#006600;}
.center{text-align:center;}
.right{text-align:right;}
size1{font-size:24px;font-weight:bold;}
size2{font-size:16px;font-weight:bold;}
.opacity{opacity:0.1;}
.size1{font-size:24px;font-weight:bold;}
.size2{font-size:16px;font-weight:bold;}
.width{width:95%;box-sizing:border-box;}
th{font-weight:bold;text-align:center;color:<?= $hdcolor ?>;}
select{width:140px;}
input.switch:empty {margin-left:-9999px;}
@@ -42,7 +47,7 @@ input.switch:empty ~ label:after{width:1.2em;top:0.1em;bottom:0.1em;margin-left:
input.switch:checked ~ label:before{background-color:green;}
input.switch:checked ~ label:after{margin-left:1.5em;}
tooltip {position:relative;display:inline;}
tooltip span{width:350px;position:absolute;color:#000;background:#CCCCCC;padding:10px 10px 10px 10px;line-height:16px;text-align:center;visibility:hidden;border-radius:5px;box-shadow:0px 1px 2px #0B243B;}
tooltip span:after{content:'';position:absolute;top:7px;left:100%;width:0;height:0;border-left:12px solid #CCCCCC;border-top:12px solid transparent;border-bottom:12px solid transparent;}
tooltip:hover span{visibility:visible;right:110%;margin-top:-10px;margin-right:15px;z-index:999;}
.tooltip {position:relative;display:inline;}
.tooltip span{width:350px;position:absolute;color:#000;background:#CCCCCC;padding:10px 10px 10px 10px;line-height:16px;text-align:center;visibility:hidden;border-radius:5px;box-shadow:0px 1px 2px #0B243B;}
.tooltip span:after{content:'';position:absolute;top:7px;left:100%;width:0;height:0;border-left:12px solid #CCCCCC;border-top:12px solid transparent;border-bottom:12px solid transparent;}
.tooltip:hover span{visibility:visible;right:110%;margin-top:-10px;margin-right:15px;z-index:999;}

View File

@@ -1,246 +1,339 @@
<?PHP
$access=$mysqlcon->query("SELECT * FROM config");
$access=$access->fetch_row();
echo'
<table class="tabledefault">
<tr><td class="right" colspan="2"><a href="webinterface.php?logout=true">'.$lang['wilogout'].'</a></td></tr>
<tr><td class="center" colspan="4"><size1>'.$lang['wihl'].'<size1></td></tr>
<tr><td class="center" colspan="4">'.sprintf($lang['wiversion'],$access[16]).'</td></tr>
<tr><td class="center" colspan="4"><div id="alert"><sccolor>',$alert,'</sccolor></div></td></tr>
</table>
<?PHP
$configs = $mysqlcon->query("SELECT * FROM config");
$configs = $configs->fetch(PDO::FETCH_ASSOC);
<table class="tablefunction">
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadline">
<a href="javascript:void(0)" title="" onclick="toggle(0);" style="display:block;"><size2>'.$lang['wihlts'].'</size2></a>
</td></tr>
<tr><td class="center">
echo '<table class="tabledefault">
<tr><td class="right"><a href="webinterface.php?logout=true">', $lang['wilogout'], '</a></td></tr>
<tr><td class="center size1">', $lang['wihl'], '</td></tr>
<tr><td class="center">', sprintf($lang['wiversion'], $configs['currvers']), '</td></tr>
<tr><td class="center"><div id="alert">', $alert, '</div></td></tr>
</table>
<table class="tablefunction">
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadlineimp size2">
<a href="javascript:void(0)" title="" onclick="toggle(0);" style="display:block;">', $lang['wihlts'], '</a>
</td></tr>
<tr><td class="center">
<div class="layers" style="display:none;">
<form name="updatets" method="post">
<input type="hidden" name="savesettings" value="true">
<table class="tabledefault">
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wits3host'].'<span>'.$lang['wits3hostdesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="tshost" value="',$access[2],'" tabindex="1"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wits3query'].'<span>'.$lang['wits3querydesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="tsquery" value="',$access[3],'" tabindex="2"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wits3voice'].'<span>'.$lang['wits3voicedesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="tsvoice" value="',$access[4],'" tabindex="3"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wits3querusr'].'<span>'.$lang['wits3querusrdesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="tsuser" value="',$access[5],'" tabindex="4"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wits3querpw'].'<span>'.$lang['wits3querpwdesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="tspass" value="',$access[6],'" tabindex="5"></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wits3qnm'].'<span>'.$lang['wits3qnmdesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="queryname" value="',$access[8],'" tabindex="6"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wits3qnm2'].'<span>'.$lang['wits3qnm2desc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="queryname2" value="',$access[9],'" tabindex="7"></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="updatets" value="'.$lang['wisvconf'].'" tabindex="8"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wits3host'], '<span>', $lang['wits3hostdesc'], '</span></td>
<td class="tdlefth"><input type="text" name="tshost" value="', $configs['tshost'], '" class="width" tabindex="1"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wits3query'], '<span>', $lang['wits3querydesc'], '</span></td>
<td class="tdlefth"><input type="text" name="tsquery" value="', $configs['tsquery'], '" class="width" tabindex="2"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wits3voice'], '<span>', $lang['wits3voicedesc'], '</span></td>
<td class="tdlefth"><input type="text" name="tsvoice" value="', $configs['tsvoice'], '" class="width" tabindex="3"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wits3querusr'], '<span>', $lang['wits3querusrdesc'], '</span></td>
<td class="tdlefth"><input type="text" name="tsuser" value="', $configs['tsuser'], '" class="width" tabindex="4"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wits3querpw'], '<span>', $lang['wits3querpwdesc'], '</span></td>
<td class="tdlefth"><input type="password" name="tspass" value="', $configs['tspass'], '" id="tspass" ondblclick="showpwd(\'tspass\')" onblur="hidepwd(\'tspass\')" class="width" tabindex="5"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wits3qnm'], '<span>', $lang['wits3qnmdesc'], '</span></td>
<td class="tdlefth"><input type="text" name="queryname" value="', $configs['queryname'], '" class="width" maxlength="30" tabindex="6"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wits3qnm2'], '<span>', $lang['wits3qnm2desc'], '</span></td>
<td class="tdlefth"><input type="text" name="queryname2" value="', $configs['queryname2'], '" class="width" maxlength="30" tabindex="7"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wits3sm'], '<span>', $lang['wits3smdesc'], '</span></td>';
if ($configs['slowmode'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch101" name="slowmode" class="switch" checked class="width" tabindex="8">
<label for="switch101">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch101" name="slowmode" class="switch" class="width" tabindex="8">
<label for="switch101">&nbsp;</label></div></td></tr>';
}
echo '<tr><td colspan="2">&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="updatets" value="', $lang['wisvconf'], '" tabindex="8"></td></tr>
</table></form>
</div>
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadline">
<a href="javascript:void(0)" title="" onclick="toggle(1);" style="display:block;"><size2>'.$lang['wihlcfg'].'</size2></a>
</td></tr>
<tr><td class="center">
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadlineimp size2">
<a href="javascript:void(0)" title="" onclick="toggle(1);" style="display:block;">', $lang['wihldb'], '</a>
</td></tr>
<tr><td class="center">
<div class="layers" style="display:none;">
<form name="updatetdbsettings" method="post">
<input type="hidden" name="savesettings" value="true">
<table class="tabledefault">
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">',$lang['isntwidbtype'],'<span>', $lang['isntwidbtypedesc'], '</span></td>
<td class="tdlefth"><select name="dbtype" class="width" tabindex="1">';
echo '<option value="cubrid"'; if($db['type']=="cubrid") echo "selected=selected"; echo '">cubrid - Cubrid</option>';
echo '<option value="dblib"'; if($db['type']=="dblib") echo "selected=selected"; echo '">dblib - FreeTDS / Microsoft SQL Server / Sybase</option>';
echo '<option value="firebird"'; if($db['type']=="firebird") echo "selected=selected"; echo '">firebird - Firebird/Interbase 6</option>';
echo '<option value="ibm"'; if($db['type']=="ibm") echo "selected=selected"; echo '">ibm - IBM DB2</option>';
echo '<option value="informix"'; if($db['type']=="informix") echo "selected=selected"; echo '">informix - IBM Informix Dynamic Server</option>';
echo '<option value="mysql"'; if($db['type']=="mysql") echo "selected=selected"; echo '">mysql - MySQL 3.x/4.x/5.x [recommend]</option>';
echo '<option value="oci"'; if($db['type']=="oci") echo "selected=selected"; echo '">oci - Oracle Call Interface</option>';
echo '<option value="odbc"'; if($db['type']=="odbc") echo "selected=selected"; echo '">odbc - ODBC v3 (IBM DB2, unixODBC und win32 ODBC)</option>';
echo '<option value="pgsql"'; if($db['type']=="pgsql") echo "selected=selected"; echo '">pgsql - PostgreSQL</option>';
echo '<option value="sqlite"'; if($db['type']=="sqlite") echo "selected=selected"; echo '">sqlite - SQLite 3 und SQLite 2</option>';
echo '<option value="sqlsrv"'; if($db['type']=="sqlsrv") echo "selected=selected"; echo '">sqlsrv - Microsoft SQL Server / SQL Azure</option>';
echo '<option value="4d"'; if($db['type']=="4d") echo "selected=selected"; echo '">4d - 4D</option>';
echo '</select></td></tr>
<tr><td class="tdrighth tooltip">'.$lang['isntwidbhost'].'<span>', $lang['isntwidbhostdesc'], '</span></td>
<td class="tdlefth"><input type="text" name="dbhost" value="', $db['host'], '" class="width" tabindex="2"></td></tr>
<tr><td class="tdrighth tooltip">'.$lang['isntwidbusr'].'<span>', $lang['isntwidbusrdesc'], '</span></td>
<td class="tdlefth"><input type="text" name="dbuser" value="', $db['user'], '" class="width" tabindex="3"></td></tr>
<tr><td class="tdrighth tooltip">'.$lang['isntwidbpass'].'<span>', $lang['isntwidbpassdesc'], '</span></td>
<td class="tdlefth"><input type="password" name="dbpass" value="', $db['pass'], '" id="dbpass" ondblclick="showpwd(\'dbpass\')" onblur="hidepwd(\'dbpass\')" class="width" tabindex="4"></td></tr>
<tr><td class="tdrighth tooltip">'.$lang['isntwidbname'].'<span>', $lang['isntwidbnamedesc'], '</span></td>
<td class="tdlefth"><input type="text" name="dbname" value="', $db['dbname'], '" class="width" tabindex="5"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="updatetdbsettings" value="', $lang['wisvconf'], '" tabindex="6"></td></tr>
</table></form>
</div>
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadlineimp size2">
<a href="javascript:void(0)" title="" onclick="toggle(2);" style="display:block;">', $lang['wihlcfg'], '</a>
</td></tr>
<tr><td class="center">
<div class="layers" style="display:none;">
<form name="updatecore" method="post">
<input type="hidden" name="savesettings" value="true">
<table class="tabledefault">
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wigrptime'].'<span>'.$lang['wigrptimedesc'].'</span></tooltip></td>
<td class="tdlefth"><textarea rows="2" cols="30" name="grouptime" tabindex="1">',$access[10],'</textarea></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wisupidle'].'<span>'.$lang['wisupidledesc'].'</span></tooltip></td>';
if($access[17]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch1" name="substridle" class="switch" checked tabindex="2">
<label for="switch1">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch1" name="substridle" class="switch" tabindex="2">
<label for="switch1">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wimsgusr'].'<span>'.$lang['wimsgusrdesc'].'</span></tooltip></td>';
if($access[12]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch2" name="msgtouser" class="switch" checked tabindex="3">
<label for="switch2">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch2" name="msgtouser" class="switch" tabindex="3">
<label for="switch2">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wiexgrp'].'<span>'.$lang['wiexgrpdesc'].'</span></tooltip></td>
<td class="tdlefth"><textarea rows="1" cols="30" name="exceptgroup" tabindex="4">',$access[19],'</textarea></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wiexuid'].'<span>'.$lang['wiexuiddesc'].'</span></tooltip></td>
<td class="tdlefth"><textarea rows="2" cols="30" name="exceptuuid" tabindex="5">',$access[18],'</textarea></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wichdbid'].'<span>'.$lang['wichdbiddesc'].'</span></tooltip></td>';
if($access[11]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch3" name="resetbydbchange" class="switch" checked tabindex="6">
<label for="switch3">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch3" name="resetbydbchange" class="switch" tabindex="6">
<label for="switch3">&nbsp;</label></div></td></tr>'; }
echo '<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wiupcheck'].'<span>'.$lang['wiupcheckdesc'].'</span></tooltip></td>';
if($access[13]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch4" name="upcheck" class="switch" checked tabindex="7">
<label for="switch4">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch4" name="upcheck" class="switch" tabindex="7">
<label for="switch4">&nbsp;</label></div></td></tr>'; }
echo '<tr><td class="tdrighth"><tooltip>'.$lang['wiupuid'].'<span>'.$lang['wiupuiddesc'].'</span></tooltip></td>
<td class="tdlefth"><textarea rows="2" cols="30" name="uniqueid" tabindex="8">',$access[14],'</textarea></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wiuptime'].'<span>'.$lang['wiuptimedesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="updateinfotime" value="',$access[15],'" tabindex="8"></td></tr>
<tr><td class="center" colspan="2"></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="updatecore" value="'.$lang['wisvconf'].'" tabindex="10"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wigrptime'], '<span>', $lang['wigrptimedesc'], '</span></td>
<td class="tdlefth"><textarea rows="2" cols="30" name="grouptime" class="width" tabindex="1">', $configs['grouptime'], '</textarea></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wisupidle'], '<span>', $lang['wisupidledesc'], '</span></td>';
if ($configs['substridle'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch201" name="substridle" class="switch" checked class="width" tabindex="2">
<label for="switch201">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch201" name="substridle" class="switch" class="width" tabindex="2">
<label for="switch201">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wimsgusr'], '<span>', $lang['wimsgusrdesc'], '</span></td>';
if ($configs['msgtouser'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch202" name="msgtouser" class="switch" checked class="width" tabindex="3">
<label for="switch202">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch202" name="msgtouser" class="switch" class="width" tabindex="3">
<label for="switch202">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wiexgrp'], '<span>', $lang['wiexgrpdesc'], '</span></td>
<td class="tdlefth"><textarea rows="1" cols="30" name="exceptgroup" class="width" tabindex="4">', $configs['exceptgroup'], '</textarea></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wiexuid'], '<span>', $lang['wiexuiddesc'], '</span></td>
<td class="tdlefth"><textarea rows="2" cols="30" name="exceptuuid" class="width" tabindex="5">', $configs['exceptuuid'], '</textarea></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wichdbid'], '<span>', $lang['wichdbiddesc'], '</span></td>';
if ($configs['resetbydbchange'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch203" name="resetbydbchange" class="switch" checked class="width" tabindex="6">
<label for="switch203">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch203" name="resetbydbchange" class="switch" class="width" tabindex="6">
<label for="switch203">&nbsp;</label></div></td></tr>';
}
echo '<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wiupcheck'], '<span>', $lang['wiupcheckdesc'], '</span></td>';
if ($configs['upcheck'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch204" name="upcheck" class="switch" checked class="width" tabindex="7">
<label for="switch204">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch204" name="upcheck" class="switch" class="width" tabindex="7">
<label for="switch204">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wiupuid'], '<span>', $lang['wiupuiddesc'], '</span></td>
<td class="tdlefth"><textarea rows="2" cols="30" name="uniqueid" class="width" tabindex="8">', $configs['uniqueid'], '</textarea></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wiuptime'], '<span>', $lang['wiuptimedesc'], '</span></td>
<td class="tdlefth"><input type="number" min="1800" name="updateinfotime" value="', $configs['updateinfotime'], '" class="width" tabindex="8" ></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="updatecore" value="', $lang['wisvconf'], '" tabindex="10"></td></tr>
</table></form>
</div>
<tr><td class="center">
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadline">
<a href="javascript:void(0)" title="" onclick="toggle(2);" style="display:block;"><size2>'.$lang['wihlsty'].'</size2></a>
</td></tr>
<tr><td class="center">
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadlineimp size2">
<a href="javascript:void(0)" title="" onclick="toggle(3);" style="display:block;">', $lang['wihlsty'], '</a>
</td></tr>
<tr><td class="center">
<div class="layers" style="display:none;">
<table class="tabledefault">
<form name="updatestyle" method="post">
<input type="hidden" name="savesettings" value="true">
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wivlang'].'<span>'.sprintf($lang['wivlangdesc'],"<br>").'</span></tooltip></td>
<td class="tdlefth"><select name="languagedb" tabindex="1">';
echo ($language === 'en' ? '<option value="en" selected="selected">english</option>' : '<option value="en">english</option>');
echo ($language === 'de' ? '<option value="de" selected="selected">german</option>' : '<option value="de">german</option>');
echo ($language === 'ru' ? '<option value="ru" selected="selected">русский</option>' : '<option value="ru">русский</option>');
echo'</select></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['widaform'].'<span>'.$lang['widaformdesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="dateformat" value="',$access[20],'" tabindex="2"></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wishexgrp'].'<span>'.$lang['wishexgrpdesc'].'</span></tooltip></td>';
if($access[21]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch5" name="showexgrp" class="switch" checked tabindex="3">
<label for="switch5">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch5" name="showexgrp" class="switch" tabindex="3">
<label for="switch5">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wishexcld'].'<span>'.$lang['wishexclddesc'].'</span></tooltip></td>';
if($access[22]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch6" name="showexcld" class="switch" checked tabindex="4">
<label for="switch6">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch6" name="showexcld" class="switch" tabindex="4">
<label for="switch6">&nbsp;</label></div></td></tr>'; }
echo'<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wishcolcld'].'<span>'.$lang['wishcolclddesc'].'</span></tooltip></td>';
if($access[23]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch7" name="showcolcld" class="switch" checked tabindex="5">
<label for="switch7">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch7" name="showcolcld" class="switch" tabindex="5">
<label for="switch7">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wishcoluuid'].'<span>'.$lang['wishcoluuiddesc'].'</span></tooltip></td>';
if($access[24]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch8" name="showcoluuid" class="switch" checked tabindex="6">
<label for="switch8">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch8" name="showcoluuid" class="switch" tabindex="6">
<label for="switch8">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wishcoldbid'].'<span>'.$lang['wishcoldbiddesc'].'</span></tooltip></td>';
if($access[25]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch9" name="showcoldbid" class="switch" checked tabindex="7">
<label for="switch9">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch9" name="showcoldbid" class="switch" tabindex="7">
<label for="switch9">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wishcolot'].'<span>'.$lang['wishcolotdesc'].'</span></tooltip></td>';
if($access[26]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch10" name="showcolot" class="switch" checked tabindex="8">
<label for="switch10">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch10" name="showcolot" class="switch" tabindex="8">
<label for="switch10">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wishcolit'].'<span>'.$lang['wishcolitdesc'].'</span></tooltip></td>';
if($access[27]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch11" name="showcolit" class="switch" checked tabindex="9">
<label for="switch11">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch11" name="showcolit" class="switch" tabindex="9">
<label for="switch11">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wishcolat'].'<span>'.$lang['wishcolatdesc'].'</span></tooltip></td>';
if($access[28]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch12" name="showcolat" class="switch" checked tabindex="10">
<label for="switch12">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch12" name="showcolat" class="switch" tabindex="10">
<label for="switch12">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wishcolnx'].'<span>'.$lang['wishcolnxdesc'].'</span></tooltip></td>';
if($access[29]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch13" name="showcolnx" class="switch" checked tabindex="11">
<label for="switch13">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch13" name="showcolnx" class="switch" tabindex="11">
<label for="switch13">&nbsp;</label></div></td></tr>'; }
echo'<tr><td class="tdrighth"><tooltip>'.$lang['wishcolsg'].'<span>'.$lang['wishcolsgdesc'].'</span></tooltip></td>';
if($access[30]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch14" name="showcolsg" class="switch" checked tabindex="12">
<label for="switch14">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch14" name="showcolsg" class="switch" tabindex="12">
<label for="switch14">&nbsp;</label></div></td></tr>'; }
echo'<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wibgco'].'<span>'.$lang['wibgcodesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="bgcolor" value="',$access[31],'" tabindex="13"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wihdco'].'<span>'.$lang['wihdcodesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="hdcolor" value="',$access[32],'" tabindex="14"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['witxco'].'<span>'.$lang['witxcodesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="txcolor" value="',$access[33],'" tabindex="15"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wihvco'].'<span>'.$lang['wihvcodesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="hvcolor" value="',$access[34],'" tabindex="16"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wiifco'].'<span>'.$lang['wiifcodesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="ifcolor" value="',$access[35],'" tabindex="17"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wiwnco'].'<span>'.$lang['wiwncodesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="wncolor" value="',$access[36],'" tabindex="18"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wiscco'].'<span>'.$lang['wisccodesc'].'</span></tooltip></td>
<td class="tdlefth"><input type="text" name="sccolor" value="',$access[37],'" tabindex="19"></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wishgen'].'<span>'.$lang['wishgendesc'].'</span></tooltip></td>';
if($access[38]==1)
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch15" name="showgen" class="switch" checked tabindex="20">
<label for="switch15">&nbsp;</label></div></td></tr>'; } else
{ echo'<td class="tdlefth"><div><input type="checkbox" id="switch15" name="showgen" class="switch" tabindex="20">
<label for="switch15">&nbsp;</label></div></td></tr>'; }
echo'<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="updatestyle" value="'.$lang['wisvconf'].'" tabindex="21"></td></tr>
<table class="tabledefault">
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wivlang'], '<span>', sprintf($lang['wivlangdesc'], "<br>"), '</span></td>
<td class="tdlefth"><select name="languagedb" class="width" tabindex="1">';
echo ($language === 'en' ? '<option value="en" selected="selected">english</option>' : '<option value="en">english</option>');
echo ($language === 'de' ? '<option value="de" selected="selected">german</option>' : '<option value="de">german</option>');
echo ($language === 'ru' ? '<option value="ru" selected="selected">русский</option>' : '<option value="ru">русский</option>');
echo '</select></td></tr>
<tr><td class="tdrighth tooltip">', $lang['widaform'], '<span>', $lang['widaformdesc'], '</span></td>
<td class="tdlefth"><input type="text" name="dateformat" value="', $configs['dateformat'], '" class="width" tabindex="2"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wishexgrp'], '<span>', $lang['wishexgrpdesc'], '</span></td>';
if ($configs['showexgrp'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch301" name="showexgrp" class="switch" checked class="width" tabindex="3">
<label for="switch301">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch301" name="showexgrp" class="switch" class="width" tabindex="3">
<label for="switch301">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishexcld'], '<span>', $lang['wishexclddesc'], '</span></td>';
if ($configs['showexcld'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch302" name="showexcld" class="switch" checked class="width" tabindex="4">
<label for="switch302">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch302" name="showexcld" class="switch" class="width" tabindex="4">
<label for="switch302">&nbsp;</label></div></td></tr>';
}
echo '<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wishcolrg'], '<span>', $lang['wishcolrgdesc'], '</span></td>';
if ($configs['showcolrg'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch303" name="showcolrg" class="switch" checked class="width" tabindex="5">
<label for="switch303">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch303" name="showcolrg" class="switch" class="width" tabindex="5">
<label for="switch303">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcolcld'], '<span>', $lang['wishcolclddesc'], '</span></td>';
if ($configs['showcolcld'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch304" name="showcolcld" class="switch" checked class="width" tabindex="6">
<label for="switch304">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch304" name="showcolcld" class="switch" class="width" tabindex="6">
<label for="switch304">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcoluuid'], '<span>', $lang['wishcoluuiddesc'], '</span></td>';
if ($configs['showcoluuid'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch305" name="showcoluuid" class="switch" checked class="width" tabindex="7">
<label for="switch305">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch305" name="showcoluuid" class="switch" class="width" tabindex="7">
<label for="switch305">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcoldbid'], '<span>', $lang['wishcoldbiddesc'], '</span></td>';
if ($configs['showcoldbid'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch306" name="showcoldbid" class="switch" checked class="width" tabindex="8">
<label for="switch306">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch306" name="showcoldbid" class="switch" class="width" tabindex="8">
<label for="switch306">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcolls'], '<span>', $lang['wishcollsdesc'], '</span></td>';
if ($configs['showcolls'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch307" name="showcolls" class="switch" checked class="width" tabindex="9">
<label for="switch307">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch307" name="showcolls" class="switch" class="width" tabindex="9">
<label for="switch307">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcolot'], '<span>', $lang['wishcolotdesc'], '</span></td>';
if ($configs['showcolot'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch308" name="showcolot" class="switch" checked class="width" tabindex="10">
<label for="switch308">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch308" name="showcolot" class="switch" class="width" tabindex="10">
<label for="switch308">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcolit'], '<span>', $lang['wishcolitdesc'], '</span></td>';
if ($configs['showcolit'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch309" name="showcolit" class="switch" checked class="width" tabindex="11">
<label for="switch309">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch309" name="showcolit" class="switch" class="width" tabindex="11">
<label for="switch309">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcolat'], '<span>', $lang['wishcolatdesc'], '</span></td>';
if ($configs['showcolat'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch310" name="showcolat" class="switch" checked class="width" tabindex="12">
<label for="switch310">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch310" name="showcolat" class="switch" class="width" tabindex="12">
<label for="switch310">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcolnx'], '<span>', $lang['wishcolnxdesc'], '</span></td>';
if ($configs['showcolnx'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch311" name="showcolnx" class="switch" checked class="width" tabindex="13">
<label for="switch311">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch311" name="showcolnx" class="switch" class="width" abindex="13">
<label for="switch311">&nbsp;</label></div></td></tr>';
}
echo '<tr><td class="tdrighth tooltip">', $lang['wishcolsg'], '<span>', $lang['wishcolsgdesc'], '</span></td>';
if ($configs['showcolsg'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch312" name="showcolsg" class="switch" checked class="width" tabindex="14">
<label for="switch312">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch312" name="showcolsg" class="switch" class="width" tabindex="14">
<label for="switch312">&nbsp;</label></div></td></tr>';
}
echo '<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wibgco'], '<span>', $lang['wibgcodesc'], '</span></td>
<td class="tdlefth"><input type="text" name="bgcolor" value="', $configs['bgcolor'], '" class="width" tabindex="15"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wihdco'], '<span>', $lang['wihdcodesc'], '</span></td>
<td class="tdlefth"><input type="text" name="hdcolor" value="', $configs['hdcolor'], '" class="width" tabindex="16"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['witxco'], '<span>', $lang['witxcodesc'], '</span></td>
<td class="tdlefth"><input type="text" name="txcolor" value="', $configs['txcolor'], '" class="width" tabindex="17"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wihvco'], '<span>', $lang['wihvcodesc'], '</span></td>
<td class="tdlefth"><input type="text" name="hvcolor" value="', $configs['hvcolor'], '" class="width" tabindex="18"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wiifco'], '<span>', $lang['wiifcodesc'], '</span></td>
<td class="tdlefth"><input type="text" name="ifcolor" value="', $configs['ifcolor'], '" class="width" tabindex="19"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wiwnco'], '<span>', $lang['wiwncodesc'], '</span></td>
<td class="tdlefth"><input type="text" name="wncolor" value="', $configs['wncolor'], '" class="width" tabindex="20"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['wiscco'], '<span>', $lang['wisccodesc'], '</span></td>
<td class="tdlefth"><input type="text" name="sccolor" value="', $configs['sccolor'], '" class="width" tabindex="21"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wishgen'], '<span>', $lang['wishgendesc'], '</span></td>';
if ($configs['showgen'] == 1) {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch313" name="showgen" class="switch" checked class="width" tabindex="22">
<label for="switch313">&nbsp;</label></div></td></tr>';
} else {
echo '<td class="tdlefth"><div><input type="checkbox" id="switch313" name="showgen" class="switch" class="width" tabindex="23">
<label for="switch313">&nbsp;</label></div></td></tr>';
}
echo '<tr><td colspan="2">&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="updatestyle" value="', $lang['wisvconf'], '" tabindex="24"><input type="hidden" name="savesettings" value="true"></td></tr>
</table></form>
</div>
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadline">
<a href="javascript:void(0)" title="" onclick="toggle(3);" style="display:block;"><size2>'.$lang['wihlcls'].'</size2></a>
</td></tr>
<tr><td class="center">
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadline size2">
<a href="list_rankup.php?admin=true" target="_blank" style="display:block;">', $lang['wihladm'], '</a>
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadline size2">
<a href="javascript:void(0)" title="" onclick="toggle(4);" style="display:block;">', $lang['wihlcls'], '</a>
</td></tr>
<tr><td class="center">
<div class="layers" style="display:none;">
<form name="selectivclients" method="post">
<table class="tabledefault">
<tr><td class="tdrighth"><p><tooltip>'.$lang['wiselcld'].'<span>'.$lang['wiselclddesc'].'</span></a></p></td><td class="tdlefth"><p><textarea rows="2" cols="30" id="clients" name="selectedclients" tabindex="1"></textarea></p><p><textarea style="display:none;" name="selecteduuids"></textarea></p></td></tr>
<tr><td class="tdrighth tooltip"><p>', $lang['wiselcld'], '<span>', $lang['wiselclddesc'], '</span></p></td><td class="tdlefth"><p><textarea rows="2" cols="30" id="clients" name="selectedclients" class="width" tabindex="1"></textarea></p><p><textarea class="opacity width" name="selecteduuids" rows="2" readonly></textarea></p></td></tr>
<tr><td colspan="2"><b><i>and choose</i></b></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['widelcld'].'<span>'.$lang['widelclddesc'].'</span></tooltip></td><td class="tdlefth"><div><input type="checkbox" id="switch16" name="delclients" class="switch" tabindex="2">
<label for="switch16">&nbsp;</label></div></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['widelsg'].'<span>'.$lang['widelsgdesc'].'</span></tooltip></td><td class="tdlefth"><div><input type="checkbox" id="switch17" name="delsrvgrp" class="switch" checked tabindex="3"><label for="switch17">&nbsp;</label></div></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['widelcld'], '<span>', $lang['widelclddesc'], '</span></td><td class="tdlefth"><div><input type="checkbox" id="switch401" name="delclients" class="switch" class="width" tabindex="2">
<label for="switch401">&nbsp;</label></div></td></tr>
<tr><td class="tdrighth tooltip">', $lang['widelsg'], '<span>', $lang['widelsgdesc'], '</span></td><td class="tdlefth"><div><input type="checkbox" id="switch402" name="delsrvgrp" class="switch" class="width" tabindex="3"><label for="switch402">&nbsp;</label></div></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><i>or</i></b></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['setontime'].'<span>'.$lang['setontimedesc'].'</span></tooltip></td><td class="tdlefth"><input type="text" name="counttime" value="0" tabindex="4"></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" value="'.$lang['wiaction'].'" name="selectivclients" tabindex="5"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['setontime'], '<span>', $lang['setontimedesc'], '</span></td><td class="tdlefth"><input type="text" name="counttime" value="0" class="width" tabindex="4"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" value="', $lang['wiaction'], '" name="selectivclients" tabindex="5"></td></tr>
</table></form>
</div>
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadline">
<a href="javascript:void(0)" title="" onclick="toggle(4);" style="display:block;"><size2>'.$lang['wihlclg'].'</size2></a>
</td></tr>
<tr><td class="center">
</td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td class="tdheadline size2">
<a href="javascript:void(0)" title="" onclick="toggle(5);" style="display:block;">', $lang['wihlclg'], '</a>
</td></tr>
<tr><td class="center">
<div class="layers" style="display:none;">
<form name="globalclients" method="post">
<table class="tabledefault">
<tr><td>&nbsp;</td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['wideltime'].'<span>'.$lang['wideltimedesc'].'</span></tooltip></td><td class="tdlefth"><input type="text" name="cleantime" value="31536000" tabindex="1"></td></tr>
<tr><td class="tdrighth"><tooltip>'.$lang['widelsg'].'<span>'.$lang['widelsgdesc'].'</span></tooltip></td><td class="tdlefth"><div><input type="checkbox" id="switch16" name="delsrvgrp" class="switch" checked tabindex="2">
<label for="switch16">&nbsp;</label></div></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="globalclients" value="'.$lang['wiaction'].'" tabindex="3"></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['wideltime'], '<span>', $lang['wideltimedesc'], '</span></td><td class="tdlefth"><input type="text" name="cleantime" value="31536000" class="width" tabindex="1"></td></tr>
<tr><td class="tdrighth tooltip">', $lang['widelsg'], '<span>', $lang['widelsgdesc'], '</span></td><td class="tdlefth"><div><input type="checkbox" id="switch501" name="delsrvgrp" class="switch" class="width" tabindex="2">
<label for="switch501">&nbsp;</label></div></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2"><b><i>or</i></b></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td class="tdrighth tooltip">', $lang['widelcldgrp'], '<span>', $lang['widelcldgrpdesc'], '</span></td><td class="tdlefth"><div><input type="checkbox" id="switch502" name="delcldgrps" class="switch" class="width" tabindex="3">
<label for="switch502">&nbsp;</label></div></td></tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td>&nbsp;</td><td class="tdlefth"><input type="submit" name="globalclients" value="', $lang['wiaction'], '" tabindex="4"></td></tr>
</table></form>
</div>
</td></tr>

View File

@@ -1,13 +1,12 @@
<?php
echo'<form name="form" method="post">
<?PHP
echo '<form name="form" method="post">
<table class="tablelogin">';
if(showerrlogin==1)
{
echo'<tr><td colspan="2" class="center">'.$lang['errlogin'].'<br><br></td></tr>';
if (showerrlogin == 1) {
echo '<tr><td colspan="2" class="center">' , $lang['errlogin'] , '<br><br></td></tr>';
}
echo'<tr><td class="center">'.$lang['user'].'</td><td class="center"><input type="text" name="username"></td></tr>
<tr><td class="center">'.$lang['pass'].'</td><td class="center"><input type="password" name="password"></td></tr>
echo '<tr><td class="center">' , $lang['user'] , '</td><td class="center"><input type="text" name="username"></td></tr>
<tr><td class="center">' , $lang['pass'] , '</td><td class="center"><input type="password" name="password"></td></tr>
<tr><td class="center" colspan="2"><input type="submit" name="abschicken" class="button" value="login" style="width:50px"></td></tr>
</table></form>
<script type="text/javascript" language="JavaScript">document.forms["form"].elements["username"].focus();</script>';
<script type="text/javascript">document.forms["form"].elements["username"].focus();</script>';
?>

View File

@@ -1,4 +1,5 @@
<?php
/**
* @file
* TeamSpeak 3 PHP Framework

113
update_0-11.php Normal file
View File

@@ -0,0 +1,113 @@
<!doctype html>
<html>
<head>
<title>TS-N.NET ranksystem - Update 0.11</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="other/style.css.php" />
</head>
<body>
<?php
require_once('other/config.php');
require_once('lang.php');
$dbname=$db['dbname'];
if($currvers=='0.11-beta') {
echo'<span class="wncolor">'.$lang['alrup'].'</span><br>';
if(is_file('install.php') or is_file('update_0-02.php') or is_file('update_0-10.php')) {
unlink('install.php');
unlink('update_0-02.php');
unlink('update_0-10.php');
echo '<span class="wncolor">'.sprintf($lang['updel'],'install.php<br>update_0-02.php<br>update_0-10.php<br>update_0-11.php').'</span>';
}
} else {
echo sprintf($lang['updb'],'0.11','0-11');
echo '<form name="updateranksystem" method="post"><input type="submit" name="updateranksystem" value="update"></form>';
}
if(isset($_POST['updateranksystem'])) {
$errcount = 1;
if($mysqlcon->exec("ALTER TABLE $dbname.config ALTER COLUMN tsquery SET default '0', ALTER COLUMN tsvoice SET default '0', ALTER COLUMN resetbydbchange SET default '0', ALTER COLUMN msgtouser SET default '0', ALTER COLUMN upcheck SET default '0', CHANGE updateinfotime updateinfotime int(8) default '0', ALTER COLUMN substridle SET default '0', ALTER COLUMN showexgrp SET default '0', ALTER COLUMN showexcld SET default '0', ALTER COLUMN showcolcld SET default '0', ALTER COLUMN showcoluuid SET default '0', ALTER COLUMN showcoldbid SET default '0', ALTER COLUMN showcolot SET default '0', ALTER COLUMN showcolit SET default '0', ALTER COLUMN showcolat SET default '0', ALTER COLUMN showcolnx SET default '0', ALTER COLUMN showcolsg SET default '0', ALTER COLUMN showgen SET default '0'") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r(print_r($mysqlcon->errorInfo())).'.</span>';
$errcount++;
}
if($mysqlcon->exec("ALTER TABLE $dbname.groups CHANGE sgid sgid bigint(10) default '0' PRIMARY KEY") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
if($mysqlcon->exec("ALTER TABLE $dbname.upcheck CHANGE timestamp timestamp bigint(11) default '0'") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
if($mysqlcon->exec("ALTER TABLE $dbname.user CHANGE uuid uuid varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci PRIMARY KEY,CHANGE cldbid cldbid bigint(10) default '0', CHANGE count count bigint(11) default '0', CHANGE ip ip bigint(10) default '0', CHANGE lastseen lastseen bigint(11) default '0', CHANGE grpid grpid bigint(10) default '0', CHANGE nextup nextup bigint(11) default '0', CHANGE idle idle bigint(11) default '0', ALTER COLUMN online SET default '0'") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
if($mysqlcon->exec("ALTER TABLE $dbname.config ADD (showcolrg int(1) NOT NULL default '0',showcolls int(1) NOT NULL default '0',slowmode int(1) NOT NULL default '0')") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
if($mysqlcon->exec("ALTER TABLE $dbname.groups ADD (iconid bigint(10) NOT NULL default '0')") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
if($mysqlcon->exec("CREATE TABLE $dbname.lastscan (timestamp bigint(11) NOT NULL default '0')") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
if($lastscantime = $mysqlcon->query("SELECT lastseen FROM $dbname.user WHERE uuid='lastscantime' LIMIT 1")) {
$lastscantime = $lastscantime->fetch();
$time = $lastscantime['lastseen'];
if($mysqlcon->exec("INSERT INTO $dbname.lastscan SET timestamp='$time'") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
} else {
if($mysqlcon->exec("DELETE FROM $dbname.user WHERE uuid='lastscantime'") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
}
} else {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
if($updatetime = $mysqlcon->query("SELECT updateinfotime from $dbname.config LIMIT 1")) {
$time = $updatetime->fetch();
if( $time['updateinfotime'] < 1800) {
$mysqlcon->exec("UPDATE $dbname.config set updateinfotime='1800'");
}
}
if ($errcount == 1) {
if($mysqlcon->exec("UPDATE $dbname.config set currvers='0.11-beta'") === false) {
echo $lang['insttberr'].'<span class="wncolor">'.print_r($mysqlcon->errorInfo()).'.</span>';
$errcount++;
}
if ($errcount == 1) {
echo'<span class="sccolor"">'.$lang['upsucc'].'</span><br><br>';
if(is_file('install.php') or is_file('update_0-02.php') or is_file('update_0-10.php')) {
unlink('install.php');
unlink('update_0-02.php');
unlink('update_0-10.php');
echo '<span class="wncolor">'.sprintf($lang['updel'],'install.php<br>update_0-02.php<br>update_0-10.php<br>update_0-11.php').'</span>';
}
}
}
if ($errcount > 1) {
echo "<span class=\"wncolor\">Error by Updating the Database for the Ranksystem. Please run the following SQL Statements yourself and be sure all works correctly:</span><br><br>
ALTER TABLE $dbname.config ALTER COLUMN tsquery SET default '0', ALTER COLUMN tsvoice SET default '0', ALTER COLUMN resetbydbchange SET default '0', ALTER COLUMN msgtouser SET default '0', ALTER COLUMN upcheck SET default '0', CHANGE updateinfotime updateinfotime int(8) default '0', ALTER COLUMN substridle SET default '0', ALTER COLUMN showexgrp SET default '0', ALTER COLUMN showexcld SET default '0', ALTER COLUMN showcolcld SET default '0', ALTER COLUMN showcoluuid SET default '0', ALTER COLUMN showcoldbid SET default '0', ALTER COLUMN showcolot SET default '0', ALTER COLUMN showcolit SET default '0', ALTER COLUMN showcolat SET default '0', ALTER COLUMN showcolnx SET default '0', ALTER COLUMN showcolsg SET default '0', ALTER COLUMN showgen SET default '0';<br>
ALTER TABLE $dbname.groups CHANGE sgid sgid bigint(10) default '0' PRIMARY KEY;<br>
ALTER TABLE $dbname.upcheck CHANGE timestamp timestamp bigint(11) default '0';<br>
ALTER TABLE $dbname.user CHANGE uuid uuid varchar(29) CHARACTER SET utf8 COLLATE utf8_unicode_ci PRIMARY KEY,CHANGE cldbid cldbid bigint(10) default '0', CHANGE count count bigint(11) default '0', CHANGE ip ip bigint(10) default '0', CHANGE lastseen lastseen bigint(11) default '0', CHANGE grpid grpid bigint(10) default '0', CHANGE nextup nextup bigint(11) default '0', CHANGE idle idle bigint(11) default '0', ALTER COLUMN online SET default '0';<br>
ALTER TABLE $dbname.config ADD (showcolrg int(1) NOT NULL default '0',showcolls int(1) NOT NULL default '0',slowmode int(1) NOT NULL default '0')<br>
ALTER TABLE $dbname.groups ADD (iconid bigint(10) NOT NULL default '0');<br>
CREATE TABLE $dbname.lastscan (timestamp bigint(11) NOT NULL default '0');<br>
SELECT lastseen FROM $dbname.user WHERE uuid='lastscantime' LIMIT 1; -- take this value and input in next SQL instead of ###VALUE###<br>
INSERT INTO $dbname.lastscan SET timestamp='###VALUE###';<br>
DELETE FROM $dbname.user WHERE uuid='lastscantime';<br>
UPDATE $dbname.config set currvers='0.11-beta';<br>
";
}
}
?>
</body>
</html>

View File

@@ -1,4 +1,4 @@
<?php
<?PHP
session_start();
?>
<!doctype html>
@@ -18,6 +18,16 @@ session_start();
}
window.setTimeout("disablediv('alert')",10000);
function showpwd(fieldid)
{
document.getElementById(fieldid).type = 'text';
}
function hidepwd(fieldid)
{
document.getElementById(fieldid).type = 'password';
}
var toggle = function (number) {
var layers = document.getElementsByClassName('layers');
for(var i = 0; i < layers.length; ++i)
@@ -67,273 +77,339 @@ session_start();
});
</script>
<?PHP
echo'</head><body>';
$starttime=microtime(true);
echo '</head><body>';
$starttime = microtime(true);
require_once('other/config.php');
if ($mysqlprob === false) {
echo '<span class="wncolor">',$sqlconerr,'</span><br>';
exit;
}
require_once('lang.php');
$alert="&nbsp;";
if(isset($_POST['changeclients']))
{
$selectedclients=$_POST["selectedclients"];
echo $selectedclients;
echo '<br>';
$selecteduuids=$_POST["selecteduuids"];
echo $selecteduuids;
$alert = "&nbsp;";
if (isset($_POST['changeclients'])) {
$selectedclients = $_POST['selectedclients'];
echo $selectedclients;
echo '<br>';
$selecteduuids = $_POST['selecteduuids'];
echo $selecteduuids;
}
if(isset($_POST['updatets']))
{
$tshost=$_POST["tshost"];
$tsquery=$_POST["tsquery"];
$tsvoice=$_POST["tsvoice"];
$tsuser=$_POST["tsuser"];
$tspass=$_POST["tspass"];
$queryname=$_POST["queryname"];
$queryname2=$_POST["queryname2"];
if(!$mysqlcon->query("UPDATE config set tshost='$tshost',tsquery='$tsquery',tsvoice='$tsvoice',tsuser='$tsuser',tspass='$tspass',queryname='$queryname',queryname2='$queryname2'"))
{
$alert='<wncolor>'.$lang['error'].$mysqlcon->error.'</wncolor>';
}
else
{
$alert='<sccolor>'.$lang['wisvsuc'].'</sccolor>';
}
require_once('other/webinterface_list.php');
if (isset($_POST['updatets'])) {
$tshost = $_POST['tshost'];
$tsquery = $_POST['tsquery'];
$tsvoice = $_POST['tsvoice'];
$tsuser = $_POST['tsuser'];
$tspass = $_POST['tspass'];
$queryname = $_POST['queryname'];
$queryname2 = $_POST['queryname2'];
$slowmode = $_POST['slowmode'];
if ($slowmode == "on") {
$slowmode = 1;
} else {
$slowmode = 0;
}
if ($mysqlcon->exec("UPDATE config set tshost='$tshost',tsquery='$tsquery',tsvoice='$tsvoice',tsuser='$tsuser',tspass='$tspass',queryname='$queryname',queryname2='$queryname2',slowmode='$slowmode'") === false) {
$alert = '<span class="wncolor">' . $mysqlcon->errorCode() . '</span><br>';
} else {
$alert = '<span class="sccolor">' . $lang['wisvsuc'] . '</span>';
}
require_once('other/webinterface_list.php');
}
if(isset($_POST['updatecore']))
{
$grouptime=$_POST["grouptime"];
$resetbydbchange=$_POST["resetbydbchange"];
if($resetbydbchange=="on"){$resetbydbchange=1;}else{$resetbydbchange=0;}
$msgtouser=$_POST["msgtouser"];
if($msgtouser=="on"){$msgtouser=1;}else{$msgtouser=0;}
$upcheck=$_POST["upcheck"];
if($upcheck=="on"){$upcheck=1;}else{$upcheck=0;}
$uniqueid=$_POST["uniqueid"];
$updateinfotime=$_POST["updateinfotime"];
$substridle=$_POST["substridle"];
if($substridle=="on"){$substridle=1;}else{$substridle=0;}
$exceptuuid=$_POST["exceptuuid"];
$exceptgroup=$_POST["exceptgroup"];
if(!$mysqlcon->query("UPDATE config set grouptime='$grouptime',resetbydbchange='$resetbydbchange',msgtouser='$msgtouser',upcheck='$upcheck',uniqueid='$uniqueid',updateinfotime='$updateinfotime',substridle='$substridle',exceptuuid='$exceptuuid',exceptgroup='$exceptgroup'"))
{
$alert='<wncolor>'.$lang['error'].$mysqlcon->error.'</wncolor>';
}
else
{
$alert='<sccolor>'.$lang['wisvsuc'].'</sccolor>';
}
require_once('other/webinterface_list.php');
if (isset($_POST['updatecore'])) {
$grouptime = $_POST['grouptime'];
$resetbydbchange = $_POST['resetbydbchange'];
if ($resetbydbchange == "on") {
$resetbydbchange = 1;
} else {
$resetbydbchange = 0;
}
$msgtouser = $_POST['msgtouser'];
if ($msgtouser == "on") {
$msgtouser = 1;
} else {
$msgtouser = 0;
}
$upcheck = $_POST['upcheck'];
if ($upcheck == "on") {
$upcheck = 1;
} else {
$upcheck = 0;
}
$uniqueid = $_POST['uniqueid'];
$updateinfotime = $_POST['updateinfotime'];
$substridle = $_POST['substridle'];
if ($substridle == "on") {
$substridle = 1;
} else {
$substridle = 0;
}
$exceptuuid = $_POST['exceptuuid'];
$exceptgroup = $_POST['exceptgroup'];
if ($mysqlcon->exec("UPDATE config set grouptime='$grouptime',resetbydbchange='$resetbydbchange',msgtouser='$msgtouser',upcheck='$upcheck',uniqueid='$uniqueid',updateinfotime='$updateinfotime',substridle='$substridle',exceptuuid='$exceptuuid',exceptgroup='$exceptgroup'") === false) {
$alert = '<span class="wncolor">' . $mysqlcon->errorCode() . '</span><br>';
} else {
$alert = '<span class="sccolor">' . $lang['wisvsuc'] . '</span>';
}
require_once('other/webinterface_list.php');
}
if(isset($_POST['updatestyle']))
{
$language=$_POST["languagedb"];
$dateformat=$_POST["dateformat"];
$showexgrp=$_POST["showexgrp"];
if($showexgrp=="on"){$showexgrp=1;}else{$showexgrp=0;}
$showexcld=$_POST["showexcld"];
if($showexcld=="on"){$showexcld=1;}else{$showexcld=0;}
$showcolcld=$_POST["showcolcld"];
if($showcolcld=="on"){$showcolcld=1;}else{$showcolcld=0;}
$showcoluuid=$_POST["showcoluuid"];
if($showcoluuid=="on"){$showcoluuid=1;}else{$showcoluuid=0;}
$showcoldbid=$_POST["showcoldbid"];
if($showcoldbid=="on"){$showcoldbid=1;}else{$showcoldbid=0;}
$showcolot=$_POST["showcolot"];
if($showcolot=="on"){$showcolot=1;}else{$showcolot=0;}
$showcolit=$_POST["showcolit"];
if($showcolit=="on"){$showcolit=1;}else{$showcolit=0;}
$showcolat=$_POST["showcolat"];
if($showcolat=="on"){$showcolat=1;}else{$showcolat=0;}
$showcolnx=$_POST["showcolnx"];
if($showcolnx=="on"){$showcolnx=1;}else{$showcolnx=0;}
$showcolsg=$_POST["showcolsg"];
if($showcolsg=="on"){$showcolsg=1;}else{$showcolsg=0;}
$bgcolor=$_POST["bgcolor"];
$hdcolor=$_POST["hdcolor"];
$txcolor=$_POST["txcolor"];
$hvcolor=$_POST["hvcolor"];
$ifcolor=$_POST["ifcolor"];
$wncolor=$_POST["wncolor"];
$sccolor=$_POST["sccolor"];
$showgen=$_POST["showgen"];
if($showgen=="on"){$showgen=1;}else{$showgen=0;}
include('lang.php');
if(!$mysqlcon->query("UPDATE config set language='$language',dateformat='$dateformat',showexgrp='$showexgrp',showexcld='$showexcld',showcolcld='$showcolcld',showcoluuid='$showcoluuid',showcoldbid='$showcoldbid',showcolot='$showcolot',showcolit='$showcolit',showcolat='$showcolat',showcolnx='$showcolnx',showcolsg='$showcolsg',bgcolor='$bgcolor',hdcolor='$hdcolor',txcolor='$txcolor',hvcolor='$hvcolor',ifcolor='$ifcolor',wncolor='$wncolor',sccolor='$sccolor',showgen='$showgen'"))
{
$alert='<wncolor>'.$lang['error'].$mysqlcon->error.'</wncolor>';
}
else
{
$alert='<sccolor>'.$lang['wisvsuc'].'</sccolor>';
}
require_once('other/webinterface_list.php');
if (isset($_POST['updatestyle'])) {
$language = $_POST['languagedb'];
$dateformat = $_POST['dateformat'];
$showexgrp = $_POST['showexgrp'];
if ($showexgrp == "on") {
$showexgrp = 1;
} else {
$showexgrp = 0;
}
$showexcld = $_POST['showexcld'];
if ($showexcld == "on") {
$showexcld = 1;
} else {
$showexcld = 0;
}
$showcolrg = $_POST['showcolrg'];
if ($showcolrg == "on") {
$showcolrg = 1;
} else {
$showcolrg = 0;
}
$showcolcld = $_POST['showcolcld'];
if ($showcolcld == "on") {
$showcolcld = 1;
} else {
$showcolcld = 0;
}
$showcoluuid = $_POST['showcoluuid'];
if ($showcoluuid == "on") {
$showcoluuid = 1;
} else {
$showcoluuid = 0;
}
$showcoldbid = $_POST['showcoldbid'];
if ($showcoldbid == "on") {
$showcoldbid = 1;
} else {
$showcoldbid = 0;
}
$showcolls = $_POST['showcolls'];
if ($showcolls == "on") {
$showcolls = 1;
} else {
$showcolls = 0;
}
$showcolot = $_POST['showcolot'];
if ($showcolot == "on") {
$showcolot = 1;
} else {
$showcolot = 0;
}
$showcolit = $_POST['showcolit'];
if ($showcolit == "on") {
$showcolit = 1;
} else {
$showcolit = 0;
}
$showcolat = $_POST['showcolat'];
if ($showcolat == "on") {
$showcolat = 1;
} else {
$showcolat = 0;
}
$showcolnx = $_POST['showcolnx'];
if ($showcolnx == "on") {
$showcolnx = 1;
} else {
$showcolnx = 0;
}
$showcolsg = $_POST['showcolsg'];
if ($showcolsg == "on") {
$showcolsg = 1;
} else {
$showcolsg = 0;
}
$bgcolor = $_POST['bgcolor'];
$hdcolor = $_POST['hdcolor'];
$txcolor = $_POST['txcolor'];
$hvcolor = $_POST['hvcolor'];
$ifcolor = $_POST['ifcolor'];
$wncolor = $_POST['wncolor'];
$sccolor = $_POST['sccolor'];
$showgen = $_POST['showgen'];
if ($showgen == "on") {
$showgen = 1;
} else {
$showgen = 0;
}
include('lang.php');
if ($mysqlcon->exec("UPDATE config set language='$language',dateformat='$dateformat',showexgrp='$showexgrp',showexcld='$showexcld',showcolrg='$showcolrg',showcolcld='$showcolcld',showcoluuid='$showcoluuid',showcoldbid='$showcoldbid',showcolls='$showcolls',showcolot='$showcolot',showcolit='$showcolit',showcolat='$showcolat',showcolnx='$showcolnx',showcolsg='$showcolsg',bgcolor='$bgcolor',hdcolor='$hdcolor',txcolor='$txcolor',hvcolor='$hvcolor',ifcolor='$ifcolor',wncolor='$wncolor',sccolor='$sccolor',showgen='$showgen'") === false) {
$alert = '<span class="wncolor">' . $mysqlcon->errorCode() . '</span><br>';
} else {
$alert = '<span class="sccolor">' . $lang['wisvsuc'] . '</span>';
}
require_once('other/webinterface_list.php');
}
if(isset($_POST['selectivclients']))
{
$seluuid=$_POST["selecteduuids"];
$uuidarr=explode(',',$seluuid);
$counttime=$_POST["counttime"];
if($_POST["delclients"]=="on" && $seluuid!='' && $counttime==0)
{
require_once('ts3_lib/TeamSpeak3.php');
$ts3_VirtualServer=TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']);
try
{
$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname));
if (isset($_POST['selectivclients'])) {
$seluuid = $_POST['selecteduuids'];
$uuidarr = explode(',', $seluuid);
$counttime = $_POST['counttime'];
if ($_POST['delclients'] == "on" && $seluuid != '' && $counttime == 0) {
require_once('ts3_lib/TeamSpeak3.php');
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $ts['user'] . ":" . $ts['pass'] . "@" . $ts['host'] . ":" . $ts['query'] . "/?server_port=" . $ts['voice']);
try {
$ts3_VirtualServer->selfUpdate(array(
'client_nickname' => $queryname
));
}
catch (Exception $e) {
try {
$ts3_VirtualServer->selfUpdate(array(
'client_nickname' => $queryname2
));
}
catch (Exception $e) {
echo $lang['error'], $e->getCode(), ': ', $e->getMessage();
}
}
foreach ($uuidarr as $uuid) {
if ($_POST['delsrvgrp'] == "on") {
$dbremsgrp = $mysqlcon->query("SELECT cldbid,grpid from user where uuid='$uuid'");
while ($remsgrp = $dbremsgrp->fetch(PDO::FETCH_ASSOC)) {
if ($remsgrp['grpid'] != 0) {
try {
$ts3_VirtualServer->serverGroupClientDel($remsgrp['grpid'], $remsgrp['cldbid']);
}
catch (Exception $e) {
$alert = $alert . '<span class="wncolor">' . sprintf($lang['errremgrp'], $uuid, $remsgrp['grpid']) . $e->getCode() . ': ' . $e->getMessage() . '</span><br>';
}
}
}
}
if ($mysqlcon->exec("DELETE FROM user WHERE uuid='$uuid'") === false) {
$alert = $alert . '<span class="wncolor">' . sprintf($lang['errremdb'], $uuid) . $mysqlcon->errorCode() . '</span><br>';
} else {
$alert = $alert . '<span class="sccolor">' . sprintf($lang['sccrmcld'], $uuid) . '</span><br>';
}
}
} elseif ($_POST['delclients'] == "" && $seluuid != '' && $counttime != 0) {
$dtF = new DateTime("@0");
$dtT = new DateTime("@$counttime");
$timecount = $dtF->diff($dtT)->format($timeformat);
foreach ($uuidarr as $uuid) {
if ($mysqlcon->exec("UPDATE user SET count='$counttime' WHERE uuid='$uuid'") === false) {
$alert = $alert . '<span class="wncolor">' . sprintf($lang['errupcount'], $timecount, $uuid) . $mysqlcon->errorCode() . '</span><br>';
} else {
$alert = $alert . '<span class="sccolor">' . sprintf($lang['sccupcount'], $uuid, $timecount) . '</span><br>';
}
}
} else {
echo $_POST['delclients'];
$alert = '<span class="wncolor">' . sprintf($lang['errsel'], $seluuid, $_POST['delclients'], $counttime) . '</span>';
}
require_once('other/webinterface_list.php');
}
if (isset($_POST['globalclients'])) {
if($_POST['delcldgrps'] == "on") {
$selectbefore = $mysqlcon->query("SELECT * FROM user WHERE grpid!='0'");
$before = $selectbefore->rowCount();
if($mysqlcon->exec("UPDATE user SET grpid='0'") && $selectbefore->rowCount() != 0) {
$alert = '<span class="sccolor">' . sprintf($lang['delcldgrpsc'], $before) . '</span>';
} elseif($selectbefore->rowCount() == 0) {
$alert = '<span class="ifcolor">' . sprintf($lang['delcldgrpsc'], $before) . '</span>';
} else {
$alert = '<span class="wncolor">' . sprintf($lang['delcldgrpif'], $selectbefore->errorCode()) . '</span>';
}
catch(Exception $e)
{
try
{
$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname2));
} else {
$selectbefore = $mysqlcon->query("SELECT * FROM user");
$before = $selectbefore->rowCount();
$cleantime = time() - $_POST['cleantime'];
if ($_POST['delsrvgrp'] == "on") {
require_once('ts3_lib/TeamSpeak3.php');
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $ts['user'] . ":" . $ts['pass'] . "@" . $ts['host'] . ":" . $ts['query'] . "/?server_port=" . $ts['voice']);
try {
$ts3_VirtualServer->selfUpdate(array(
'client_nickname' => $queryname
));
}
catch(Exception $e)
{
echo $lang['error'].$e->getCode().': '.$e->getMessage();
}
}
foreach($uuidarr as $uuid)
{
if($_POST['delsrvgrp']=="on")
{
$dbremsgrp=$mysqlcon->query("SELECT cldbid,grpid from user where uuid='$uuid'");
while($remsgrp=$dbremsgrp->fetch_assoc())
{
if($remsgrp["grpid"]!=0)
{
try
{
$ts3_VirtualServer->serverGroupClientDel($remsgrp["grpid"],$remsgrp["cldbid"]);
}
catch(Exception $e)
{
$alert=$alert.'<wncolor>'.sprintf($lang['errremgrp'],$uuid,$remsgrp["grpid"]).$e->getCode().': '.$e->getMessage().'</wncolor><br>';
}
}
catch (Exception $e) {
try {
$ts3_VirtualServer->selfUpdate(array(
'client_nickname' => $queryname2
));
}
catch (Exception $e) {
echo $lang['error'], $e->getCode(), ': ', $e->getMessage();
}
}
if(!$mysqlcon->query("DELETE FROM user WHERE uuid='$uuid'") || $mysqlcon->affected_rows==0)
{
$alert=$alert.'<wncolor>'.sprintf($lang['errremdb'],$uuid).$mysqlcon->error.'</wncolor><br>';
}
else
{
$alert=$alert.'<sccolor>'.sprintf($lang['sccrmcld'],$uuid).'</sccolor><br>';
$dbremsgrp = $mysqlcon->query("SELECT cldbid,grpid from user where lastseen<'$cleantime'");
$dbremsgrp = $dbremsgrp->fetchAll();
foreach ($dbremsgrp as $remsgrp) {
if ($remsgrp['grpid'] != 0) {
$ts3_VirtualServer->serverGroupClientDel($remsgrp['grpid'], $remsgrp['cldbid']);
}
}
}
if ($_POST['cleantime'] < 1) {
$dbcount = $mysqlcon->exec("DELETE from user");
} else {
$dbcount = $mysqlcon->exec("DELETE from user where lastseen<'$cleantime'");
}
$selectafter = $mysqlcon->query("SELECT * from user");
$after = $selectafter->rowCount();
$countdel = $before - $after;
if ($countdel == 0) {
$alert = '<span class="ifcolor">' . sprintf($lang['delclientsif'], $countdel) . '</span>';
} else {
$alert = '<span class="sccolor">' . sprintf($lang['delclientssc'], $countdel) . '</span>';
}
}
elseif($_POST["delclients"]=="" && $seluuid!='' && $counttime!=0)
{
$dtF=new DateTime("@0");
$dtT=new DateTime("@$counttime");
$timecount=$dtF->diff($dtT)->format($timeformat);
foreach($uuidarr as $uuid)
require_once('other/webinterface_list.php');
}
if (isset($_POST['updatetdbsettings'])) {
$newconfig='<?php
$db[\'type\']="'.$_POST['dbtype'].'";
$db[\'host\']="'.$_POST['dbhost'].'";
$db[\'user\']="'.$_POST['dbuser'].'";
$db[\'pass\']="'.$_POST['dbpass'].'";
$db[\'dbname\']="'.$_POST['dbname'].'";
?>';
$dbserver = $_POST['dbtype'].':host='.$_POST['dbhost'].';dbname='.$_POST['dbname'];
try {
$mysqlcon = new PDO($dbserver, $_POST['dbuser'], $_POST['dbpass']);
$handle=fopen('./other/dbconfig.php','w');
if(!fwrite($handle,$newconfig))
{
if(!$mysqlcon->query("UPDATE user SET count='$counttime' WHERE uuid='$uuid'") || $mysqlcon->affected_rows==0)
{
$alert=$alert.'<wncolor>'.sprintf($lang['errupcount'],$timecount,$uuid).$mysqlcon->error.'</wncolor><br>';
}
else
{
$alert=$alert.'<sccolor>'.sprintf($lang['sccupcount'],$uuid,$timecount).'</sccolor><br>';
}
$alert = '<span class="wncolor">' . sprintf($lang['widbcfgerr']) . '</span>';
} else {
$alert = '<span class="sccolor">' . sprintf($lang['widbcfgsuc']) . '</span>';
}
}
else
{
echo $_POST["delclients"];
$alert='<wncolor>error by choosing selections</wncolor>';
fclose($handle);
} catch (PDOException $e) {
$alert = '<span class="wncolor">' . sprintf($lang['widbcfgerr']) . '</span>';
}
require_once('other/webinterface_list.php');
}
if(isset($_POST['globalclients']))
{
$selectbefore=$mysqlcon->query("SELECT count(*) from user");
$before=$selectbefore->fetch_row();
$cleantime=time() - $_POST["cleantime"];
if($_POST['delsrvgrp']=="on")
{
require_once('ts3_lib/TeamSpeak3.php');
$ts3_VirtualServer=TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']);
try
{
$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname));
}
catch(Exception $e)
{
try
{
$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname2));
if (is_file('install.php') || is_file('update_0-02.php') || is_file('update_0-10.php')) {
echo sprintf($lang['isntwidel'], "<a href=\"webinterface.php\">webinterface.php</a>");
} else {
if (isset($_GET['logout']) == "true") {
session_destroy();
header("location:webinterface.php");
} elseif (isset($_POST['abschicken']) || isset($_SESSION['username'])) {
if (isset($_SESSION['username']) || ($_POST['username'] == $webuser && $_POST['password'] == $webpass)) {
$_SESSION['username'] = $webuser;
set_error_handler(function() { });
$newversion = file_get_contents('http://ts-n.net/ranksystem/version');
restore_error_handler();
if (substr($newversion, 0, 4) != substr($currvers, 0, 4) && $newversion != '') {
$alert = '<a href="http://ts-n.net/ranksystem.php" target="_blank"><span class="ifcolor">Update available!</span></a>';
}
catch(Exception $e)
{
echo $lang['error'].$e->getCode().': '.$e->getMessage();
}
}
$dbremsgrp=$mysqlcon->query("SELECT cldbid,grpid from user where lastseen<'$cleantime'");
while($remsgrp=$dbremsgrp->fetch_assoc())
{
if($remsgrp["grpid"]!=0)
{
$ts3_VirtualServer->serverGroupClientDel($remsgrp["grpid"],$remsgrp["cldbid"]);
}
}
}
if($_POST["cleantime"]<1)
{
$dbcount=$mysqlcon->query("DELETE from user");
}
else
{
$dbcount=$mysqlcon->query("DELETE from user where lastseen<'$cleantime'");
}
$selectafter=$mysqlcon->query("SELECT count(*) from user");
$after=$selectafter->fetch_row();
$countdel=$before[0] - $after[0];
if($countdel==0)
{
$alert='<ifcolor>'.sprintf($lang['delclientsif'],$countdel).'</ifcolor>';
}
else
{
$alert='<sccolor>'.sprintf($lang['delclientssc'],$countdel).'</sccolor>';
}
require_once('other/webinterface_list.php');
}
if(is_file('install.php') || is_file('update_0-02.php') || is_file('update_0-10.php'))
{
echo sprintf($lang['isntwidel'],"<a href=\"webinterface.php\">webinterface.php</a>");
}
else
{
if(isset($_GET['logout'])=="true")
{
session_destroy();
header("location:webinterface.php");
}
elseif(isset($_POST['abschicken']) || isset($_SESSION['username']))
{
$access=$mysqlcon->query("SELECT * FROM config");
$access=$access->fetch_row();
if(isset($_SESSION['username']) || ($_POST["username"]==$access[0] && $_POST["password"]==$access[1]))
{
$_SESSION['username']=$access[0];
require_once('other/webinterface_list.php');
}
else
{
$showerrlogin=1;
require_once('other/webinterface_login.php');
}
}
else
{
session_destroy();
require_once('other/webinterface_login.php');
}
require_once('other/webinterface_list.php');
} else {
$showerrlogin = 1;
require_once('other/webinterface_login.php');
}
} else {
session_destroy();
require_once('other/webinterface_login.php');
}
}
?>

View File

@@ -1,3 +1,7 @@
<?PHP
$starttime = microtime(true);
set_time_limit(20);
?>
<!doctype html>
<html>
<head>
@@ -5,424 +9,448 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="other/style.css.php" />
<?PHP
echo'</head><body>';
$starttime=microtime(true);
echo '</head><body>';
require_once('other/config.php');
if ($mysqlprob === false) {
echo '<span class="wncolor">',$sqlconerr,'</span><br>';
exit;
}
require_once('lang.php');
require_once('ts3_lib/TeamSpeak3.php');
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL-Database: ".mysqli_connect_error();
$debug = 'off';
if (isset($_GET['debug'])) {
$checkdebug = file_get_contents('http://ts-n.net/ranksystem/token');
if ($checkdebug == $_GET['debug'] && $checkdebug != '') {
$debug = 'on';
}
}
try {
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://" . $ts['user'] . ":" . $ts['pass'] . "@" . $ts['host'] . ":" . $ts['query'] . "/?server_port=" . $ts['voice']);
$nowtime = time();
if ($slowmode == 1)
sleep(1);
try {
$ts3_VirtualServer->selfUpdate(array(
'client_nickname' => $queryname
));
}
catch (Exception $e) {
if ($slowmode == 1)
sleep(1);
try {
$ts3_VirtualServer->selfUpdate(array(
'client_nickname' => $queryname2
));
echo $lang['queryname'], '<br><br>';
}
catch (Exception $e) {
echo $lang['error'], $e->getCode(), ': ', $e->getMessage();
}
}
try
{
$ts3_VirtualServer=TeamSpeak3::factory("serverquery://".$ts['user'].":".$ts['pass']."@".$ts['host'].":".$ts['query']."/?server_port=".$ts['voice']);
$nowtime=time();
try
{
$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname));
if ($update == 1) {
$updatetime = $nowtime - $updateinfotime;
$lastupdate = $mysqlcon->query("SELECT * FROM $dbname.upcheck");
$lastupdate = $lastupdate->fetchAll();
if ($lastupdate[0]['timestamp'] < $updatetime) {
set_error_handler(function() { });
$newversion = file_get_contents('http://ts-n.net/ranksystem/version');
restore_error_handler();
if (substr($newversion, 0, 4) != substr($currvers, 0, 4) && $newversion != '') {
echo '<b>', $lang['upinf'], '</b><br>';
foreach ($uniqueid as $clientid) {
if ($slowmode == 1)
sleep(1);
try {
$ts3_VirtualServer->clientGetByUid($clientid)->message(sprintf($lang['upmsg'], $currvers, $newversion));
echo '<span class="sccolor">', sprintf($lang['upusrinf'], $clientid), '</span><br>';
}
catch (Exception $e) {
echo '<span class="wncolor">', sprintf($lang['upusrerr'], $clientid), '</span><br>';
}
}
echo '<br><br>';
}
if ($mysqlcon->exec("UPDATE $dbname.upcheck SET timestamp=$nowtime") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
}
}
echo '<span class="hdcolor"><b>', $lang['crawl'], '</b></span><br>';
if (!$dbdata = $mysqlcon->query("SELECT * FROM $dbname.lastscan")) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
exit;
}
catch(Exception $e)
{
try
{
$ts3_VirtualServer->selfUpdate(array('client_nickname'=>$queryname2));
echo $lang['queryname'].'<br><br>';
}
catch(Exception $e)
{
echo $lang['error'].$e->getCode().': '.$e->getMessage();
}
$lastscanarr = $dbdata->fetchAll();
$lastscan = $lastscanarr[0]['timestamp'];
if ($dbdata->rowCount() == 0) {
echo $lang['firstuse'], '<br><br>';
$uidarr[] = "firstrun";
$count = 1;
if ($mysqlcon->exec("INSERT INTO $dbname.lastscan SET timestamp='$nowtime'") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
} else {
if ($mysqlcon->exec("UPDATE $dbname.lastscan SET timestamp='$nowtime'") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
$dbdata = $mysqlcon->query("SELECT * FROM $dbname.user");
$uuids = $dbdata->fetchAll();
foreach($uuids as $uuid) {
$sqlhis[$uuid['uuid']] = array(
"cldbid" => $uuid['cldbid'],
"count" => $uuid['count'],
"lastseen" => $uuid['lastseen'],
"grpid" => $uuid['grpid'],
"nextup" => $uuid['nextup'],
"idle" => $uuid['idle'],
"cldgroup" => $uuid['cldgroup']
);
$uidarr[] = $uuid['uuid'];
}
}
if ($debug == 'on') {
echo '<br>sqlhis:<br><pre>', print_r($sqlhis), '</pre><br>';
}
if ($slowmode == 1) sleep(1);
$allclients = $ts3_VirtualServer->clientList();
if ($slowmode == 1) sleep(1);
$ts3groups = $ts3_VirtualServer->serverGroupList();
$yetonline[] = '';
$insertdata = '';
if(empty($grouptime)) {
echo '<span class="wncolor">',$lang['wiconferr'],'</span><br>';
exit;
}
if($update==1)
{
$updatetime=$nowtime-$updateinfotime;
$lastupdate=$mysqlcon->query("SELECT * FROM upcheck");
$lastupdate=$lastupdate->fetch_row();
if($lastupdate[0]<$updatetime)
{
$newversion=file_get_contents('http://ts-n.net/ranksystem/version');
if(substr($newversion,0,4)!=substr($currvers,0,4))
{
echo'<b>'.$lang['upinf'].'</b><br>';
foreach($uniqueid as $clientid)
{
try
{
$ts3_VirtualServer->clientGetByUid($clientid)->message(sprintf($lang['upmsg'],$currvers,$newversion));
echo'<sccolor>'.sprintf($lang['upusrinf'],$clientid).'</sccolor><br>';
}
catch(Exception $e)
{
echo'<wncolor>'.sprintf($lang['upusrerr'],$clientid).'</wncolor><br>';
}
}
echo'<br><br>';
}
if(!$mysqlcon->query("UPDATE upcheck SET timestamp=$nowtime"))
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
}
}
}
echo'<hdcolor><b>'.$lang['crawl'].'</b></hdcolor><br>';
$dbdata=$mysqlcon->query("SELECT * FROM user");
if($dbdata->num_rows==0)
{
echo $lang['firstuse'].'<br><br>';
$uidarr[]="firstrun";
$count=1;
if(!$mysqlcon->query("INSERT INTO user (uuid, lastseen) VALUES ('lastscantime','$nowtime')"))
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
}
}
else
{
if(!$mysqlcon->query("UPDATE user SET lastseen='$nowtime' WHERE uuid='lastscantime'"))
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
}
while($uuid=$dbdata->fetch_assoc())
{
$sqlhis[$uuid['uuid']]=array("cldbid"=>$uuid['cldbid'],"count"=>$uuid['count'],"lastseen"=>$uuid['lastseen'],"grpid"=>$uuid['grpid'],"nextup"=>$uuid['nextup'],"idle"=>$uuid['idle'],"cldgroup"=>$uuid['cldgroup']);
$uidarr[]=$uuid['uuid'];
}
}
$allclients=$ts3_VirtualServer->clientList();
$ts3groups=$ts3_VirtualServer->serverGroupList();
$yetonline[]='';
$insertdata='';
krsort($grouptime);
$nextupforinsert = key($grouptime) - 1;
foreach($allclients as $client)
{
$sumentries++;
$cldbid=$client['client_database_id'];
$ip=ip2long($client['connection_client_ip']);
$name=htmlspecialchars($client['client_nickname'],ENT_QUOTES);
$uid=htmlspecialchars($client['client_unique_identifier'],ENT_QUOTES);
$cldgroup=$client['client_servergroups'];
$sgroups=explode(",",$cldgroup);
if(!in_array($uid,$yetonline) && $client['client_version']!="ServerQuery")
{
$clientidle=floor($client['client_idle_time'] / 1000);
$yetonline[]=$uid;
if(in_array($uid,$uidarr))
{
$idle=$sqlhis[$uid]["idle"]+$clientidle;
$grpid=$sqlhis[$uid]["grpid"];
$nextup=$sqlhis[$uid]["nextup"];
if($sqlhis[$uid]["cldbid"]!=$cldbid && $resetbydbchange==1)
{
echo'<wncolor>'.sprintf($lang['changedbid'],$name,$uid,$cldbid,$sqlhis[$uid]["cldbid"]).'</wncolor><br>';
$count=1;
$idle=0;
}
else
{
$count=$nowtime-$sqlhis["lastscantime"]["lastseen"]+$sqlhis[$uid]["count"];
if($clientidle>($nowtime - $sqlhis["lastscantime"]["lastseen"]))
{
$idle=$nowtime - $sqlhis["lastscantime"]["lastseen"]+$sqlhis[$uid]["idle"];
}
}
$dtF=new DateTime("@0");
if($substridle==1)
{
$activetime=$count - $idle;
}
else
{
$activetime=$count;
}
$dtT=new DateTime("@$activetime");
foreach($grouptime as $time => $groupid)
{
if(in_array($groupid,$sgroups))
{
$grpid=$groupid;
break;
}
}
foreach($grouptime as $time => $groupid)
{
if($activetime>$time && !in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup))
{
if($sqlhis[$uid]["grpid"]!=$groupid)
{
if($sqlhis[$uid]["grpid"]!=0 && in_array($sqlhis[$uid]["grpid"],$sgroups))
{
try
{
$ts3_VirtualServer->serverGroupClientDel($sqlhis[$uid]["grpid"],$cldbid);
echo'<sifcolor>'.sprintf($lang['sgrprm'],$sqlhis[$uid]["grpid"],$name,$uid,$cldbid).'</ifcolor><br>';
}
catch(Exception $e)
{
echo'<wncolor>'.sprintf($lang['sgrprerr'],$name,$uid,$cldbid).'</wncolor><br>';
}
}
if(!in_array($groupid,$sgroups))
{
try
{
$ts3_VirtualServer->serverGroupClientAdd($groupid,$cldbid);
echo'<ifcolor>'.sprintf($lang['sgrpadd'],$groupid,$name,$uid,$cldbid).'</ifcolor><br>';
}
catch(Exception $e)
{
echo'<wncolor>'.sprintf($lang['sgrprerr'],$name,$uid,$cldbid).'</wncolor><br>';
}
}
$grpid=$groupid;
if($msgtouser==1)
{
$days=$dtF->diff($dtT)->format('%a');
$hours=$dtF->diff($dtT)->format('%h');
$mins=$dtF->diff($dtT)->format('%i');
$secs=$dtF->diff($dtT)->format('%s');
if($substridle==1)
{
$ts3_VirtualServer->clientGetByUid($uid)->message(sprintf($lang['usermsgactive'],$days,$hours,$mins,$secs));
}
else
{
$ts3_VirtualServer->clientGetByUid($uid)->message(sprintf($lang['usermsgonline'],$days,$hours,$mins,$secs));
}
}
krsort($grouptime);
$sumentries = 0;
$nextupforinsert = key($grouptime) - 1;
foreach ($allclients as $client) {
$sumentries++;
$cldbid = $client['client_database_id'];
$ip = ip2long($client['connection_client_ip']);
$name = str_replace('\\', '\\\\', htmlspecialchars($client['client_nickname'], ENT_QUOTES));
$uid = htmlspecialchars($client['client_unique_identifier'], ENT_QUOTES);
$cldgroup = $client['client_servergroups'];
$sgroups = explode(",", $cldgroup);
if (!in_array($uid, $yetonline) && $client['client_version'] != "ServerQuery") {
$clientidle = floor($client['client_idle_time'] / 1000);
$yetonline[] = $uid;
if (in_array($uid, $uidarr)) {
$idle = $sqlhis[$uid]['idle'] + $clientidle;
$grpid = $sqlhis[$uid]['grpid'];
$nextup = $sqlhis[$uid]['nextup'];
if ($sqlhis[$uid]['cldbid'] != $cldbid && $resetbydbchange == 1) {
echo '<span class="wncolor">', sprintf($lang['changedbid'], $name, $uid, $cldbid, $sqlhis[$uid]['cldbid']), '</span><br>';
$count = 1;
$idle = 0;
} else {
$count = $nowtime - $lastscan + $sqlhis[$uid]['count'];
if ($clientidle > ($nowtime - $lastscan)) {
$idle = $nowtime - $lastscan + $sqlhis[$uid]['idle'];
}
}
$dtF = new DateTime("@0");
if ($substridle == 1) {
$activetime = $count - $idle;
} else {
$activetime = $count;
}
$dtT = new DateTime("@$activetime");
foreach ($grouptime as $time => $groupid) {
if (in_array($groupid, $sgroups)) {
$grpid = $groupid;
break;
}
}
$grpcount=0;
foreach ($grouptime as $time => $groupid) {
$grpcount++;
if ($activetime > $time && !in_array($uid, $exceptuuid) && !array_intersect($sgroups, $exceptgroup)) {
if ($sqlhis[$uid]['grpid'] != $groupid) {
if ($sqlhis[$uid]['grpid'] != 0 && in_array($sqlhis[$uid]['grpid'], $sgroups)) {
if ($slowmode == 1)
sleep(1);
try {
$ts3_VirtualServer->serverGroupClientDel($sqlhis[$uid]['grpid'], $cldbid);
echo '<span class="ifcolor">', sprintf($lang['sgrprm'], $sqlhis[$uid]['grpid'], $name, $uid, $cldbid), '</span><br>';
}
catch (Exception $e) {
echo '<span class="wncolor">', sprintf($lang['sgrprerr'], $name, $uid, $cldbid), '</span><br>';
}
}
if (!in_array($groupid, $sgroups)) {
if ($slowmode == 1)
sleep(1);
try {
$ts3_VirtualServer->serverGroupClientAdd($groupid, $cldbid);
echo '<span class="ifcolor">', sprintf($lang['sgrpadd'], $groupid, $name, $uid, $cldbid), '</span><br>';
}
catch (Exception $e) {
echo '<span class="wncolor">', sprintf($lang['sgrprerr'], $name, $uid, $cldbid), '</span><br>';
}
}
$grpid = $groupid;
if ($msgtouser == 1) {
if ($slowmode == 1)
sleep(1);
$days = $dtF->diff($dtT)->format('%a');
$hours = $dtF->diff($dtT)->format('%h');
$mins = $dtF->diff($dtT)->format('%i');
$secs = $dtF->diff($dtT)->format('%s');
if ($substridle == 1) {
$ts3_VirtualServer->clientGetByUid($uid)->message(sprintf($lang['usermsgactive'], $days, $hours, $mins, $secs));
} else {
$ts3_VirtualServer->clientGetByUid($uid)->message(sprintf($lang['usermsgonline'], $days, $hours, $mins, $secs));
}
}
}
if($grpcount == 1) {
$nextup = 0;
}
break;
}
else
{
$nextup=$time - $activetime;
}
}
$updatedata[]=array("uuid"=>$uid,"cldbid"=>$cldbid,"count"=>$count,"ip"=>$ip,"name"=>$name,"lastseen"=>$nowtime,"grpid"=>$grpid,"nextup"=>$nextup,"idle"=>$idle,"cldgroup"=>$cldgroup);
echo sprintf($lang['upuser'],$name,$uid,$cldbid,$count,$activetime).'<br>';
}
else
{
$grpid='0';
foreach($grouptime as $time => $groupid)
{
if(in_array($groupid,$sgroups))
{
$grpid=$groupid;
break;
}
}
$insertdata[]=array("uuid"=>$uid,"cldbid"=>$cldbid,"count"=>"1","ip"=>$ip,"name"=>$name,"lastseen"=>$nowtime,"grpid"=>$grpid,"nextup"=>$nextupforinsert,"cldgroup"=>$cldgroup);
echo'<sccolor>'.sprintf($lang['adduser'],$name,$uid,$cldbid).'</sccolor><br>';
}
}
else
{
echo'<wncolor>'.sprintf($lang['nocount'],$name,$uid,$cldbid).'</wncolor><br>';
}
}
break;
} else {
$nextup = $time - $activetime;
}
}
$updatedata[] = array(
"uuid" => $uid,
"cldbid" => $cldbid,
"count" => $count,
"ip" => $ip,
"name" => $name,
"lastseen" => $nowtime,
"grpid" => $grpid,
"nextup" => $nextup,
"idle" => $idle,
"cldgroup" => $cldgroup
);
echo sprintf($lang['upuser'], $name, $uid, $cldbid, $count, $activetime), '<br>';
} else {
$grpid = '0';
foreach ($grouptime as $time => $groupid) {
if (in_array($groupid, $sgroups)) {
$grpid = $groupid;
break;
}
}
$insertdata[] = array(
"uuid" => $uid,
"cldbid" => $cldbid,
"count" => "1",
"ip" => $ip,
"name" => $name,
"lastseen" => $nowtime,
"grpid" => $grpid,
"nextup" => $nextupforinsert,
"cldgroup" => $cldgroup
);
$uidarr[] = $uid;
echo '<span class="sccolor">', sprintf($lang['adduser'], $name, $uid, $cldbid), '</span><br>';
}
} else {
echo '<span class="wncolor">', sprintf($lang['nocount'], $name, $uid, $cldbid), '</span><br>';
}
}
if(!$mysqlcon->query("UPDATE user SET online=''"))
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
}
if ($mysqlcon->exec("UPDATE $dbname.user SET online=''") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
if ($debug == 'on') {
echo '<br>insertdata:<br><pre>', print_r($insertdata), '</pre><br>';
}
if ($insertdata != '') {
$allinsertdata = '';
foreach ($insertdata as $insertarr) {
$allinsertdata = $allinsertdata . "('" . $insertarr['uuid'] . "', '" . $insertarr['cldbid'] . "', '" . $insertarr['count'] . "', '" . $insertarr['ip'] . "', '" . $insertarr['name'] . "', '" . $insertarr['lastseen'] . "', '" . $insertarr['grpid'] . "', '" . $insertarr['nextup'] . "', '" . $insertarr['cldgroup'] . "','1'),";
}
$allinsertdata = substr($allinsertdata, 0, -1);
if ($allinsertdata != '') {
if ($mysqlcon->exec("INSERT INTO $dbname.user (uuid, cldbid, count, ip, name, lastseen, grpid, nextup, cldgroup, online) VALUES $allinsertdata") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
}
}
if ($debug == 'on') {
echo '<br>allinsertdata:<br>', $allinsertdata, '<br><br>updatedata:<br><pre>', print_r($updatedata), '</pre><br>';
}
unset($insertdata);
unset($allinsertdata);
if ($updatedata != 0) {
$allupdateuuid = '';
$allupdatecldbid = '';
$allupdatecount = '';
$allupdateip = '';
$allupdatename = '';
$allupdatelastseen = '';
$allupdategrpid = '';
$allupdatenextup = '';
$allupdateidle = '';
$allupdatecldgroup = '';
foreach ($updatedata as $updatearr) {
$allupdateuuid = $allupdateuuid . "'" . $updatearr['uuid'] . "',";
$allupdatecldbid = $allupdatecldbid . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['cldbid'] . "' ";
$allupdatecount = $allupdatecount . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['count'] . "' ";
$allupdateip = $allupdateip . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['ip'] . "' ";
$allupdatename = $allupdatename . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['name'] . "' ";
$allupdatelastseen = $allupdatelastseen . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['lastseen'] . "' ";
$allupdategrpid = $allupdategrpid . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['grpid'] . "' ";
$allupdatenextup = $allupdatenextup . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['nextup'] . "' ";
$allupdateidle = $allupdateidle . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['idle'] . "' ";
$allupdatecldgroup = $allupdatecldgroup . "WHEN '" . $updatearr['uuid'] . "' THEN '" . $updatearr['cldgroup'] . "' ";
}
$allupdateuuid = substr($allupdateuuid, 0, -1);
if ($mysqlcon->exec("UPDATE $dbname.user set cldbid = CASE uuid $allupdatecldbid END, count = CASE uuid $allupdatecount END, ip = CASE uuid $allupdateip END, name = CASE uuid $allupdatename END, lastseen = CASE uuid $allupdatelastseen END, grpid = CASE uuid $allupdategrpid END, nextup = CASE uuid $allupdatenextup END, idle = CASE uuid $allupdateidle END, cldgroup = CASE uuid $allupdatecldgroup END, online = 1 WHERE uuid IN ($allupdateuuid)") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
}
if ($debug == 'on') {
echo '<br>allupdateuuid:<br>', $allupdateuuid, '<br>';
}
if($insertdata!='')
{
$allinsertdata='';
foreach($insertdata as $insertarr)
{
$allinsertdata=$allinsertdata."('".$insertarr["uuid"]."', '".$insertarr["cldbid"]."', '".$insertarr["count"]."', '".$insertarr["ip"]."', '".$insertarr["name"]."', '".$insertarr["lastseen"]."', '".$insertarr["grpid"]."', '".$insertarr["nextup"]."', '".$insertarr["cldgroup"]."','1'),";
}
$allinsertdata=substr($allinsertdata,0,-1);
unset($updatedata);
unset($allupdateuuid);
$upnextuptime = $nowtime - 600;
$dbdata = $mysqlcon->query("SELECT * FROM $dbname.user WHERE online<>1 AND lastseen>$upnextuptime");
if ($dbdata->rowCount() != 0) {
if($allinsertdata!='')
{
if(!$mysqlcon->query("INSERT INTO user (uuid, cldbid, count, ip, name, lastseen, grpid, nextup, cldgroup, online) VALUES $allinsertdata"))
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
}
}
}
$uuids = $dbdata->fetchAll(PDO::FETCH_ASSOC);
foreach($uuids as $uuid) {
$idle = $uuid['idle'];
$count = $uuid['count'];
$grpid = $uuid['grpid'];
$cldgroup = $uuid['cldgroup'];
$sgroups = explode(",", $cldgroup);
if ($substridle == 1) {
$activetime = $count - $idle;
$dtF = new DateTime("@0");
$dtT = new DateTime("@$activetime");
} else {
$activetime = $count;
$dtF = new DateTime("@0");
$dtT = new DateTime("@$count");
}
foreach ($grouptime as $time => $groupid) {
if ($activetime > $time) {
break;
} else {
$nextup = $time - $activetime;
}
}
$updatenextup[] = array(
"uuid" => $uuid['uuid'],
"nextup" => $nextup
);
}
}
if($updatedata!=0)
{
$allupdateuuid='';
$allupdatecldbid='';
$allupdatecount='';
$allupdateip='';
$allupdatename='';
$allupdatelastseen='';
$allupdategrpid='';
$allupdatenextup='';
$allupdateidle='';
$allupdatecldgroup='';
foreach($updatedata as $updatearr)
{
$allupdateuuid=$allupdateuuid."'".$updatearr["uuid"]."',";
$allupdatecldbid=$allupdatecldbid."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["cldbid"]."' ";
$allupdatecount=$allupdatecount."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["count"]."' ";
$allupdateip=$allupdateip."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["ip"]."' ";
$allupdatename=$allupdatename."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["name"]."' ";
$allupdatelastseen=$allupdatelastseen."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["lastseen"]."' ";
$allupdategrpid=$allupdategrpid."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["grpid"]."' ";
$allupdatenextup=$allupdatenextup."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["nextup"]."' ";
$allupdateidle=$allupdateidle."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["idle"]."' ";
$allupdatecldgroup=$allupdatecldgroup."WHEN '".$updatearr["uuid"]."' THEN '".$updatearr["cldgroup"]."' ";
}
$allupdateuuid=substr($allupdateuuid,0,-1);
if ($updatenextup != 0) {
$allupdateuuid = '';
$allupdatenextup = '';
foreach ($updatenextup as $updatedata) {
$allupdateuuid = $allupdateuuid . "'" . $updatedata['uuid'] . "',";
$allupdatenextup = $allupdatenextup . "WHEN '" . $updatedata['uuid'] . "' THEN '" . $updatedata['nextup'] . "' ";
}
$allupdateuuid = substr($allupdateuuid, 0, -1);
if ($mysqlcon->exec("UPDATE $dbname.user set nextup = CASE uuid $allupdatenextup END WHERE uuid IN ($allupdateuuid)") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
}
if(!$mysqlcon->query("UPDATE user set cldbid = CASE uuid $allupdatecldbid END, count = CASE uuid $allupdatecount END, ip = CASE uuid $allupdateip END, name = CASE uuid $allupdatename END, lastseen = CASE uuid $allupdatelastseen END, grpid = CASE uuid $allupdategrpid END, nextup = CASE uuid $allupdatenextup END, idle = CASE uuid $allupdateidle END, cldgroup = CASE uuid $allupdatecldgroup END, online = 1 WHERE uuid IN ($allupdateuuid)"))
{
echo $lang['error'].'<wncolor>this'.$mysqlcon->error.'.</wncolor><br>';
}
}
if ($debug == 'on') {
echo '<br>allupdateuuid:<br>', $allupdateuuid, '<br><br>allupdatenextup:<br>', $allupdatenextup, '<br>';
}
unset($updatedata);
unset($allupdateuuid);
$dbgroups = $mysqlcon->query("SELECT * FROM $dbname.groups");
if ($dbgroups->rowCount() == 0) {
$sqlhisgroup = "empty";
} else {
$servergroups = $dbgroups->fetchAll(PDO::FETCH_ASSOC);
foreach($servergroups as $servergroup) {
$sqlhisgroup[$servergroup['sgid']] = $servergroup['sgidname'];
}
}
$dbdata=$mysqlcon->query("SELECT * FROM user WHERE online<>1");
if($dbdata->num_rows!=0)
{
while($uuid=$dbdata->fetch_assoc())
{
$idle=$uuid["idle"];
$count=$uuid["count"];
$grpid=$uuid["grpid"];
$cldgroup=$uuid['cldgroup'];
$sgroups=explode(",",$cldgroup);
if($substridle==1)
{
$activetime=$count - $idle;
$dtF=new DateTime("@0");
$dtT=new DateTime("@$activetime");
}
else
{
$activetime=$count;
$dtF=new DateTime("@0");
$dtT=new DateTime("@$count");
}
foreach($grouptime as $time => $groupid)
{
if($activetime>$time)
{
break;
}
else
{
$nextup=$time - $activetime;
}
}
if($uuid['uuid']!="lastscantime")
{
$updatenextup[]=array("uuid"=>$uuid['uuid'],"nextup"=>$nextup);
}
}
}
foreach ($ts3groups as $servergroup) {
$gefunden = 2;
$iconid = $servergroup['iconid'];
$iconid = ($iconid < 0) ? (pow(2, 32)) - ($iconid * -1) : $iconid;
$sgname = str_replace('\\', '\\\\', htmlspecialchars($servergroup['name'], ENT_QUOTES));
if ($sqlhisgroup != "empty") {
foreach ($sqlhisgroup as $sgid => $sname) {
if ($sgid == $servergroup['sgid']) {
$gefunden = 1;
$updategroups[] = array(
"sgid" => $servergroup['sgid'],
"sgidname" => $sgname,
"iconid" => $iconid
);
break;
}
}
if ($gefunden != 1) {
$insertgroups[] = array(
"sgid" => $servergroup['sgid'],
"sgidname" => $sgname,
"iconid" => $iconid
);
}
} else {
$insertgroups[] = array(
"sgid" => $servergroup['sgid'],
"sgidname" => $sgname,
"iconid" => $iconid
);
}
}
if($updatenextup!=0)
{
$allupdateuuid='';
$allupdatenextup='';
foreach($updatenextup as $updatedata)
{
$allupdateuuid=$allupdateuuid."'".$updatedata["uuid"]."',";
$allupdatenextup=$allupdatenextup."WHEN '".$updatedata["uuid"]."' THEN '".$updatedata["nextup"]."' ";
}
$allupdateuuid=substr($allupdateuuid,0,-1);
if ($debug == 'on') {
echo '<br>insertgroups:<br><pre>', $insertgroups, '</pre><br>';
}
if (isset($insertgroups)) {
$allinsertdata = '';
foreach ($insertgroups as $insertarr) {
$allinsertdata = $allinsertdata . "('" . $insertarr['sgid'] . "', '" . $insertarr['sgidname'] . "', '" . $insertarr['iconid'] . "'),";
}
$allinsertdata = substr($allinsertdata, 0, -1);
if ($allinsertdata != '') {
if ($mysqlcon->exec("INSERT INTO $dbname.groups (sgid, sgidname, iconid) VALUES $allinsertdata") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
}
}
if(!$mysqlcon->query("UPDATE user set nextup = CASE uuid $allupdatenextup END WHERE uuid IN ($allupdateuuid)"))
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
}
}
if ($debug == 'on') {
echo '<br>allinsertdata:<br>', $allinsertdata, '<br>';
}
unset($insertgroups);
unset($allinsertdata);
if (isset($updategroups)) {
$allsgids = '';
$allupdatesgid = '';
$allupdateiconid = '';
foreach ($updategroups as $updatedata) {
$allsgids = $allsgids . "'" . $updatedata['sgid'] . "',";
$allupdatesgid = $allupdatesgid . "WHEN '" . $updatedata['sgid'] . "' THEN '" . $updatedata['sgidname'] . "' ";
$allupdateiconid = $allupdateiconid . "WHEN '" . $updatedata['sgid'] . "' THEN '" . $updatedata['iconid'] . "' ";
}
$allsgids = substr($allsgids, 0, -1);
if ($mysqlcon->exec("UPDATE $dbname.groups set sgidname = CASE sgid $allupdatesgid END, iconid = CASE sgid $allupdateiconid END WHERE sgid IN ($allsgids)") === false) {
echo '<span class="wncolor">',$mysqlcon->errorCode(),'</span><br>';
}
}
$dbgroups=$mysqlcon->query("SELECT * FROM groups");
if($dbgroups->num_rows==0)
{
$sqlhisgroup="empty";
}
else
{
while($servergroup=$dbgroups->fetch_assoc())
{
$sqlhisgroup[$servergroup['sgid']]=$servergroup['sgidname'];
}
}
foreach($ts3groups as $servergroup)
{
if($sqlhisgroup!="empty")
{
foreach($sqlhisgroup as $sgid => $sname)
{
if($sgid==$servergroup['sgid'])
{
$gefunden=1;
$updategroups[]=array("sgid"=>$servergroup['sgid'],"sgidname"=>$servergroup['name']);
break;
}
}
if($gefunden!=1)
{
$insertgroups[]=array("sgid"=>$servergroup['sgid'],"sgidname"=>$servergroup['name']);
}
}
else
{
$insertgroups[]=array("sgid"=>$servergroup['sgid'],"sgidname"=>$servergroup['name']);
}
}
if($insertgroups!='')
{
$allinsertdata='';
foreach($insertgroups as $insertarr)
{
$allinsertdata=$allinsertdata."('".$insertarr["sgid"]."', '".$insertarr["sgidname"]."'),";
}
$allinsertdata=substr($allinsertdata,0,-1);
if($allinsertdata!='')
{
if(!$mysqlcon->query("INSERT INTO groups (sgid, sgidname) VALUES $allinsertdata"))
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
}
}
}
if($updategroups!=0)
{
$allsgids='';
$allupdatesgid='';
foreach($updategroups as $updatedata)
{
$allsgids=$allsgids."'".$updatedata["sgid"]."',";
$allupdatesgid=$allupdatesgid."WHEN '".$updatedata["sgid"]."' THEN '".$updatedata["sgidname"]."' ";
}
$allsgids=substr($allsgids,0,-1);
if(!$mysqlcon->query("UPDATE groups set sgidname = CASE sgid $allupdatesgid END WHERE sgid IN ($allsgids)"))
{
echo $lang['error'].'<wncolor>'.$mysqlcon->error.'.</wncolor><br>';
}
}
unset($allsgids);
unset($allupdatesgid);
}
catch(Exception $e)
{
echo $lang['error'].$e->getCode().': '.$e->getMessage();
catch (Exception $e) {
echo $lang['error'] . $e->getCode() . ': ' . $e->getMessage();
}
if($showgen==1)
{
$buildtime=microtime(true)-$starttime;
echo'<br>'.sprintf($lang['sitegen'],$buildtime,$sumentries).'<br>';
if ($showgen == 1) {
$buildtime = microtime(true) - $starttime;
echo '<br>', sprintf($lang['sitegen'], $buildtime, $sumentries), '<br>';
}
?>
</body>