Code cleanup
This commit is contained in:
parent
c104c339b6
commit
2767cf3665
@ -1,48 +1,41 @@
|
||||
<?php
|
||||
// magic идентификацыя
|
||||
//if (rand(1,2)==1) {
|
||||
if ($_SESSION['uid'] == null) header("Location: index.php");
|
||||
|
||||
if ($_SESSION['uid'] == null) header("Location: index.php");
|
||||
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target=$_POST['target'];
|
||||
if ($tar['id']) {
|
||||
$tar = mysql_fetch_array(mysql_query("SELECT `id`,`align` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
|
||||
$target = $_POST['target'];
|
||||
if ($tar['id']) {
|
||||
if ($tar['align'] > '1' && $tar['align'] < '2') {
|
||||
$ok=0;
|
||||
$ok = 0;
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$ok=1;
|
||||
}
|
||||
elseif (($user['align'] == '1.99') && ($tar['align'] != '1.99')) {
|
||||
$ok=1;
|
||||
$ok = 1;
|
||||
} elseif (($user['align'] == '1.99') && ($tar['align'] != '1.99')) {
|
||||
$ok = 1;
|
||||
}
|
||||
if ($ok == 1) {
|
||||
if (mysql_query("UPDATE `users` SET `align`='0' WHERE `id` = {$tar['id']} LIMIT 1;")) {
|
||||
if ($user['sex'] == 1) {$action="лишил";}
|
||||
else {$action="лишила";}
|
||||
if ($user['sex'] == 1) {
|
||||
$action = "лишил";
|
||||
} else {
|
||||
$action = "лишила";
|
||||
}
|
||||
if ($user['align'] > '2' && $user['align'] < '3') {
|
||||
$angel="Ангел";
|
||||
$angel = "Ангел";
|
||||
} elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel = "Паладин";
|
||||
}
|
||||
elseif ($user['align'] > '1' && $user['align'] < '2') {
|
||||
$angel="Паладин";
|
||||
}
|
||||
$mess="$angel "{$user['login']}" $action "$target" звания "Паладина".";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$tar['id']."','$mess','".time()."');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
|
||||
$mess = "$angel "{$user['login']}" $action "$target" звания "Паладина".";
|
||||
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $tar['id'] . "','$mess','" . time() . "');");
|
||||
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
|
||||
echo "<font color=red><b>Персонаж \"$target\" лишен звания \"Паладина\"</b></font>";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
echo "<font color=red><b>Произошла ошибка!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
echo "<font color=red><b>Вы не можете снять крест этого персонажа!<b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не состоит в Ордене </b></font>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
echo "<font color=red><b>Персонаж \"$target\" не существует!<b></font>";
|
||||
}
|
||||
?>
|
||||
}
|
Loading…
Reference in New Issue
Block a user