-
- 0) {
- if ($user['money'] >= $a) {
- $cc = mysql_query("update `clans` set `zbor`=`zbor`+$a WHERE `id`='$b'");
+ if ($a > 0) {
+ if ($user['money'] >= $a) {
+ $cc = mysql_query("update `clans` set `zbor`=`zbor`+$a WHERE `id`='$b'");
+ mysql_query("update `users` set `money`=`money`-$a WHERE `id`={$user['id']}");
+ header("Location: klan.php");
+ } else echo "У Вас не достаточно денег";
+ } else echo "Вы ошиблись с вводом суммы";
+ }
+ if ($start_zamok) {
+ $b = $user['klan'];
+ header("Location: klan.php");
+ mysql_query("update `clans` set `zamok`='2' WHERE `id`='$b'");
+ mysql_query("INSERT INTO `z_clan`(`name_clan` , `hEAD`) VALUES ('''{$USER['KLAN']}','{$user['login']}');");
+ }
- mysql_query("update `users` set `money`=`money`-$a WHERE `id`={$user['id']}");
- header("Location: klan.php");
-
-
- } else echo "У Вас не достаточно денег";
- } else echo "Вы ошиблись с вводом суммы";
- }
- if ($_POST['start_zamok']) {
- $b = $user['klan'];
- header("Location: klan.php");
- mysql_query("update `clans` set `zamok`='2' WHERE `id`='$b'");
- mysql_query("INSERT INTO `z_clan`(`name_clan` , `hEAD`) VALUES ('''{$USER['KLAN']}','{$user['login']}');");
-
-
- }
- echo '', $klan['name'], 'Количество рейтинговых очков клана: ', $klan['rating'], ' ';
- if ($klan['zamok'] == 2) {
- echo 'У Вашего клана есть Замок
';
- } else {
- echo 'У клана пока нет Замка
';
- }
- 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'])) {
- echo '
+ if (($klan['zbor'] >= '25000') AND ($klan['zamok'] == '1') AND ($klan['glava'] == $user['id'])) {
+ echo '
';
- }
- if ($klan['rating'] >= '1000000' AND $klan['zamok'] == '1') {
- $ex = $klan['zbor'];
- echo "Состояние построения кланового замка: $ex кр./25000 кр. ";
- echo '
';
- }
-
- if ($_POST['login']) {
- $sok = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `klan` = \'' . $klan['id'] . '\' AND `login` = \'' . $_POST['login'] . '\' LIMIT 1;'));
- $st = strip_tags(str_replace("<", "<", str_replace(">", ">", $_POST['status'])), "");
- if ($klan['glava'] == $sok['id']) {
- $st = "Глава клана";
- }
- if ($sok) {
- if ($_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;
- }
- $id_checked = mysql_real_escape_string($sok['id']);
-
- if (!mysql_query("UPDATE `users` SET `status` = '{$st}' WHERE `id` = '{$id_checked}';")) echo(mysql_error());
- if ($klan['glava'] == $user['id']) {
- mysql_query('UPDATE `clans` SET `vozm` = \'' . serialize($polno) . '\' WHERE `id` = \'' . $klan['id'] . '\';');
- }
- $sok['status'] = $st;
- }
- echo ' ';
- }
-
-
- }
- if ($_POST['login3'] && $klan['glava'] == $user['id']) {
- $sok = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `klan` = \'' . $klan['id'] . '\' AND `login` = \'' . $_POST['login3'] . '\' LIMIT 1;'));
- //mysql_query('update `users` set `money` = `money` - 30 WHERE `id` = '.$_SESSION['uid'].';');
- //mysql_query('update `users` set `klan` = \'\', `align` = 0 WHERE `id` = '.$sok['id'].';');
- mysql_query('update `clans` set `glava` = \'' . $sok['id'] . '\' WHERE `id` = ' . $klan['id'] . ';');
- mysql_query('update `users` set `status` = \'Глава клана\' WHERE `id` = ' . $sok['id'] . ';');
- mysql_query('update `users` set `status` = \'боец\' WHERE `id` = ' . $user['id'] . ';');
- $klan['glava'] = $sok['id'];
- }
- if ($_POST['login2'] && $polno[$user['id']][0] == 1) {
- $sok = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `klan` = \'\' AND `align` = \'0\' AND `login` = \'' . $_POST['login2'] . '\' LIMIT 1;'));
- $eff = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = '" . $sok['id'] . "' AND `type` = 20 LIMIT 1;"));
- if (!$eff) {
- echo "Нет проверки!";
- } elseif ($sok['level'] > 0 && $user['money'] >= 100) {
- echo 'Персонаж "', $sok['login'], '" успешно принят в клан.';
- mysql_query('update `users` set `money` = `money` - 100 WHERE `id` = ' . $_SESSION['uid'] . ';');
- mysql_query('update `users` set `status`= \'боец\', `klan` = \'' . $klan['id'] . '\', `align` = \'' . $klan['align'] . '\' WHERE `id` = ' . $sok['id'] . ';');
- } else {
- echo "Не хватает денег, или его попросту не существует.";
- }
- }
- if ($_POST['login1'] && $polno[$user['id']][0] == 1) {
- $sok = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `klan` = \'' . $klan['id'] . '\' AND `login` = \'' . $_POST['login1'] . '\' LIMIT 1;'));
- if ($sok && $user['money'] >= 30 && $klan['glava'] != $sok['id']) {
- echo 'Персонаж "', $sok['login'], '" покинул клан.';
- mysql_query('update `users` set `money` = `money` - 30 WHERE `id` = ' . $_SESSION['uid'] . ';');
- mysql_query('update `users` set `klan` = \'\', `align` = 0 WHERE `id` = ' . $sok['id'] . ';');
- }
- }
- } else {
- echo 'У вашего клана нет реликтов, или глава клана вам их не предоставил. ;)';
}
- ?>
+
+ if ($_POST['login']) {
+ $sok = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `klan` = \'' . $klan['id'] . '\' AND `login` = \'' . $_POST['login'] . '\' LIMIT 1;'));
+ $st = strip_tags(str_replace("<", "<", str_replace(">", ">", $_POST['status'])), "");
+ if ($klan['glava'] == $sok['id']) {
+ $st = "Глава клана";
+ }
+ if ($sok) {
+ if ($_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;
+ }
+ $id_checked = mysql_real_escape_string($sok['id']);
+
+ if (!mysql_query("UPDATE `users` SET `status` = '{$st}' WHERE `id` = '{$id_checked}';")) echo(mysql_error());
+ if ($klan['glava'] == $user['id']) {
+ mysql_query('UPDATE `clans` SET `vozm` = \'' . serialize($polno) . '\' WHERE `id` = \'' . $klan['id'] . '\';');
+ }
+ $sok['status'] = $st;
+ }
+ echo ' ';
+ }
+
+
+ }
+ if ($_POST['login3'] && $klan['glava'] == $user['id']) {
+ $sok = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `klan` = \'' . $klan['id'] . '\' AND `login` = \'' . $_POST['login3'] . '\' LIMIT 1;'));
+ //mysql_query('update `users` set `money` = `money` - 30 WHERE `id` = '.$_SESSION['uid'].';');
+ //mysql_query('update `users` set `klan` = \'\', `align` = 0 WHERE `id` = '.$sok['id'].';');
+ mysql_query('update `clans` set `glava` = \'' . $sok['id'] . '\' WHERE `id` = ' . $klan['id'] . ';');
+ mysql_query('update `users` set `status` = \'Глава клана\' WHERE `id` = ' . $sok['id'] . ';');
+ mysql_query('update `users` set `status` = \'боец\' WHERE `id` = ' . $user['id'] . ';');
+ $klan['glava'] = $sok['id'];
+ }
+ if ($_POST['login2'] && $polno[$user['id']][0] == 1) {
+ $sok = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `klan` = \'\' AND `align` = \'0\' AND `login` = \'' . $_POST['login2'] . '\' LIMIT 1;'));
+ $eff = mysql_fetch_array(mysql_query("SELECT * FROM `effects` WHERE `owner` = '" . $sok['id'] . "' AND `type` = 20 LIMIT 1;"));
+ if (!$eff) {
+ echo "Нет проверки!";
+ } elseif ($sok['level'] > 0 && $user['money'] >= 100) {
+ echo 'Персонаж "', $sok['login'], '" успешно принят в клан.';
+ mysql_query('update `users` set `money` = `money` - 100 WHERE `id` = ' . $_SESSION['uid'] . ';');
+ mysql_query('update `users` set `status`= \'боец\', `klan` = \'' . $klan['id'] . '\', `align` = \'' . $klan['align'] . '\' WHERE `id` = ' . $sok['id'] . ';');
+ } else {
+ echo "Не хватает денег, или его попросту не существует.";
+ }
+ }
+ if ($_POST['login1'] && $polno[$user['id']][0] == 1) {
+ $sok = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `klan` = \'' . $klan['id'] . '\' AND `login` = \'' . $_POST['login1'] . '\' LIMIT 1;'));
+ if ($sok && $user['money'] >= 30 && $klan['glava'] != $sok['id']) {
+ echo 'Персонаж "', $sok['login'], '" покинул клан.';
+ mysql_query('update `users` set `money` = `money` - 30 WHERE `id` = ' . $_SESSION['uid'] . ';');
+ mysql_query('update `users` set `klan` = \'\', `align` = 0 WHERE `id` = ' . $sok['id'] . ';');
+ }
+ }
+ } else {
+ echo 'У вашего клана нет реликтов, или глава клана вам их не предоставил. ;)';
+ }
+ ?>
|
@@ -233,47 +230,44 @@ $polno = unserialize($klan['vozm']);
-
- Соклановцы
-
-
-
-
-
- $data = mysql_query("SELECT `id`, `login`, `status`, `level`, `room`, `align`, (select `id` from `online` WHERE `date` >= " . (time() - 60) . " AND `id` = users.`id`) as `online` FROM `users` WHERE `klan` = '" . $klan['id'] . "' order by online DESC, login asc ;");
- while ($row = mysql_fetch_array($data)) {
- if ($row['online'] > 0) {
- echo '';
- nick2($row['id']);
- 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 '';
- nick2($row['id']);
- if ($row['id'] == $klan['glava']) {
- echo ' - Глава клана';
- } else {
- echo ' - ', $row['status'], '';
- }
- echo ' - персонаж не в клубе ';
+
+ Соклановцы
+
+
+
+
+
+ $data = mysql_query("SELECT `id`, `login`, `status`, `level`, `room`, `align`, (select `id` from `online` WHERE `date` >= " . (time() - 60) . " AND `id` = users.`id`) as `online` FROM `users` WHERE `klan` = '" . $klan['id'] . "' order by online DESC, login asc ;");
+ while ($row = mysql_fetch_array($data)) {
+ if ($row['online'] > 0) {
+ echo '';
+ nick2($row['id']);
+ 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 '';
+ nick2($row['id']);
+ if ($row['id'] == $klan['glava']) {
+ echo ' - Глава клана';
+ } else {
+ echo ' - ', $row['status'], '';
+ }
+ echo ' - персонаж не в клубе ';
}
- ?>
- |
-
-
-
+ }
+ ?>
+ |
+
+
|