query('SELECT * FROM `clans` WHERE `id` = ?i', $user['klan'])->fetch_assoc();
$polno = [];
$polno = unserialize($klan['vozm']);
if (isset($_POST['zamok'])) {
db::c()->query('UPDATE `clans` SET `zamok` = 1 WHERE `glava` = ?i', $_SESSION['uid']);
$status = "Начат сбор средств на строительство Кланового Замка.";
header("Location: сlan.php");
}
if (isset($_POST['kr']) && ($_POST['kolv'] > 0)) {
if ($user['money'] >= $_POST['kolv']) {
db::c()->query('UPDATE `clans` SET `zbor` = `zbor` + ?i WHERE `id` = ?i', $_POST['kolv'], $user['klan']);
db::c()->query('UPDATE `users` SET `money` = `money` - ?i WHERE `id` = ?i', $_POST['kolv'], $user['id']);
header("Location: сlan.php");
} else $status = 'Не хватает денег!';
}
if (!empty($_POST['login']) AND $_POST['action'] == 'add_member' AND $polno[$user['id']][0] == 1) {
$sok = db::c()->query('SELECT `id`,`level` FROM `users` WHERE `klan` = "?s" AND `align` = 0 AND `login` = "?s"', '', $_POST['login'])->fetch_assoc();
$proverka = db::c()->query('SELECT 1 FROM `effects` WHERE `type` = 20 AND `owner` = ?i', $sok['id'])->getNumRows();
if (!$proverka) echo "Нет проверки!";
elseif ($sok['level'] > 0 && $user['money'] >= 100) {
db::c()->query('UPDATE `users` SET `money` = `money` - 100 WHERE `id` = ?i', $_SESSION['uid']);
db::c()->query('UPDATE `users` SET `status` = "?s", `klan` = "?s", `align` = ?i WHERE `id` = ?i', 'Боец', $klan['id'], $klan['align'], $sok['id']);
$status = 'Персонаж «' . $_POST['login'] . '» успешно принят в клан.';
} else $status = 'Не хватает денег, или его попросту не существует.';
}
if (!empty($_POST['login']) AND $_POST['action'] == 'remove_member' AND $polno[$user['id']][0] == 1) {
$sok = db::c()->query('SELECT `id` FROM `users` WHERE `klan` = "?s" AND `login` = "?s"', $klan['id'], $_POST['login'])->fetch_assoc();
if ($sok['id'] != $klan['glava'] AND $user['money'] >= 30) {
db::c()->query('UPDATE `users` SET `money` = `money` - 30 WHERE `id` = ?i', $_SESSION['uid']);
db::c()->query('UPDATE `users` SET `klan` = null, `align` = 0 WHERE `id` = ?i', $sok['id']);
$status = 'Персонаж «' . $_POST['login'] . '» покинул клан.';
}
}
if (!empty($_POST['login']) AND $_POST['action'] == 'change_owner' AND $klan['glava'] == $_SESSION['uid']) { //смена главы
$sok = db::c()->query('SELECT `id` FROM `users` WHERE `klan` = "?s" AND `login` = "?s"', $klan['id'], $_POST['login'])->fetch_assoc();
//mysql_query('update `users` set `money` = `money` - 30 WHERE `id` = '.$_SESSION['uid'].';');
//mysql_query('update `users` set `klan` = \'\', `align` = 0 WHERE `id` = '.$sok['id'].';');
db::c()->query('UPDATE `clans` SET `glava` = ?i WHERE `id` = ?i', $sok['id'], $klan['id']);
db::c()->query('UPDATE `users` SET `status` = null WHERE `id` = ?i', $sok['id']);
db::c()->query('UPDATE `users` SET `status` = "?s" WHERE `id` = ?i', 'Боец', $_SESSION['uid']);
$klan['glava'] = $sok['id'];
}
?>
= $klan['name'] ?>
Количество рейтинговых очков клана: = $klan['rating'] ?>
';
else echo 'У клана пока нет Замка
';
?>
(стоимость услуги: 100 кр.)
(стоимость услуги: 30 кр.)
(сложить с себя полномочия, назначив Главой Клана другого персонажа)
query('SELECT * FROM `users` WHERE `klan` = "?s" AND `login` = "?s"', $klan['id'], $user['id'])->fetch_assoc();
}
if ($klan['glava'] == $user['id'] OR $polno[$user['id']][0] == 1 OR $polno[$user['id']][1] == 1) {
echo "';
}
}
if (($klan['zbor'] >= '25000') AND ($klan['zamok'] == '1') AND ($klan['glava'] == $user['id'])) {
err('Сумма собрана, но замки ещё не введены в игру. 🙁');
}
if ($klan['rating'] >= '1000000' AND $klan['zamok'] == 1 AND $klan['zbor'] < '25000') {
$ex = $klan['zbor'];
echo "Сбор средств на постройку кланового замка: $ex кр./25000 кр. ";
echo '
';
}
if (!empty($_POST['login']) AND $_POST['action'] == 'edit_status') {
$sok = db::c()->query('SELECT `id`, `status` FROM `users` WHERE `klan` = "?s" AND `login` = "?s"', $klan['id'], $_POST['login'])->fetch_assoc();
if (!empty($_POST['status'])) {
$st = strip_tags(str_replace("<", "<", str_replace(">", ">", $_POST['status'])), "");
}
if ($sok AND $sok['id'] != $klan['glava']) {
if (!empty($_POST['save'])) {
if ($_POST['vin'] == 'on') {
$polno[$sok['id']][0] = 1;
} else {
$polno[$sok['id']][0] = 0;
}
if ($_POST['tus'] == 'on') {
$polno[$sok['id']][1] = 1;
} else {
$polno[$sok['id']][1] = 0;
}
db::c()->query('UPDATE `users` SET `status` = "?s" WHERE `id` = ?i', $st, $sok['id']);
if ($klan['glava'] == $user['id']) {
db::c()->query('UPDATE `clans` SET `vozm` = "?s" WHERE `id` = ?i', serialize($polno), $klan['id']);
}
$sok['status'] = $st;
}
echo ' ';
} elseif ($sok['id'] == $klan['glava']) {
echo ' |
|
Соклановцы
query('SELECT `id`, `login`, `status`, `level`, `room`, `align`, (select `id` from `online` WHERE `date` >= ?i AND `id` = users.`id`) AS `online` FROM `users` WHERE `klan` = ?i ORDER BY `online` DESC , `login` ASC', (time() - 60), $klan['id']);
while ($row = $data->fetch_assoc()) {
if ($row['online'] > 0) {
echo '💡 ';
echo nick::id($row['id'])->full();
if ($row['id'] == $klan['glava']) {
echo ' - Глава клана';
} else {
echo ' - ', $row['status'], '';
}
if ($row['room'] > 500 && $row['room'] < 561) {
$rrm = 'Башня смерти, участвует в турнире';
} else {
$rrm = $rooms[$row['room']];
}
echo ' - ', $rrm, ' ';
} else if ($row['online'] < 1) {
echo '';
echo nick::id($row['id'])->full();
if ($row['id'] == $klan['glava']) {
echo ' - Глава клана';
} elseif (!empty($row['status'])) {
echo ' - ', $row['status'], '';
}
echo ' ';
}
}
?>
|