134 lines
13 KiB
PHP
134 lines
13 KiB
PHP
<?
|
||
if(empty($_SESSION['uid'])) { header('Location: ../index.php'); exit; }
|
||
$us = mysql_fetch_array(mysql_query('SELECT `id`, `vip`, `vip_time`, `login` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['target']).'" LIMIT 1'));
|
||
$vip = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `sokr`, `zash`, `invisible`, `attack`, `bloodattack`, `sleep30`, `travmoff`, `dontattack`, `unsleep`, `pers_attack` FROM `abils_vip` WHERE `uid` = "'.$us['id'].'" LIMIT 1'));
|
||
|
||
$type = (int)$_POST['vip_type'];
|
||
$time = (int)$_POST['time'];
|
||
$n_time = (time()+60*60*24*($time*30));
|
||
$afected = (($user['vip_time'])+60*60*24*($time*30));
|
||
$types = array(1 => 'Silver', 2 => 'Gold', 3 => 'Platinum');
|
||
|
||
if($time > 10) {
|
||
$srok = 'Бессрочно.';
|
||
} else {
|
||
$srok = $time.' мес.';
|
||
}
|
||
|
||
if($user['align'] != 2.99 && $user['login'] != "father") {
|
||
echo '<b style=\'color: Red;\'>Вам не доступна данная привелегия ...</b>';
|
||
} elseif(!isset($us['id'])) {
|
||
echo '<b style=\'color: Red;\'>Персонаж \''.$_POST['target'].'\' не найден ...</b>';
|
||
} elseif($type < 1 && $type > 3) {
|
||
echo '<b style=\'color: Red;\'>Не верный тип аккаунта ...</b>';
|
||
} else {
|
||
if($us['vip'] > 0 && $us['vip_time'] > time()) {
|
||
if($type == 1) {
|
||
if($us['vip'] == 1) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "0", `dontattack` = "0", `travmoff` = "0", `unsleep` = "0", `pers_attack` = "0"';
|
||
mysql_query('UPDATE `users` SET `vip` = 1, `vip_time` = "'.$afected.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'обновлён'; $add = 'обновил';
|
||
} elseif($us['vip'] == 2) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "0"';
|
||
mysql_query('UPDATE `users` SET `vip` = 1, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'выдан'; $add = 'присвоил';
|
||
} elseif($us['vip'] == 3) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 2; $vip['travmoff'] = 1; $vip['unsleep'] = 2; $vip['pers_attack'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "'.$vip['pers_attack'].'"';
|
||
mysql_query('UPDATE `users` SET `vip` = 1, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'выдан'; $add = 'присвоил';
|
||
}
|
||
mysql_query('UPDATE `abils_vip` SET '.$sql.' WHERE `id` = "'.$vip['id'].'" LIMIT 1');
|
||
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', '.$t.' '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
|
||
$txt = 'Ангел <b>'.$user['login'].'</b> '.$add.' вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
|
||
|
||
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
|
||
} elseif($type == 2) {
|
||
if($us['vip'] == 1) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "0", `dontattack` = "0", `travmoff` = "0", `unsleep` = "0", `pers_attack` = "0"';
|
||
mysql_query('UPDATE `users` SET `vip` = 2, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'выдан'; $add = 'присвоил';
|
||
} elseif($us['vip'] == 2) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "0"';
|
||
mysql_query('UPDATE `users` SET `vip` = 2, `vip_time` = "'.$afected.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'обновлен'; $add = 'обновил';
|
||
} elseif($us['vip'] == 3) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 2; $vip['travmoff'] = 1; $vip['unsleep'] = 2; $vip['pers_attack'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "'.$vip['pers_attack'].'"';
|
||
mysql_query('UPDATE `users` SET `vip` = 2, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'выдан'; $add = 'присвоил';
|
||
}
|
||
mysql_query('UPDATE `abils_vip` SET '.$sql.' WHERE `id` = "'.$vip['id'].'" LIMIT 1');
|
||
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', '.$t.' '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
|
||
$txt = 'Ангел <b>'.$user['login'].'</b> '.$add.' вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
|
||
|
||
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
|
||
} elseif($type == 3) {
|
||
if($us['vip'] == 1) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "0", `dontattack` = "0", `travmoff` = "0", `unsleep` = "0", `pers_attack` = "0"';
|
||
mysql_query('UPDATE `users` SET `vip` = 3, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'выдан'; $add = 'присвоил';
|
||
} elseif($us['vip'] == 2) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "0"';
|
||
mysql_query('UPDATE `users` SET `vip` = 3, `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'выдан'; $add = 'присвоил';
|
||
} elseif($us['vip'] == 3) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 2; $vip['travmoff'] = 1; $vip['unsleep'] = 2; $vip['pers_attack'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "'.$vip['pers_attack'].'"';
|
||
mysql_query('UPDATE `users` SET `vip` = 3, `vip_time` = "'.$afected.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
$t = 'обновлен'; $add = 'обновил';
|
||
}
|
||
mysql_query('UPDATE `abils_vip` SET '.$sql.' WHERE `id` = "'.$vip['id'].'" LIMIT 1');
|
||
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', '.$t.' '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
|
||
$txt = 'Ангел <b>'.$user['login'].'</b> '.$add.' вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
|
||
|
||
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
|
||
}
|
||
} else {
|
||
if(isset($vip['id'])) {
|
||
if($type == 1) {
|
||
$vip['invisible'] += 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
|
||
$sql = '`invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'"';
|
||
} elseif($type == 2) {
|
||
$vip['invisible'] += 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
|
||
$sql = '`invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'"';
|
||
} elseif($type == 3) {
|
||
$vip['invisible'] += 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] += 2; $vip['travmoff'] = 1; $vip['unsleep'] += 2; $vip['pers_attack'] = 1;
|
||
$sql = '`invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'", `sleep30` = "'.$vip['sleep30'].'", `dontattack` = "'.$vip['dontattack'].'", `travmoff` = "'.$vip['travmoff'].'", `unsleep` = "'.$vip['unsleep'].'", `pers_attack` = "'.$vip['pers_attack'].'"';
|
||
}
|
||
$add = 'Выдал';
|
||
mysql_query('UPDATE `users` SET `vip` = "'.$type.'", `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
mysql_query('UPDATE `abils_vip` SET '.$sql.' WHERE `id` = "'.$vip['id'].'" LIMIT 1');
|
||
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', выдан '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
|
||
$txt = 'Ангел <b>'.$user['login'].'</b> '.$add.' вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
|
||
|
||
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
|
||
|
||
} else {
|
||
if($type == 1) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 1; $vip['attack'] = 1; $vip['bloodattack'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'"';
|
||
} elseif($type == 2) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 2; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 1; $vip['travmoff'] = 1; $vip['unsleep'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'"';
|
||
|
||
} elseif($type == 3) {
|
||
$vip['sokr'] = 1; $vip['zash'] = 1; $vip['invisible'] = 3; $vip['attack'] = 1; $vip['bloodattack'] = 1; $vip['sleep30'] = 1; $vip['dontattack'] = 2; $vip['travmoff'] = 1; $vip['unsleep'] = 2; $vip['pers_attack'] = 1;
|
||
$sql = '`sokr` = "'.$vip['sokr'].'", `zash` = "'.$vip['zash'].'", `invisible` = "'.$vip['invisible'].'", `attack` = "'.$vip['attack'].'", `bloodattack` = "'.$vip['bloodattack'].'"';
|
||
|
||
}
|
||
mysql_query('UPDATE `users` SET `vip` = "'.$type.'", `vip_time` = "'.$n_time.'" WHERE `id` = "'.$us['id'].'" LIMIT 1');
|
||
mysql_query('INSERT INTO `abils_vip` SET '.$sql.', `uid` = "'.$us['id'].'"');
|
||
echo '<b style=\'color: Red;\'>Персонажу '.$us['login'].', выдан '.$types[$type].' аккаунт. Сроком '.$srok.'</b>';
|
||
$txt = 'Ангел <b>'.$user['login'].'</b> присвоил вам <b>'.$types[$type].' аккаунт</b>, сроком '.$srok.'';
|
||
|
||
addchp('<font color=red>Внимание!</font> '.$txt, '{[]}'.Nick::id($us['id'])->short().'{[]}');
|
||
}
|
||
}
|
||
} |