Deleted sex from users table.

This commit is contained in:
Igor Barkov [iwork] 2018-11-01 12:40:06 +02:00
parent 8a1a313dca
commit 25011bd254
7 changed files with 1975 additions and 1610 deletions

View File

@ -596,46 +596,112 @@ class fbattle
$bmfkrit1 = 0; //модификаторы
// fixme что-то сделать с этой хернёй. рассчёт модификаторов работает не так!
if ($this->user['sila'] >= 25) $bmfud += 1;
if ($this->user['sila'] >= 50) $bmfud += 2; if ($this->user['sila'] >= 50) $bmfauv += 25; if ($this->user['sila'] >= 50) $bmfakrit += 25;
if ($this->user['sila'] >= 75) $bmfud += 3; if ($this->user['sila'] >= 75) $bmfauv += 30; if ($this->user['sila'] >= 75) $bmfakrit += 30;
if ($this->user['sila'] >= 100) $bmfud += 5; if ($this->user['sila'] >= 100) $bmfauv += 40; if ($this->user['sila'] >= 100) $bmfakrit += 40;
if ($this->user['sila'] >= 125) $bmfud += 11; if ($this->user['sila'] >= 125) $bmfauv += 50; if ($this->user['sila'] >= 125) $bmfakrit += 50;
if ($this->user['lovk'] >= 25) $bmfauv += 25; if ($this->user['lovk'] >= 25) $bmfakrit += 15;
if ($this->user['lovk'] >= 50) $bmfuv += 25; if ($this->user['lovk'] >= 50) $bmfauv += 25; if ($this->user['lovk'] >= 50) $bmfakrit += 10;
if ($this->user['lovk'] >= 75) $bmfuv += 40; if ($this->user['lovk'] >= 75) $bmfauv += 30; if ($this->user['lovk'] >= 75) $bmfakrit += 20;
if ($this->user['lovk'] >= 100) $bmfuv += 50; if ($this->user['lovk'] >= 100) $bmfauv += 40; if ($this->user['lovk'] >= 100) $bmfakrit += 30;
if ($this->user['lovk'] >= 125) $bmfuv += 65; if ($this->user['lovk'] >= 125) $bmfauv += 55; if ($this->user['lovk'] >= 125) $bmfakrit += 45;
if ($this->user['sila'] >= 50) $bmfud += 2;
if ($this->user['sila'] >= 50) $bmfauv += 25;
if ($this->user['sila'] >= 50) $bmfakrit += 25;
if ($this->user['sila'] >= 75) $bmfud += 3;
if ($this->user['sila'] >= 75) $bmfauv += 30;
if ($this->user['sila'] >= 75) $bmfakrit += 30;
if ($this->user['sila'] >= 100) $bmfud += 5;
if ($this->user['sila'] >= 100) $bmfauv += 40;
if ($this->user['sila'] >= 100) $bmfakrit += 40;
if ($this->user['sila'] >= 125) $bmfud += 11;
if ($this->user['sila'] >= 125) $bmfauv += 50;
if ($this->user['sila'] >= 125) $bmfakrit += 50;
if ($this->user['lovk'] >= 25) $bmfauv += 25;
if ($this->user['lovk'] >= 25) $bmfakrit += 15;
if ($this->user['lovk'] >= 50) $bmfuv += 25;
if ($this->user['lovk'] >= 50) $bmfauv += 25;
if ($this->user['lovk'] >= 50) $bmfakrit += 10;
if ($this->user['lovk'] >= 75) $bmfuv += 40;
if ($this->user['lovk'] >= 75) $bmfauv += 30;
if ($this->user['lovk'] >= 75) $bmfakrit += 20;
if ($this->user['lovk'] >= 100) $bmfuv += 50;
if ($this->user['lovk'] >= 100) $bmfauv += 40;
if ($this->user['lovk'] >= 100) $bmfakrit += 30;
if ($this->user['lovk'] >= 125) $bmfuv += 65;
if ($this->user['lovk'] >= 125) $bmfauv += 55;
if ($this->user['lovk'] >= 125) $bmfakrit += 45;
if ($this->user['inta'] >= 25) $bmfauv += 15;
if ($this->user['inta'] >= 50) $bmfkrit += 20; if ($this->user['inta'] >= 50) $bmfauv += 25; if ($this->user['inta'] >= 50) $bmfakrit += 25;
if ($this->user['inta'] >= 75) $bmfkrit += 30; if ($this->user['inta'] >= 75) $bmfauv += 30; if ($this->user['inta'] >= 75) $bmfakrit += 30;
if ($this->user['inta'] >= 100) $bmfkrit += 40; if ($this->user['inta'] >= 100) $bmfauv += 40; if ($this->user['inta'] >= 100) $bmfakrit += 40;
if ($this->user['inta'] >= 125) $bmfkrit += 55; if ($this->user['inta'] >= 125) $bmfauv += 55; if ($this->user['inta'] >= 125) $bmfakrit += 55;
if ($this->user['inta'] >= 50) $bmfkrit += 20;
if ($this->user['inta'] >= 50) $bmfauv += 25;
if ($this->user['inta'] >= 50) $bmfakrit += 25;
if ($this->user['inta'] >= 75) $bmfkrit += 30;
if ($this->user['inta'] >= 75) $bmfauv += 30;
if ($this->user['inta'] >= 75) $bmfakrit += 30;
if ($this->user['inta'] >= 100) $bmfkrit += 40;
if ($this->user['inta'] >= 100) $bmfauv += 40;
if ($this->user['inta'] >= 100) $bmfakrit += 40;
if ($this->user['inta'] >= 125) $bmfkrit += 55;
if ($this->user['inta'] >= 125) $bmfauv += 55;
if ($this->user['inta'] >= 125) $bmfakrit += 55;
if ($this->user['vinos'] >= 25) $bmfbron += 2;
if ($this->user['vinos'] >= 50) $bmfauv += 25; if ($this->user['vinos'] >= 50) $bmfbron += 2; if ($this->user['vinos'] >= 50) $bmfakrit += 25;
if ($this->user['vinos'] >= 75) $bmfauv += 30; if ($this->user['vinos'] >= 75) $bmfbron += 3; if ($this->user['vinos'] >= 75) $bmfakrit += 30;
if ($this->user['vinos'] >= 100) $bmfauv += 40; if ($this->user['vinos'] >= 100) $bmfbron += 5; if ($this->user['vinos'] >= 100) $bmfakrit += 40;
if ($this->user['vinos'] >= 125) $bmfauv += 55; if ($this->user['vinos'] >= 125) $bmfbron += 8; if ($this->user['vinos'] >= 125) $bmfakrit += 55;
if ($this->user['vinos'] >= 50) $bmfauv += 25;
if ($this->user['vinos'] >= 50) $bmfbron += 2;
if ($this->user['vinos'] >= 50) $bmfakrit += 25;
if ($this->user['vinos'] >= 75) $bmfauv += 30;
if ($this->user['vinos'] >= 75) $bmfbron += 3;
if ($this->user['vinos'] >= 75) $bmfakrit += 30;
if ($this->user['vinos'] >= 100) $bmfauv += 40;
if ($this->user['vinos'] >= 100) $bmfbron += 5;
if ($this->user['vinos'] >= 100) $bmfakrit += 40;
if ($this->user['vinos'] >= 125) $bmfauv += 55;
if ($this->user['vinos'] >= 125) $bmfbron += 8;
if ($this->user['vinos'] >= 125) $bmfakrit += 55;
if ($this->enemyhar['sila'] >= 25) $bmfud += 1;
if ($this->enemyhar['sila'] >= 50) $bmfud += 2; if ($this->enemyhar['sila'] >= 50) $bmfauv += 25; if ($this->enemyhar['sila'] >= 50) $bmfakrit += 25;
if ($this->enemyhar['sila'] >= 75) $bmfud += 3; if ($this->enemyhar['sila'] >= 75) $bmfauv += 30; if ($this->enemyhar['sila'] >= 75) $bmfakrit += 30;
if ($this->enemyhar['sila'] >= 100) $bmfud += 5; if ($this->enemyhar['sila'] >= 100) $bmfauv += 40; if ($this->enemyhar['sila'] >= 100) $bmfakrit += 40;
if ($this->enemyhar['sila'] >= 125) $bmfud += 11; if ($this->enemyhar['sila'] >= 125) $bmfauv += 65; if ($this->enemyhar['sila'] >= 125) $bmfakrit += 65;
if ($this->enemyhar['lovk'] >= 25) $bmfauv += 25; if ($this->enemyhar['lovk'] >= 25) $bmfakrit += 15;
if ($this->enemyhar['lovk'] >= 50) $bmfuv += 25; if ($this->enemyhar['lovk'] >= 50) $bmfauv += 25; if ($this->enemyhar['lovk'] >= 50) $bmfakrit += 10;
if ($this->enemyhar['lovk'] >= 75) $bmfuv += 40; if ($this->enemyhar['lovk'] >= 75) $bmfauv += 30; if ($this->enemyhar['lovk'] >= 75) $bmfakrit += 20;
if ($this->enemyhar['lovk'] >= 100) $bmfuv += 50; if ($this->enemyhar['lovk'] >= 100) $bmfauv += 40; if ($this->enemyhar['lovk'] >= 100) $bmfakrit += 30;
if ($this->enemyhar['lovk'] >= 125) $bmfuv += 65; if ($this->enemyhar['lovk'] >= 125) $bmfauv += 55; if ($this->enemyhar['lovk'] >= 125) $bmfakrit += 45;
if ($this->enemyhar['sila'] >= 50) $bmfud += 2;
if ($this->enemyhar['sila'] >= 50) $bmfauv += 25;
if ($this->enemyhar['sila'] >= 50) $bmfakrit += 25;
if ($this->enemyhar['sila'] >= 75) $bmfud += 3;
if ($this->enemyhar['sila'] >= 75) $bmfauv += 30;
if ($this->enemyhar['sila'] >= 75) $bmfakrit += 30;
if ($this->enemyhar['sila'] >= 100) $bmfud += 5;
if ($this->enemyhar['sila'] >= 100) $bmfauv += 40;
if ($this->enemyhar['sila'] >= 100) $bmfakrit += 40;
if ($this->enemyhar['sila'] >= 125) $bmfud += 11;
if ($this->enemyhar['sila'] >= 125) $bmfauv += 65;
if ($this->enemyhar['sila'] >= 125) $bmfakrit += 65;
if ($this->enemyhar['lovk'] >= 25) $bmfauv += 25;
if ($this->enemyhar['lovk'] >= 25) $bmfakrit += 15;
if ($this->enemyhar['lovk'] >= 50) $bmfuv += 25;
if ($this->enemyhar['lovk'] >= 50) $bmfauv += 25;
if ($this->enemyhar['lovk'] >= 50) $bmfakrit += 10;
if ($this->enemyhar['lovk'] >= 75) $bmfuv += 40;
if ($this->enemyhar['lovk'] >= 75) $bmfauv += 30;
if ($this->enemyhar['lovk'] >= 75) $bmfakrit += 20;
if ($this->enemyhar['lovk'] >= 100) $bmfuv += 50;
if ($this->enemyhar['lovk'] >= 100) $bmfauv += 40;
if ($this->enemyhar['lovk'] >= 100) $bmfakrit += 30;
if ($this->enemyhar['lovk'] >= 125) $bmfuv += 65;
if ($this->enemyhar['lovk'] >= 125) $bmfauv += 55;
if ($this->enemyhar['lovk'] >= 125) $bmfakrit += 45;
if ($this->enemyhar['inta'] >= 25) $bmfauv += 15;
if ($this->enemyhar['inta'] >= 50) $bmfkrit += 20; if ($this->enemyhar['inta'] >= 50) $bmfauv += 25; if ($this->enemyhar['inta'] >= 50) $bmfakrit += 25;
if ($this->enemyhar['inta'] >= 75) $bmfkrit += 30; if ($this->enemyhar['inta'] >= 75) $bmfauv += 30; if ($this->enemyhar['inta'] >= 75) $bmfakrit += 30;
if ($this->enemyhar['inta'] >= 100) $bmfkrit += 40; if ($this->enemyhar['inta'] >= 100) $bmfauv += 40; if ($this->enemyhar['inta'] >= 100) $bmfakrit += 40;
if ($this->enemyhar['inta'] >= 125) $bmfkrit += 55; if ($this->enemyhar['inta'] >= 125) $bmfauv += 55; if ($this->enemyhar['inta'] >= 125) $bmfakrit += 55;
if ($this->enemyhar['inta'] >= 50) $bmfkrit += 20;
if ($this->enemyhar['inta'] >= 50) $bmfauv += 25;
if ($this->enemyhar['inta'] >= 50) $bmfakrit += 25;
if ($this->enemyhar['inta'] >= 75) $bmfkrit += 30;
if ($this->enemyhar['inta'] >= 75) $bmfauv += 30;
if ($this->enemyhar['inta'] >= 75) $bmfakrit += 30;
if ($this->enemyhar['inta'] >= 100) $bmfkrit += 40;
if ($this->enemyhar['inta'] >= 100) $bmfauv += 40;
if ($this->enemyhar['inta'] >= 100) $bmfakrit += 40;
if ($this->enemyhar['inta'] >= 125) $bmfkrit += 55;
if ($this->enemyhar['inta'] >= 125) $bmfauv += 55;
if ($this->enemyhar['inta'] >= 125) $bmfakrit += 55;
if ($this->enemyhar['vinos'] >= 25) $bmfbron += 2;
if ($this->enemyhar['vinos'] >= 50) $bmfauv += 25; if ($this->enemyhar['vinos'] >= 50) $bmfbron += 2; if ($this->enemyhar['vinos'] >= 50) $bmfakrit += 25;
if ($this->enemyhar['vinos'] >= 75) $bmfauv += 30; if ($this->enemyhar['vinos'] >= 75) $bmfbron += 3; if ($this->enemyhar['vinos'] >= 75) $bmfakrit += 30;
if ($this->enemyhar['vinos'] >= 100) $bmfauv += 40; if ($this->enemyhar['vinos'] >= 100) $bmfbron += 5; if ($this->enemyhar['vinos'] >= 100) $bmfakrit += 40;
if ($this->enemyhar['vinos'] >= 125) $bmfauv += 55; if ($this->enemyhar['vinos'] >= 125) $bmfbron += 8; if ($this->enemyhar['vinos'] >= 125) $bmfakrit += 55;
if ($this->enemyhar['vinos'] >= 50) $bmfauv += 25;
if ($this->enemyhar['vinos'] >= 50) $bmfbron += 2;
if ($this->enemyhar['vinos'] >= 50) $bmfakrit += 25;
if ($this->enemyhar['vinos'] >= 75) $bmfauv += 30;
if ($this->enemyhar['vinos'] >= 75) $bmfbron += 3;
if ($this->enemyhar['vinos'] >= 75) $bmfakrit += 30;
if ($this->enemyhar['vinos'] >= 100) $bmfauv += 40;
if ($this->enemyhar['vinos'] >= 100) $bmfbron += 5;
if ($this->enemyhar['vinos'] >= 100) $bmfakrit += 40;
if ($this->enemyhar['vinos'] >= 125) $bmfauv += 55;
if ($this->enemyhar['vinos'] >= 125) $bmfbron += 8;
if ($this->enemyhar['vinos'] >= 125) $bmfakrit += 55;
//*************
@ -764,12 +830,24 @@ class fbattle
{
$wep = db::c()->query('SELECT `otdel` FROM `inventory` WHERE `id` = ?i', $idwep)->fetch_assoc();
switch ($wep['otdel']) {
case 1: return "noj"; break;
case 11: return "topor"; break;
case 12: return "dubina"; break;
case 13: return "mech"; break;
case 14: return "priklad"; break; //???
default: return "kulak"; break;
case 1:
return "noj";
break;
case 11:
return "topor";
break;
case 12:
return "dubina";
break;
case 13:
return "mech";
break;
case 14:
return "priklad";
break; //???
default:
return "kulak";
break;
}
}
@ -780,7 +858,7 @@ class fbattle
*/
function get_chanse($persent)
{
if (rand(1, 100) <= $persent ) {
if (rand(1, 100) <= $persent) {
return true;
} else {
return false;
@ -1041,11 +1119,11 @@ class fbattle
foreach ($this->battle as $k => $v) {
if ($k > _BOTSEPARATOR_) {
$bots = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `id` = ' . $k . ' LIMIT 1;'));
$us = mysql_fetch_array(mysql_query('SELECT `hp`, `maxhp`, `sex`,`id`,`battle` FROM `users` WHERE `id` = ' . $bots['prototype'] . ' LIMIT 1;'));
$us = mysql_fetch_array(mysql_query('SELECT `hp`, `maxhp`, `id`,`battle` FROM `users` WHERE `id` = ' . $bots['prototype'] . ' LIMIT 1;'));
$us['hp'] = $bots['hp'];
$us['battle'] = $bots['battle'];
} else {
$us = mysql_fetch_array(mysql_query('SELECT `hp`, `maxhp`, `sex`,`id`,`battle` FROM `users` WHERE `id` = ' . $k . ' LIMIT 1;'));
$us = mysql_fetch_array(mysql_query('SELECT `hp`, `maxhp`, `id`,`battle` FROM `users` WHERE `id` = ' . $k . ' LIMIT 1;'));
}
if ($us && (int)$us['hp'] <= 0) {
//$battle_data = mysql_fetch_array(mysql_query ('SELECT * FROM `battle` WHERE `id` = '.$this->user['battle'].' LIMIT 1;'));
@ -1054,11 +1132,9 @@ class fbattle
//$war=array_keys($war);
// if(in_array($k,$war)) {
unset($this->battle[$k]);
if ($us['sex'] == 1) {
$this->add_log('<span class=date>' . date("H:i") . '</span> ' . nick5($k, 'b') . ' проиграл бой!<BR>');
} else {
$this->add_log('<span class=date>' . date("H:i") . '</span> ' . nick5($k, 'b') . ' проиграла бой!<BR>');
}
$this->add_log('<span class=date>' . date("H:i") . '</span> ' . nick5($k, 'b') . ' проиграл бой!<BR>');
mysql_query('UPDATE `users` SET `hp` = 0, `fullhptime` = ' . time() . ' WHERE `id` = \'' . $k . '\' LIMIT 1;');
foreach ($this->battle as $kak => $vav) {
unset($this->battle[$kak][$k]);
@ -1952,7 +2028,7 @@ class fbattle
$mfit = 1.5;
}
$pls = count($this->t1) + count($this->t2);
$pls = count($this->t1) + count($this->t2);
if ($pls > 2) {
$mfbot = $bot_active == true ? 0.3 : 1;
$mfbot2 = $bot_def == true ? 0.7 : 1;

File diff suppressed because one or more lines are too long

View File

@ -339,7 +339,7 @@ if($_GET['start']){
$level = 0;
while($nana = mysql_fetch_array($zax)) {
$n_login = $nana['login'];
$rty = mysql_query("SELECT `id`, `level`, `login`, `sex`, `shadow`, `money`, `hp` FROM `users` WHERE `login` = '$n_login' LIMIT 1");
$rty = mysql_query("SELECT `id`, `level`, `login`, `shadow`, `money`, `hp` FROM `users` WHERE `login` = '$n_login' LIMIT 1");
$esth = mysql_fetch_array($rty);
if($esth['hp'] <= 0) { $esth['hp'] = 1; mysql_query('UPDATE `users` SET `hp` = "'.$esth['hp'].'" WHERE `id` = "'.$esth['id'].'" LIMIT 1'); }
if($nana['fee']) {
@ -366,7 +366,7 @@ if($_GET['start']){
$vrem = 30*60+time();
include_once("cavedata.php");
mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '$esth[sex]/0.png', `x` = '".$cavedata[$user['room']+1]['x1']."', `y` = '".$cavedata[$user['room']+1]['y1']."', `dir` = '".$cavedata[$user['room']+1]['dir1']."', `floor` = 1");
mysql_query("INSERT INTO `caveparties` SET `user` = '$esth[id]', `leader` = '$user[id]', `login` = '$esth[login]', `shadow` = '0.png', `x` = '".$cavedata[$user['room']+1]['x1']."', `y` = '".$cavedata[$user['room']+1]['y1']."', `dir` = '".$cavedata[$user['room']+1]['dir1']."', `floor` = 1");
mysql_query("UPDATE `users`, `online` SET ".($nc?"`users`.`caveleader` = '$user[id]', ":"")." `users`.`room` = '".($user['room']+1)."', `online`.`room` = '".($user['room']+1)."' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$esth['id']."'");
}

View File

@ -1,11 +1,11 @@
<?php
session_start();
include('config.php');
if ($_SESSION['uid'] == null) header("Location: index.php");
$user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc();
$sleep = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND `time` > ?i AND `type` = 3', $user['id'], time())->fetch_assoc();
if (!empty($_SESSION['uid'])) {
$user = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc();
$sleep = db::c()->query('SELECT `id` FROM `effects` WHERE `owner` = ?i AND `time` > ?i AND `type` = 3', $user['id'], time())->fetch_assoc();
} else $user = $sleep = [];
if (!isset($_GET['page'])) {
$ps = 0;
@ -453,7 +453,8 @@ if (isset($_GET['do']) && $isModerator == true) {
echo $pages_str;
?>
<div id="leaf<?= $row['id'] ?>" style="background-color: #ddd;margin: 2px;padding:5px;overflow-x: auto;word-wrap: break-word;box-shadow: 1px 2px 3px #ccc;">
<div id="leaf<?= $row['id'] ?>"
style="background-color: #ddd;margin: 2px;padding:5px;overflow-x: auto;word-wrap: break-word;box-shadow: 1px 2px 3px #ccc;">
<span class="topicTitle">
<img src="i/forum/icon<?= $icons ?>.gif"> <?= $row['topic'] ?>
</span>
@ -486,7 +487,8 @@ if (isset($_GET['do']) && $isModerator == true) {
if (empty($_GET['page'])) $_GET['page'] = "";
$data = db::c()->query('SELECT * FROM `forum` WHERE `parent` = "?s" ORDER BY `id` ASC LIMIT ?i,20', $_GET['topic'], ($_GET['page'] * 20));
while ($row = $data->fetch_assoc()): ?>
<div id="leaf<?= $row['id'] ?>" style="background-color: #ddd;margin: 2px;padding:5px;overflow-x: auto;word-wrap: break-word;box-shadow: 1px 2px 3px #ccc;">
<div id="leaf<?= $row['id'] ?>"
style="background-color: #ddd;margin: 2px;padding:5px;overflow-x: auto;word-wrap: break-word;box-shadow: 1px 2px 3px #ccc;">
<div class="mesTopBar">
<table width="100%">
<tr>
@ -511,7 +513,7 @@ if (isset($_GET['do']) && $isModerator == true) {
<?php if ($isAdmin): ?>
<a href="javascript:void(0);" class="contact"
id="<?= $row['id'] ?>">
<small>Редактировать</small>
<small>Редактировать</small>
</a>
<?php endif; ?>
</td>

View File

@ -574,7 +574,7 @@ header("Cache-Control: no-cache");
function level_up($uid)
{
global $exptable;
$us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `sex`, `exp`, `vinos`, `nextup`, `stats`, `master`, `maxhp`, `refer`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc();
$us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `exp`, `vinos`, `nextup`, `stats`, `master`, `maxhp`, `refer`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc();
if (isset($us['id'])) {
if ($us['exp'] >= $us['nextup'] && !$us['in_tower']) {
if ($exptable[$us['nextup']][4] == 1) {

View File

@ -1,46 +1,31 @@
<?php
// magic идентификацыя
//if (rand(1,2)==1) {
if ($_SESSION['uid'] == null) header("Location: index.php");
if ($_SESSION['uid'] == null) header("Location: index.php");
$m = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`married`,`sex`,`login` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
$w = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`married`,`sex`,`login` FROM `users` WHERE `login` = '{$_POST['target1']}' LIMIT 1;"));
$muzh = mysql_real_escape_string($_POST['target']);
$zhena = mysql_real_escape_string($_POST['target1']);
if ($m['id'] and $w['id']) {
if ($m['married']) {
echo "<font color=red><b>Персонаж ".$_POST['target']." уже состоит в браке!<b></font>";
}
elseif ($w['married']) {
echo "<font color=red><b>Персонаж ".$_POST['target1']." уже состоит в браке!<b></font>";
}
elseif ($m['sex'] != 1) {
echo "<font color=red><b>Неправильный пол жениха!<b></font>";
}
elseif ($w['sex'] != 0) {
echo "<font color=red><b>Неправильный пол невесты!<b></font>";
}
else {
if (($user['align'] > '2' && $user['align'] < '3') || ($user['align'] > '1.6' && $user['align'] < '2')) {
if (mysql_query("UPDATE `users` SET `married`='{$_POST['target1']}' WHERE `id` = '{$m['id']}' LIMIT 1;") && mysql_query("UPDATE `users` SET `married`='{$_POST['target']}' WHERE `id` = '{$w['id']}' LIMIT 1;")) {
$mess="Регистрация брака между &quot;$muzh&quot; и &quot;$zhena&quot;, регистратор &quot;{$user['login']}&quot;.";
mysql_query("INSERT INTO `lichka`(`pers`,`text`,`date`) VALUES ('".$m['id']."','$mess','".time()."');");
mysql_query("INSERT INTO `lichka`(`pers`,`text`,`date`) VALUES ('".$w['id']."','$mess','".time()."');");
mysql_query("INSERT INTO `paldelo`(`author`,`text`,`date`) VALUES ('".$_SESSION['uid']."','$mess','".time()."');");
echo "<font color=red><b>Успешно зарегистрирован брак между \"$muzh\" и \"$zhena\"!</b></font>";
}
else {
echo "<font color=red><b>Произошла ошибка!<b></font>";
}
}
else {
echo "<font color=red><b>Вы не можете зарегистрировать брак!<b></font>";
}
}
}
else {
echo "<font color=red><b>Персонаж \"$muzh\" или \"$zhena\" не существует!<b></font>";
}
$m = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`married`,`login` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
$w = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`married`,`login` FROM `users` WHERE `login` = '{$_POST['target1']}' LIMIT 1;"));
$muzh = mysql_real_escape_string($_POST['target']);
$zhena = mysql_real_escape_string($_POST['target1']);
if ($m['id'] and $w['id']) {
if ($m['married']) {
echo "<font color=red><b>Персонаж " . $_POST['target'] . " уже состоит в браке!<b></font>";
} elseif ($w['married']) {
echo "<font color=red><b>Персонаж " . $_POST['target1'] . " уже состоит в браке!<b></font>";
} else {
if (($user['align'] > '2' && $user['align'] < '3') || ($user['align'] > '1.6' && $user['align'] < '2')) {
if (mysql_query("UPDATE `users` SET `married`='{$_POST['target1']}' WHERE `id` = '{$m['id']}' LIMIT 1;") && mysql_query("UPDATE `users` SET `married`='{$_POST['target']}' WHERE `id` = '{$w['id']}' LIMIT 1;")) {
$mess = "Регистрация брака между &quot;$muzh&quot; и &quot;$zhena&quot;, регистратор &quot;{$user['login']}&quot;.";
mysql_query("INSERT INTO `lichka`(`pers`,`text`,`date`) VALUES ('" . $m['id'] . "','$mess','" . time() . "');");
mysql_query("INSERT INTO `lichka`(`pers`,`text`,`date`) VALUES ('" . $w['id'] . "','$mess','" . time() . "');");
mysql_query("INSERT INTO `paldelo`(`author`,`text`,`date`) VALUES ('" . $_SESSION['uid'] . "','$mess','" . time() . "');");
echo "<font color=red><b>Успешно зарегистрирован брак между \"$muzh\" и \"$zhena\"!</b></font>";
} else {
echo "<font color=red><b>Произошла ошибка!<b></font>";
}
} else {
echo "<font color=red><b>Вы не можете зарегистрировать брак!<b></font>";
}
}
} else {
echo "<font color=red><b>Персонаж \"$muzh\" или \"$zhena\" не существует!<b></font>";
}
?>

View File

@ -1,46 +1,30 @@
<?php
// magic идентификацыя
//if (rand(1,2)==1) {
if ($_SESSION['uid'] == null) header("Location: index.php");
if ($_SESSION['uid'] == null) header("Location: index.php");
$m = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`married`,`login` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
$w = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`married`,`login` FROM `users` WHERE `login` = '{$_POST['target1']}' LIMIT 1;"));
$m = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`married`,`sex`,`login` FROM `users` WHERE `login` = '{$_POST['target']}' LIMIT 1;"));
$w = mysql_fetch_array(mysql_query("SELECT `id`,`align`,`married`,`sex`,`login` FROM `users` WHERE `login` = '{$_POST['target1']}' LIMIT 1;"));
$muzh=$_POST['target'];
$zhena=$_POST['target1'];
if ($m['id'] and $w['id']) {
if ($m['married'] != $_POST['target1']) {
echo "<font color=red><b>Персонаж ".$_POST['target']." не состоит в браке с ".$_POST['target1']."!<b></font>";
}
elseif ($w['married'] != $_POST['target']) {
echo "<font color=red><b>Персонаж ".$_POST['target1']." не состоит в браке с ".$_POST['target']."!<b></font>";
}
elseif ($m['sex'] != 1) {
echo "<font color=red><b>Неправильный пол жениха!<b></font>";
}
elseif ($w['sex'] != 0) {
echo "<font color=red><b>Неправильный пол невесты!<b></font>";
}
else {
if (($user['align'] > '2' && $user['align'] < '3') || ($user['align'] > '1.6' && $user['align'] < '2')) {
if (mysql_query("UPDATE `users` SET `married`='' WHERE `id` = '{$m['id']}' LIMIT 1;") && mysql_query("UPDATE `users` SET `married`='' WHERE `id` = '{$w['id']}' LIMIT 1;")) {
$mess="Расторжение брака между &quot;$muzh&quot; и &quot;$zhena&quot;, регистратор &quot;{$user['login']}&quot;.";
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$m['id']."','$mess','".time()."');");
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','".$w['id']."','$mess','".time()."');");
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','".$_SESSION['uid']."','$mess','".time()."');");
echo "<font color=red><b>Успешно расторгнут брак между \"$muzh\" и \"$zhena\"!</b></font>";
}
else {
echo "<font color=red><b>Произошла ошибка!<b></font>";
}
}
else {
echo "<font color=red><b>Вы не можете расторгнуть брак!<b></font>";
}
}
}
else {
echo "<font color=red><b>Персонаж \"$muzh\" или \"$zhena\" не существует!<b></font>";
}
if ($m['id'] and $w['id']) {
if ($m['married'] != $_POST['target1']) {
echo "<font color=red><b>Персонаж " . $_POST['target'] . " не состоит в браке с " . $_POST['target1'] . "!<b></font>";
} elseif ($w['married'] != $_POST['target']) {
echo "<font color=red><b>Персонаж " . $_POST['target1'] . " не состоит в браке с " . $_POST['target'] . "!<b></font>";
} else {
if (($user['align'] > '2' && $user['align'] < '3') || ($user['align'] > '1.6' && $user['align'] < '2')) {
if (mysql_query("UPDATE `users` SET `married`='' WHERE `id` = '{$m['id']}' LIMIT 1;") && mysql_query("UPDATE `users` SET `married`='' WHERE `id` = '{$w['id']}' LIMIT 1;")) {
$mess = "Расторжение брака между &quot;{$m['login']}&quot; и &quot;{$w['login']}&quot;, регистратор &quot;{$user['login']}&quot;.";
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $m['id'] . "','$mess','" . time() . "');");
mysql_query("INSERT INTO `lichka`(`id`,`pers`,`text`,`date`) VALUES ('','" . $w['id'] . "','$mess','" . time() . "');");
mysql_query("INSERT INTO `paldelo`(`id`,`author`,`text`,`date`) VALUES ('','" . $_SESSION['uid'] . "','$mess','" . time() . "');");
echo "<font color=red><b>Успешно расторгнут брак между \"$muzh\" и \"$zhena\"!</b></font>";
} else {
echo "<font color=red><b>Произошла ошибка!<b></font>";
}
} else {
echo "<font color=red><b>Вы не можете расторгнуть брак!<b></font>";
}
}
} else {
echo "<font color=red><b>Персонаж \"$muzh\" или \"$zhena\" не существует!<b></font>";
}
?>