optimal parameter fix
This commit is contained in:
parent
e4fc8ffe40
commit
0eb5cbef31
74
zayavka.php
74
zayavka.php
@ -30,7 +30,7 @@ if (!empty($_GET['del']) && $user['admin'] == 1) { //удаление заявк
|
||||
echo 'Заявка не найдена ...';
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION['view'] = false;
|
||||
if (isset($_REQUEST['view'])) $_SESSION['view'] = $_REQUEST['view'];
|
||||
|
||||
class zayavka
|
||||
@ -106,62 +106,28 @@ class zayavka
|
||||
}
|
||||
}
|
||||
|
||||
if ($user['zayavka'] != 0) {
|
||||
return "Вы находитесь в заявке";
|
||||
}
|
||||
if (!empty($user['zayavka'])) return "Вы находитесь в заявке";
|
||||
|
||||
if ($user['hp'] < $user['maxhp'] * 0.33) {
|
||||
return "Вы слишком ослаблены для боя, восстановитесь.";
|
||||
}
|
||||
if ($user['hp'] < $user['maxhp'] * 0.33) return "Вы слишком ослаблены для боя, восстановитесь.";
|
||||
|
||||
if (!$z) {
|
||||
return "Эта заявка не может быть принята Вами.";
|
||||
}
|
||||
if (!$z) return "Эта заявка не может быть принята Вами.";
|
||||
|
||||
if ($this->user_status($id) != 0) {
|
||||
return "Эта заявка не может быть принята Вами.";
|
||||
}
|
||||
if ($this->user_status($id) != 0) return "Эта заявка не может быть принята Вами.";
|
||||
|
||||
if ($z[$zay]['type'] == 3 || $z[$zay]['type'] == 5) {
|
||||
if ($z[$zay]['type'] != 3 OR $z[$zay]['type'] != 5) {
|
||||
if ($team == 1) $teamz = 2;
|
||||
else $teamz = 1;
|
||||
|
||||
} else {
|
||||
if ($team == 1) {
|
||||
$teamz = 2;
|
||||
} else {
|
||||
$teamz = 1;
|
||||
}
|
||||
foreach ($z[$zay]['team' . $teamz] as $v) {
|
||||
$toper = mysql_fetch_array(mysql_query("SELECT `klan`, `align` FROM `users` WHERE `id` = '{$v}' LIMIT 1"));
|
||||
if ($toper['klan'] > 0) {
|
||||
if ((int)$user['klan'] == (int)$toper['klan']) {
|
||||
return "Чтите честь Ваших сокланов.";
|
||||
}
|
||||
}
|
||||
|
||||
if ((int)$user['align'] == 1) {
|
||||
if ((int)$toper['align'] == 1) {
|
||||
return "Чтите честь Паладинов.";
|
||||
}
|
||||
}
|
||||
|
||||
if ($user['align'] == 6) {
|
||||
if ($toper['align'] == 6) {
|
||||
return "Не предавайте свет.";
|
||||
}
|
||||
}
|
||||
|
||||
if ($user['align'] == 3) {
|
||||
if ($toper['align'] == 3) {
|
||||
return "Не предавайте тьму.";
|
||||
}
|
||||
}
|
||||
$enemy = db::c()->query('SELECT `klan` FROM `users` WHERE `id` = ?i', $v)->fetch_assoc();
|
||||
if ($user['klan'] == $enemy['klan']) return "Нельзя драться против сокланов!";
|
||||
}
|
||||
}
|
||||
|
||||
if ($z[$zay]['t' . $team . 'min'] == 99) {
|
||||
$toper = $z[$zay]['team' . $team][0];
|
||||
$toper = mysql_fetch_array(mysql_query("SELECT `id`, `login`, `align`, `klan`, `level` FROM `users` WHERE `id` = '{$toper}' LIMIT 1"));
|
||||
if ($toper['klan'] != '') {
|
||||
if (!empty($toper['klan'])) {
|
||||
if ($user['klan'] != $toper['klan']) {
|
||||
return "Эта заявка не может быть принята Вами.";
|
||||
}
|
||||
@ -181,14 +147,14 @@ class zayavka
|
||||
} else return 'addteam(): database error!';
|
||||
}
|
||||
|
||||
function delteam($team = 2, $id, $zay, $r)
|
||||
function delteam($id, $zay, $r)
|
||||
{
|
||||
$z = $this->getlist($r, null, $zay);
|
||||
if ($z[$zay]['level'] > 3 || $z[$zay]['level'] == null) {
|
||||
return "Ай-ай-ай!";
|
||||
}
|
||||
|
||||
foreach ($z[$zay]['team' . $team] as $v) {
|
||||
foreach ($z[$zay]['team2'] as $v) {
|
||||
if ($v != $id) {
|
||||
$teams[] = $v;
|
||||
}
|
||||
@ -700,9 +666,11 @@ if (!empty($_POST['open'])) {
|
||||
}; ?>
|
||||
</A></TD>
|
||||
<TD class=<?= ($level == 'haos') ? "s" : "m" ?>><?php if ($user['room'] != 101) echo("<A HREF=\"zayavka.php?level=haos&" . mt_rand() . "\">Хаотичные</A></TD>"); else echo 'В разработке</TD>' ?>
|
||||
<TD class=<?= (input::check('tklogs') == '1') ? "s" : "m" ?>><A HREF="zayavka.php?tklogs=1&<?= mt_rand() ?>">Текущие</A>
|
||||
<TD class=<?= (input::check('tklogs') == '1') ? "s" : "m" ?>><A
|
||||
HREF="zayavka.php?tklogs=1&<?= mt_rand() ?>">Текущие</A>
|
||||
</TD>
|
||||
<TD class=<?= (!is_null($logs)) ? "s" : "m" ?>><A HREF="zayavka.php?logs=<?= date("d.m.y") ?>&<?= mt_rand() ?>">Завершенные</A></TD>
|
||||
<TD class=<?= (!is_null($logs)) ? "s" : "m" ?>><A
|
||||
HREF="zayavka.php?logs=<?= date("d.m.y") ?>&<?= mt_rand() ?>">Завершенные</A></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<TABLE width=100% cellspacing=0 cellpadding=0>
|
||||
@ -740,11 +708,11 @@ if (!empty($_POST['open'])) {
|
||||
if ($_POST['back2']) {
|
||||
$z = $zay->getlist(1, null, $user['zayavka']);
|
||||
AddChatSystem('Внимание!' . nick::id($user['id'])->short() . ' отозвал заявку.');
|
||||
echo $zay->delteam(2, $user['id'], $user['zayavka'], 1);
|
||||
echo $zay->delteam($user['id'], $user['zayavka'], 1);
|
||||
}
|
||||
if ($_POST['cansel']) {
|
||||
$z = $zay->getlist(1, null, $user['zayavka']);
|
||||
echo $zay->delteam(2, $z[$user['zayavka']]['team2'][0], $user['zayavka'], 1);
|
||||
echo $zay->delteam($z[$user['zayavka']]['team2'][0], $user['zayavka'], 1);
|
||||
AddChatSystem('Внимание!' . nick::id($user['id'])->short() . ' отказался от поединка.');
|
||||
}
|
||||
if ($_POST['confirm2']) {
|
||||
@ -852,11 +820,11 @@ if (!empty($_POST['open'])) {
|
||||
if (!empty($_POST['back2'])) {
|
||||
$z = $zay->getlist(2, null, $user['zayavka']);
|
||||
AddChatSystem('Внимание!' . nick::id($user['id'])->short() . ' отозвал заявку.');
|
||||
echo $zay->delteam(2, $user['id'], $user['zayavka'], 2);
|
||||
echo $zay->delteam($user['id'], $user['zayavka'], 2);
|
||||
}
|
||||
if (!empty($_POST['cansel'])) {
|
||||
$z = $zay->getlist(2, null, $user['zayavka']);
|
||||
echo $zay->delteam(2, $z[$user['zayavka']]['team2'][0], $user['zayavka'], 2);
|
||||
echo $zay->delteam($z[$user['zayavka']]['team2'][0], $user['zayavka'], 2);
|
||||
AddChatSystem('Внимание!' . nick::id($user['id'])->short() . ' отказался от поединка.');
|
||||
}
|
||||
if (!empty($_POST['confirm2']) AND empty($user['zayavka'])) {
|
||||
|
Loading…
Reference in New Issue
Block a user