@@ -852,8 +843,7 @@ if ($_POST['login'] && $_POST['krest']) {
}
if ($_POST['krest'] == -1) {
db::c()->query('UPDATE `users` SET `align`="?s", `status`="?s" WHERE `login` = "?s" LIMIT 1;', '0', '', $_POST['login']);
- }
- else {
+ } else {
db::c()->query('UPDATE `users` SET `align` = "?s", `status` = "?s" WHERE `login` = "?s"', $_POST['krest'], $rang, $_POST['login']);
}
}
@@ -1106,7 +1096,4 @@ if ($_POST['login'] && $_POST['krest']) {
}
return xmlHttp1;
}
-
-
-
-
+
\ No newline at end of file
diff --git a/admin/edit_user.php b/admin/edit_user.php
index 3dd2158..01cce2b 100644
--- a/admin/edit_user.php
+++ b/admin/edit_user.php
@@ -45,15 +45,8 @@ if ($del) {
}
db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $del);
}
+Template::header('ᐰdminка инвентаря');
?>
-
-
-
-
-
ᐰdmin
-
-
-
Администрирование инвентаря
@@ -95,6 +88,4 @@ if ($del) {
-
-
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/admin/reset_clan_rates.php b/admin/reset_clan_rates.php
deleted file mode 100644
index df4207a..0000000
--- a/admin/reset_clan_rates.php
+++ /dev/null
@@ -1,28 +0,0 @@
-
-/**
- * Copyright (c) 2018.
- * Author: Igor Barkov
- * Project name: Battles-Game
- */
-
-require_once "../functions.php";
-$id = mysql_query("SELECT * FROM `clans`");
-$clans = mysql_num_rows($id);
-$check = 0;
-while($check++ < $clans) {
- $shor = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$check}' LIMIT 1"));
- $short = $shor['short'];
- $exp = mysql_fetch_row(mysql_query("SELECT `exp`, COUNT(*) FROM `users` WHERE `klan` = '{$short}'"));
- $id = mysql_query("SELECT `id` FROM `users` WHERE `klan` = '{$short}'");
- $kolvo_us = mysql_num_rows($id);
- echo "$exp[0];||$kolvo_us Q";
- $site_r_clan = 0; // рейтинг клан сайта
- $fight_r_clan = 0; // боевой рейтинг клана
- $grash_point = 0; // очки гражданства
- $Clan_ration = (($exp/$kolvo_us)+($site_r_clan*100000))+$fight_r_clan+$grash_point;
- $l_p = mysql_query("UPDATE `clans` SET `rating` = 'Clan_ration' WHERE `id` = '{$check}'");
- if($l_p) {
- echo "Клановый рейтинг для клана '$short' удачно обновлен";
- }
-}
-
diff --git a/buttons.php b/buttons.php
index c161f28..dbc8d1a 100644
--- a/buttons.php
+++ b/buttons.php
@@ -13,7 +13,6 @@ if ($header) {
} elseif ($ch != null) {
Template::header('buttons');
?>
-
diff --git a/buy_klan.php b/buy_klan.php
index 33a69f6..b33c4e0 100644
--- a/buy_klan.php
+++ b/buy_klan.php
@@ -17,7 +17,7 @@ function add_klan_abil($ab, $cost)
{
global $user, $banks;
$clan = mysql_fetch_array(mysql_query('SELECT `id`, `glava` FROM `clans` WHERE `id` = "' . $user['klan'] . '"'));
- if (isset($ab && $banks['ekr'] >= $cost && $clan['glava'] == $user['id'])) {
+ if (isset($ab) && $banks['ekr'] >= $cost && $clan['glava'] == $user['id']) {
$isset = mysql_fetch_array(mysql_query('SELECT `id`, `' . $ab . '` FROM `abils_klan` WHERE `klan` = "' . $user['klan'] . '"'));
$isset[$ab] += 1;
mysql_query('UPDATE `abils_klan` SET `' . $ab . '` = "' . $isset[$ab] . '" WHERE `klan` = "' . $user['klan'] . '"');
diff --git a/canalizaciya.php b/canalizaciya.php
index 2917730..a3ba215 100644
--- a/canalizaciya.php
+++ b/canalizaciya.php
@@ -7,826 +7,1018 @@ if (empty($_SESSION['uid'])) {
require_once "functions.php";
$user = $user ?? null;
if ($user->room == 403) {
-include "startpodzemel.php";
+ include "startpodzemel.php";
if ($user->battle != 0) {
header('location: fbattle.php');
exit;
}
- if($_GET['act'] == "cexit") {
- $das=mysql_query("select glava,glav_id from `labirint` where user_id='".$user['id']."'");
- $rf=mysql_fetch_array($das);
- $glav_id=$rf["glav_id"];
- $glava=$rf["glava"];
- if($glava==$user['login']) {
- $des=mysql_query("select login,user_id from `labirint` where `glav_id`='$glav_id' and `login`!='$glava'");
- $r=0;
- while($raf=mysql_fetch_array($des)){
+ if ($_GET['act'] == "cexit") {
+ $das = mysql_query("select glava,glav_id from `labirint` where user_id='" . $user['id'] . "'");
+ $rf = mysql_fetch_array($das);
+ $glav_id = $rf["glav_id"];
+ $glava = $rf["glava"];
+ if ($glava == $user['login']) {
+ $des = mysql_query("select login,user_id from `labirint` where `glav_id`='$glav_id' and `login`!='$glava'");
+ $r = 0;
+ while ($raf = mysql_fetch_array($des)) {
$r++;
$log = $raf["login"];
$id_us = $raf["user_id"];
}
- if($r>=1){
- mysql_query("UPDATE labirint SET glav_id='$id_us',glava='$log' WHERE glav_id='".$user['id']."'");
- mysql_query("UPDATE podzem3 SET glava='$log' WHERE glava='".$user['login']."'");
+ if ($r >= 1) {
+ mysql_query("UPDATE labirint SET glav_id='$id_us',glava='$log' WHERE glav_id='" . $user['id'] . "'");
+ mysql_query("UPDATE podzem3 SET glava='$log' WHERE glava='" . $user['login'] . "'");
} else {
- mysql_query("DELETE FROM labirint WHERE glav_id='".$user['id']."'");
- mysql_query("DELETE FROM podzem3 WHERE glava='".$user['login']."'");
- mysql_query("DELETE FROM podzem4 WHERE glava='".$user['login']."'");
+ mysql_query("DELETE FROM labirint WHERE glav_id='" . $user['id'] . "'");
+ mysql_query("DELETE FROM podzem3 WHERE glava='" . $user['login'] . "'");
+ mysql_query("DELETE FROM podzem4 WHERE glava='" . $user['login'] . "'");
$items_to_delete = [
- 'Подземное зелье жизни',
- 'Ключик №1',
- 'Ключик №2',
- 'Ключик №3',
- 'Ключик №4',
- 'Ключик №5',
- 'Ключик №6',
- 'Ключик №7',
- 'Ключик №8',
- 'Ключик №9',
- 'Ключик №10'
- ];
+ 'Подземное зелье жизни',
+ 'Ключик №1',
+ 'Ключик №2',
+ 'Ключик №3',
+ 'Ключик №4',
+ 'Ключик №5',
+ 'Ключик №6',
+ 'Ключик №7',
+ 'Ключик №8',
+ 'Ключик №9',
+ 'Ключик №10'
+ ];
db::c()->query('DELETE FROM inventory WHERE name IN ("?s") AND owner_id = ?i', implode(",", $items_to_delete), $user->id);
}
}
- $e = mysql_query("DELETE FROM labirint WHERE user_id='".$user['id']."'");
- mysql_query("UPDATE `users`,`online` SET `users`.`room` = '402',`online`.`room` = '402' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."' ;");
- print ""; exit();
+ $e = mysql_query("DELETE FROM labirint WHERE user_id='" . $user['id'] . "'");
+ mysql_query("UPDATE `users`,`online` SET `users`.`room` = '402',`online`.`room` = '402' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $user['id'] . "' ;");
+ print "";
+ exit();
}
- function podzem_brat() {
- $frt=mysql_query("select user_id from `labirint` where glava='".$glava."'");
- while($rbb=mysql_fetch_array($frt)){
- addchp (''.$user->login.' поднял предмет "'.$mis.'". ','{[]}'.Nick::id($rbb["user_id"])->short().'{[]}');
+ function podzem_brat()
+ {
+ $frt = mysql_query("select user_id from `labirint` where glava='" . $glava . "'");
+ while ($rbb = mysql_fetch_array($frt)) {
+ addchp('' . $user->login . ' поднял предмет "' . $mis . '". ', '{[]}' . Nick::id($rbb["user_id"])->short() . '{[]}');
}
}
}
Template::header('canalizaciya');
-?>
-
-location.href='podzem_dialog.php'"; exit();}
-// 3 smerti == vqlet
-if($mir['dead']>=3){print ""; exit();}
-//vignat
-if($_GET['kill']){
-if($user['login']==$glava){
-$rost=mysql_fetch_array(mysql_query("SELECT `user_id` FROM `labirint` WHERE `glava`='{$glava}' and `login`='".mysql_escape_string($_GET['kill'])."'"));
-$varsa = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_escape_string($_GET['kill'])."' LIMIT 1;"));
-if($varsa and $rost){
-if($_GET['kill']!=$glava){
-mysql_query("DELETE FROM labirint WHERE login='".mysql_escape_string($_GET['kill'])."'");
-//mysql_query("DELETE FROM `inventory` WHERE name='Бутерброд' and owner='".$varsa['id']."' and podzem='1'");
-print ""; exit();
-}else{print"Себя нельзя выгнать.";}
-}else{print"Такого логина не существует или он не в вашей группе.";}
-}}
-//smena lider
-if($_GET['change']){
-if($user['login']==$glava){
-$rost=mysql_fetch_array(mysql_query("SELECT `user_id` FROM `labirint` WHERE `glava`='$glava' and `login`='".mysql_escape_string($_GET['change'])."'"));
-$varsa = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '".mysql_escape_string($_GET['change'])."' LIMIT 1;"));
-if($varsa and $rost){
-if($_GET['change']!=$glava){
-mysql_query("UPDATE labirint SET glav_id='".$varsa['id']."',glava='".$_GET['change']."' WHERE glava='".$user['login']."'");
-mysql_query("UPDATE podzem3 SET glava='".$_GET['change']."' WHERE glava='".$user['login']."'");
-print ""; exit();
-}else{print"Вы и так Лидер.";}
-}else{print"Персонаж не существует или он не в вашей группе.";}
-}}
-
-$wait_sec=$mir["visit_time"];
-$new_t=time();
-if($wait_sec<$new_t)
-{
-print ""; exit();
+if ($_GET['act'] == "luka" and $mesto == '28') {
+ print "";
+ exit();
+}
+// 3 smerti == vqlet
+if ($mir['dead'] >= 3) {
+ print "";
+ exit();
+}
+//vignat
+if ($_GET['kill']) {
+ if ($user['login'] == $glava) {
+ $rost = mysql_fetch_array(mysql_query("SELECT `user_id` FROM `labirint` WHERE `glava`='{$glava}' and `login`='" . mysql_escape_string($_GET['kill']) . "'"));
+ $varsa = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '" . mysql_escape_string($_GET['kill']) . "' LIMIT 1;"));
+ if ($varsa and $rost) {
+ if ($_GET['kill'] != $glava) {
+ mysql_query("DELETE FROM labirint WHERE login='" . mysql_escape_string($_GET['kill']) . "'");
+//mysql_query("DELETE FROM `inventory` WHERE name='Бутерброд' and owner='".$varsa['id']."' and podzem='1'");
+ print "";
+ exit();
+ } else {
+ print"Себя нельзя выгнать.";
+ }
+ } else {
+ print"Такого логина не существует или он не в вашей группе.";
+ }
+ }
+}
+//smena lider
+if ($_GET['change']) {
+ if ($user['login'] == $glava) {
+ $rost = mysql_fetch_array(mysql_query("SELECT `user_id` FROM `labirint` WHERE `glava`='$glava' and `login`='" . mysql_escape_string($_GET['change']) . "'"));
+ $varsa = mysql_fetch_array(mysql_query("SELECT id FROM `users` WHERE `login` = '" . mysql_escape_string($_GET['change']) . "' LIMIT 1;"));
+ if ($varsa and $rost) {
+ if ($_GET['change'] != $glava) {
+ mysql_query("UPDATE labirint SET glav_id='" . $varsa['id'] . "',glava='" . $_GET['change'] . "' WHERE glava='" . $user['login'] . "'");
+ mysql_query("UPDATE podzem3 SET glava='" . $_GET['change'] . "' WHERE glava='" . $user['login'] . "'");
+ print "";
+ exit();
+ } else {
+ print"Вы и так Лидер.";
+ }
+ } else {
+ print"Персонаж не существует или он не в вашей группе.";
+ }
+ }
+}
+
+$wait_sec = $mir["visit_time"];
+$new_t = time();
+if ($wait_sec < $new_t) {
+ print "";
+ exit();
+}
+if ($mir['dead'] >= 3) {
+ print "";
+ exit();
}
-if($mir['dead']>=3){print ""; exit();}
//2ой Ярус
-if($_GET['act'] == "et2" and $mesto == '47' and $mir['name'] == "Канализация 1 этаж"){
-mysql_query("UPDATE labirint SET location='16', vector='180', name='Канализация 2 этаж', l='453', t='226' WHERE glava='".$user['login']."'");
-print "Спускаемся на 2ой ярус...";
+if ($_GET['act'] == "et2" and $mesto == '47' and $mir['name'] == "Канализация 1 этаж") {
+ mysql_query("UPDATE labirint SET location='16', vector='180', name='Канализация 2 этаж', l='453', t='226' WHERE glava='" . $user['login'] . "'");
+ print "Спускаемся на 2ой ярус...";
-$ros=mysql_query("SELECT * FROM `labirint` WHERE `user_id`='{$_SESSION['uid']}'");
-$mir=mysql_fetch_array($ros);
-$mesto = $mir['location'];
-$vektor = $mir['vector'];
-$glava = $mir['glava'];
+ $ros = mysql_query("SELECT * FROM `labirint` WHERE `user_id`='{$_SESSION['uid']}'");
+ $mir = mysql_fetch_array($ros);
+ $mesto = $mir['location'];
+ $vektor = $mir['vector'];
+ $glava = $mir['glava'];
}
//1ый Ярус
-if($_GET['act'] == "et1" and $mesto == '6' and $mir['name'] == "Канализация 2 этаж"){
-mysql_query("UPDATE labirint SET location='48', vector='270', name='Канализация 1 этаж', l='477', t='190' WHERE glava='".$user['login']."'");
-print "Поднимаемся на верхний ярус...";
+if ($_GET['act'] == "et1" and $mesto == '6' and $mir['name'] == "Канализация 2 этаж") {
+ mysql_query("UPDATE labirint SET location='48', vector='270', name='Канализация 1 этаж', l='477', t='190' WHERE glava='" . $user['login'] . "'");
+ print "Поднимаемся на верхний ярус...";
-$ros=mysql_query("SELECT * FROM `labirint` WHERE `user_id`='{$_SESSION['uid']}'");
-$mir=mysql_fetch_array($ros);
-$mesto = $mir['location'];
-$vektor = $mir['vector'];
-$glava = $mir['glava'];
+ $ros = mysql_query("SELECT * FROM `labirint` WHERE `user_id`='{$_SESSION['uid']}'");
+ $mir = mysql_fetch_array($ros);
+ $mesto = $mir['location'];
+ $vektor = $mir['vector'];
+ $glava = $mir['glava'];
}
-
include "canalization_mod.php";
-
////////////нападение////////////////
-if($_GET['act'] == "atk"){
-$d = $_GET['n']+10;
-$d2 = $_GET['n']-10;
-$d3 = $_GET['n']+1;
-$d4 = $_GET['n']-1;
-$red = mysql_query("SELECT n".mysql_escape_string($_GET['n'])." FROM podzem3 WHERE glava='".$mir['glava']."' and name='".$mir['name']."'");
-if($gef = mysql_fetch_array($red)){
-$dop = $gef["n".$_GET['n'].""];
+if ($_GET['act'] == "atk") {
+ $d = $_GET['n'] + 10;
+ $d2 = $_GET['n'] - 10;
+ $d3 = $_GET['n'] + 1;
+ $d4 = $_GET['n'] - 1;
+ $red = mysql_query("SELECT n" . mysql_escape_string($_GET['n']) . " FROM podzem3 WHERE glava='" . $mir['glava'] . "' and name='" . $mir['name'] . "'");
+ if ($gef = mysql_fetch_array($red)) {
+ $dop = $gef["n" . $_GET['n'] . ""];
+ }
+ if ($mesto == $d || $mesto == $d2 || $mesto == $d3 || $mesto == $d4) {
+ if ($dop != '') {
+ include "podzem/atk.php";
+ }
+ }
}
-if($mesto == $d || $mesto == $d2 || $mesto == $d3 || $mesto == $d4){
-if($dop!=''){
-include"podzem/atk.php";
-}
-}
-}
-if($_GET['act']=='el') {
-if($mir['el']!='1' and $mesto==$mir['el']){
-mysql_query("INSERT INTO `inventory` (`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`present`,`magic`,`otdel`,`isrep`)
- VALUES('".$user['id']."','Подземное зелье жизни','50','1','0','food_l9.gif','5','Подземка','8','6','0') ;");
-mysql_query("UPDATE `labirint` SET el='1' WHERE `glava`='".$glava."' and `login`='".$user['login']."'");
-print" Вы получили 'Подземное зелье жизни'".PHP_EOL;
-}else{
-if($mir['el']=='1'){print" Вы уже брали зелье!".PHP_EOL;}
-else{print" Невозможно! Вы далеко!".PHP_EOL;}}
+if ($_GET['act'] == 'el') {
+ if ($mir['el'] != '1' and $mesto == $mir['el']) {
+ mysql_query("INSERT INTO `inventory` (`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`present`,`magic`,`otdel`,`isrep`)
+ VALUES('" . $user['id'] . "','Подземное зелье жизни','50','1','0','food_l9.gif','5','Подземка','8','6','0') ;");
+ mysql_query("UPDATE `labirint` SET el='1' WHERE `glava`='" . $glava . "' and `login`='" . $user['login'] . "'");
+ print" Вы получили 'Подземное зелье жизни'" . PHP_EOL;
+ } else {
+ if ($mir['el'] == '1') {
+ print" Вы уже брали зелье!" . PHP_EOL;
+ } else {
+ print" Невозможно! Вы далеко!" . PHP_EOL;
+ }
+ }
}
///////////////Сбор чистых гаек/////////////
-if($_GET['sun']=='se_gaika_c'){
-$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n$mesto"];
-if($stloc=='508' or $stloc=='507' or $stloc=='506'){
-if($stloc=='508'){mysql_query("UPDATE `podzem3` SET n$mesto='507' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='507'){mysql_query("UPDATE `podzem3` SET n$mesto='506' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='506'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Чистая гайка'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Чистая гайка'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистая гайка','1','g_c.gif','".$user['id']."','200','0.1','0','Лука')");
-}
-$mis = "Чистая гайка";
-podzem_brat();
-print" Вы получили 'Чистая гайка'";
-}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
+if ($_GET['sun'] == 'se_gaika_c') {
+ $ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n$mesto"];
+ if ($stloc == '508' or $stloc == '507' or $stloc == '506') {
+ if ($stloc == '508') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='507' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '507') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='506' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '506') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Чистая гайка'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Чистая гайка'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистая гайка','1','g_c.gif','" . $user['id'] . "','200','0.1','0','Лука')");
+ }
+ $mis = "Чистая гайка";
+ podzem_brat();
+ print" Вы получили 'Чистая гайка'";
+ } else {
+ if ($stloc == '') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
///////////////Сбор гаек/////////////
-if($_GET['sun']=='gaika'){
-$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n$mesto"];
-if($stloc=='503' or $stloc=='502' or $stloc=='501'){
-if($stloc=='503'){mysql_query("UPDATE `podzem3` SET n$mesto='502' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='502'){mysql_query("UPDATE `podzem3` SET n$mesto='501' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='501'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1, massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
-}
-$mis = "Гайка";
-podzem_brat();
-print" Вы получили 'Гайка'";
-}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
+if ($_GET['sun'] == 'gaika') {
+ $ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n$mesto"];
+ if ($stloc == '503' or $stloc == '502' or $stloc == '501') {
+ if ($stloc == '503') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='502' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '502') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='501' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '501') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Гайка'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1, massa=massa+0.1 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Гайка'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','" . $user['id'] . "','200','0.1','0','Лука')");
+ }
+ $mis = "Гайка";
+ podzem_brat();
+ print" Вы получили 'Гайка'";
+ } else {
+ if ($stloc == '') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
/////////////////////////////////////
///////////////Сбор вентилей/////////////
-if($_GET['sun']=='ventil'){
-$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n$mesto"];
-if($stloc=='504' or $stloc=='505' or $stloc=='506'){
-if($stloc=='506'){mysql_query("UPDATE `podzem3` SET n$mesto='505' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='505'){mysql_query("UPDATE `podzem3` SET n$mesto='504' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='504'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Вентиль'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner='".$user['id']."' and `type`='200' and `name`='Вентиль'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Вентиль','1','v.gif','".$user['id']."','200','0.2','0','Лука')");
-}
-$mis = "Вентиль";
-podzem_brat();
-print" Вы получили 'Вентиль'";
-}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
+if ($_GET['sun'] == 'ventil') {
+ $ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n$mesto"];
+ if ($stloc == '504' or $stloc == '505' or $stloc == '506') {
+ if ($stloc == '506') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='505' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '505') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='504' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '504') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Вентиль'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Вентиль'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Вентиль','1','v.gif','" . $user['id'] . "','200','0.2','0','Лука')");
+ }
+ $mis = "Вентиль";
+ podzem_brat();
+ print" Вы получили 'Вентиль'";
+ } else {
+ if ($stloc == '') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
///////////////Сбор Чистых вентилей/////////////
-if($_GET['sun']=='se_ventil'){
-$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n$mesto"];
-if($stloc=='512' or $stloc=='513' or $stloc=='514'){
-if($stloc=='514'){mysql_query("UPDATE `podzem3` SET n$mesto='513' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='513'){mysql_query("UPDATE `podzem3` SET n$mesto='512' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='512'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Чистый вентиль'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.4 WHERE owner='".$user['id']."' and `type`='200' and `name`='Чистый вентиль'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистый вентиль','1','v2.gif','".$user['id']."','200','0.4','0','Лука')");
-}
-$mis = "Чистый вентиль";
-podzem_brat();
-print" Вы получили 'Чистый вентиль'";
-}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
+if ($_GET['sun'] == 'se_ventil') {
+ $ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n$mesto"];
+ if ($stloc == '512' or $stloc == '513' or $stloc == '514') {
+ if ($stloc == '514') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='513' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '513') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='512' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '512') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Чистый вентиль'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.4 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Чистый вентиль'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистый вентиль','1','v2.gif','" . $user['id'] . "','200','0.4','0','Лука')");
+ }
+ $mis = "Чистый вентиль";
+ podzem_brat();
+ print" Вы получили 'Чистый вентиль'";
+ } else {
+ if ($stloc == '') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
/////////////////////////////////////
///////////////Сбор Болтов/////////////
-if($_GET['sun']=='bolt'){
-$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n$mesto"];
-if($stloc=='507' or $stloc=='508' or $stloc=='509'){
-if($stloc=='509'){mysql_query("UPDATE `podzem3` SET n$mesto='508' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='508'){mysql_query("UPDATE `podzem3` SET n$mesto='507' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='507'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Болт'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Болт'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','".$user['id']."','200','0.1','0','Лука')");
-}
-$mis = "Болт";
-podzem_brat();
-print" Вы получили 'Болт'";
-}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
+if ($_GET['sun'] == 'bolt') {
+ $ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n$mesto"];
+ if ($stloc == '507' or $stloc == '508' or $stloc == '509') {
+ if ($stloc == '509') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='508' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '508') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='507' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '507') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Болт'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Болт'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','" . $user['id'] . "','200','0.1','0','Лука')");
+ }
+ $mis = "Болт";
+ podzem_brat();
+ print" Вы получили 'Болт'";
+ } else {
+ if ($stloc == '') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
///////////////Сбор Длинных Болтов/////////////
-if($_GET['sun']=='se_gaika_bd'){
-$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n$mesto"];
-if($stloc=='511' or $stloc=='510' or $stloc=='509'){
-if($stloc=='511'){mysql_query("UPDATE `podzem3` SET n$mesto='510' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='510'){mysql_query("UPDATE `podzem3` SET n$mesto='509' WHERE glava='$glava' and name='".$mir['name']."'");}
-if($stloc=='509'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Длинный болт'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner='".$user['id']."' and `type`='200' and `name`='Длинный болт'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Длинный болт','1','dbolt.gif','".$user['id']."','200','0.2','0','Лука')");
-}
-$mis = "Длинный болт";
-podzem_brat();
-print" Вы получили 'Длинный болт'";
-}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
+if ($_GET['sun'] == 'se_gaika_bd') {
+ $ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n$mesto"];
+ if ($stloc == '511' or $stloc == '510' or $stloc == '509') {
+ if ($stloc == '511') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='510' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '510') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='509' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ if ($stloc == '509') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Длинный болт'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Длинный болт'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Длинный болт','1','dbolt.gif','" . $user['id'] . "','200','0.2','0','Лука')");
+ }
+ $mis = "Длинный болт";
+ podzem_brat();
+ print" Вы получили 'Длинный болт'";
+ } else {
+ if ($stloc == '') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
/////////////////////////////////////
///////////////Сбор ключиик/////////////
-if($_GET['sun']=='kluchiik'){
-$ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n$mesto"];
-if($stloc=='510'){
-if($stloc=='510'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключиик','1','kluchik.gif','".$user['id']."','200','0.5','0','Лука')");
-$mis = "Ключиик";
-podzem_brat();
-print" Вы получили 'Ключиик'";
-}else{if($stloc==''){print" Кто-то оказался быстрее!";}}
+if ($_GET['sun'] == 'kluchiik') {
+ $ferrr = mysql_query("SELECT n$mesto FROM `podzem3` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n$mesto"];
+ if ($stloc == '510') {
+ if ($stloc == '510') {
+ mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключиик','1','kluchik.gif','" . $user['id'] . "','200','0.5','0','Лука')");
+ $mis = "Ключиик";
+ podzem_brat();
+ print" Вы получили 'Ключиик'";
+ } else {
+ if ($stloc == '') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
/////////////////////////////////////
///////////////Сбор сундуков/////////////
-if($_GET['act']=='sunduk'){
-$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n".$_GET['n'].""];
-if($stloc=='13.1'){
-$d = $_GET['n']+10;
-$d2 = $_GET['n']-10;
-$d3 = $_GET['n']+1;
-$d4 = $_GET['n']-1;
-if($mesto==$d or $mesto==$d2 or $mesto==$d3 or $mesto==$d4){
-if($stloc=='13.1'){mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='13.0' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
-}
-$mis = "Гайка";
-podzem_brat();
-print" Вы получили 'Гайка'";
-}
-}else{if($stloc=='13.0'){print" Кто-то оказался быстрее!";}}
+if ($_GET['act'] == 'sunduk') {
+ $ferrr = mysql_query("SELECT n" . $_GET['n'] . " FROM `podzem4` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n" . $_GET['n'] . ""];
+ if ($stloc == '13.1') {
+ $d = $_GET['n'] + 10;
+ $d2 = $_GET['n'] - 10;
+ $d3 = $_GET['n'] + 1;
+ $d4 = $_GET['n'] - 1;
+ if ($mesto == $d or $mesto == $d2 or $mesto == $d3 or $mesto == $d4) {
+ if ($stloc == '13.1') {
+ mysql_query("UPDATE `podzem4` SET n" . $_GET['n'] . "='13.0' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Гайка'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Гайка'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','" . $user['id'] . "','200','0.1','0','Лука')");
+ }
+ $mis = "Гайка";
+ podzem_brat();
+ print" Вы получили 'Гайка'";
+ }
+ } else {
+ if ($stloc == '13.0') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
/////////////////////////////////////
///////////////Сбор сундуков (БОЛТ)/////////////
-if($_GET['act']=='sunduk2'){
-$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n".$_GET['n'].""];
-if($stloc=='14.1'){
-$d = $_GET['n']+10;
-$d2 = $_GET['n']-10;
-$d3 = $_GET['n']+1;
-$d4 = $_GET['n']-1;
-if($mesto==$d or $mesto==$d2 or $mesto==$d3 or $mesto==$d4){
-if($stloc=='14.1'){mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='14.0' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Болт'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Болт'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','".$user['id']."','200','0.1','0','Лука')");
-}
-$mis = "Болт";
-podzem_brat();
-print" Вы получили 'Болт'";
-}
-}else{if($stloc=='14.0'){print" Кто-то оказался быстрее!";}}
+if ($_GET['act'] == 'sunduk2') {
+ $ferrr = mysql_query("SELECT n" . $_GET['n'] . " FROM `podzem4` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n" . $_GET['n'] . ""];
+ if ($stloc == '14.1') {
+ $d = $_GET['n'] + 10;
+ $d2 = $_GET['n'] - 10;
+ $d3 = $_GET['n'] + 1;
+ $d4 = $_GET['n'] - 1;
+ if ($mesto == $d or $mesto == $d2 or $mesto == $d3 or $mesto == $d4) {
+ if ($stloc == '14.1') {
+ mysql_query("UPDATE `podzem4` SET n" . $_GET['n'] . "='14.0' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Болт'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Болт'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','" . $user['id'] . "','200','0.1','0','Лука')");
+ }
+ $mis = "Болт";
+ podzem_brat();
+ print" Вы получили 'Болт'";
+ }
+ } else {
+ if ($stloc == '14.0') {
+ print" Кто-то оказался быстрее!";
+ }
+ }
}
/////////////////////////////////////
///////////////Сбор ключей/////////////
-if($_GET['act']=='key'){
-$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n".$_GET['n'].""];
-$f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Ключик №".mysql_escape_string($_GET['b'])."'");
-$g = mysql_fetch_array($f);
-if(($stloc=='key1' or $stloc=='key2' or $stloc=='key3' or $stloc=='key4' or $stloc=='key5' or $stloc=='key6' or $stloc=='key7' or $stloc=='key8' or $stloc=='key9' or $stloc=='key10') and !$g){
-if($mesto==$_GET['n']){
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключик №".mysql_escape_string($_GET['b'])."','1','$stloc.gif','".$user['id']."','200','0.1','0','Подземка')");
+if ($_GET['act'] == 'key') {
+ $ferrr = mysql_query("SELECT n" . $_GET['n'] . " FROM `podzem4` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n" . $_GET['n'] . ""];
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Ключик №" . mysql_escape_string($_GET['b']) . "'");
+ $g = mysql_fetch_array($f);
+ if (($stloc == 'key1' or $stloc == 'key2' or $stloc == 'key3' or $stloc == 'key4' or $stloc == 'key5' or $stloc == 'key6' or $stloc == 'key7' or $stloc == 'key8' or $stloc == 'key9' or $stloc == 'key10') and !$g) {
+ if ($mesto == $_GET['n']) {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключик №" . mysql_escape_string($_GET['b']) . "','1','$stloc.gif','" . $user['id'] . "','200','0.1','0','Подземка')");
//Удаляем ключик с локи
//mysql_query("UPDATE `podzem4` SET n".$_GET['n']." = '' WHERE glava='".$glava."' and name='".$mir['name']."'");
-print" Вы получили 'Ключик №".$_GET['b']."'";
-}
-}else{if($g){print" У вас уже есть Ключик №".$_GET['b']."!";}}
+ print" Вы получили 'Ключик №" . $_GET['b'] . "'";
+ }
+ } else {
+ if ($g) {
+ print" У вас уже есть Ключик №" . $_GET['b'] . "!";
+ }
+ }
}
/////////////////////////////////////
///////////////Сбор гаек из стоков/////////////
-if($_GET['act']=='stok'){
-$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n".$_GET['n'].""];
-$shans = rand(0,100);
-if($shans<51){
-mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='11.0' WHERE glava='$glava' and name='".$mir['name']."'");
-$stloc='11.0';
-}
-if($stloc=='11.1'){
-if($mesto==$_GET['n']){
-if($stloc=='11.1'){mysql_query("UPDATE `podzem4` SET n".mysql_escape_string($_GET['n'])."='11.0' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
-}
-$mis = "Гайка";
-podzem_brat();
-print" Вы получили 'Гайка'";
-}
-}else{if($stloc=='11.0'){print" Попахивает...";}}
+if ($_GET['act'] == 'stok') {
+ $ferrr = mysql_query("SELECT n" . $_GET['n'] . " FROM `podzem4` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n" . $_GET['n'] . ""];
+ $shans = rand(0, 100);
+ if ($shans < 51) {
+ mysql_query("UPDATE `podzem4` SET n" . $_GET['n'] . "='11.0' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $stloc = '11.0';
+ }
+ if ($stloc == '11.1') {
+ if ($mesto == $_GET['n']) {
+ if ($stloc == '11.1') {
+ mysql_query("UPDATE `podzem4` SET n" . mysql_escape_string($_GET['n']) . "='11.0' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Гайка'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Гайка'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','" . $user['id'] . "','200','0.1','0','Лука')");
+ }
+ $mis = "Гайка";
+ podzem_brat();
+ print" Вы получили 'Гайка'";
+ }
+ } else {
+ if ($stloc == '11.0') {
+ print" Попахивает...";
+ }
+ }
}
///////////////Сбор гаек из стоков/////////////
-if($_GET['act']=='stok2'){
-$ferrr = mysql_query("SELECT n".$_GET['n']." FROM `podzem4` WHERE glava='$glava' and name='".$mir['name']."'");
-$retr = mysql_fetch_array($ferrr);
-$stloc = $retr["n".$_GET['n'].""];
-$shans = rand(0,100);
-if($shans<51){
-mysql_query("UPDATE `podzem4` SET n".$_GET['n']."='12.0' WHERE glava='$glava' and name='".$mir['name']."'");
-$stloc='12.0';
-}
-if($stloc=='12.1'){
-$d = $_GET['n']+10;
-$d2 = $_GET['n']-10;
-$d3 = $_GET['n']+1;
-$d4 = $_GET['n']-1;
-if($mesto==$d or $mesto==$d2 or $mesto==$d3 or $mesto==$d4){
-if($stloc=='12.1'){mysql_query("UPDATE `podzem4` SET n".mysql_escape_string($_GET['n'])."='12.0' WHERE glava='$glava' and name='".$mir['name']."'");}
-$f=mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Гайка'");
-if($g = mysql_fetch_array($f)){
-$koll = $g["maxdur"];
-mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='".$user['id']."' and `type`='200' and `name`='Гайка'");
-}else{
-$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
-}
-$mis = "Гайка";
-podzem_brat();
-print" Вы получили 'Гайка'";
-}
-}else{if($stloc=='12.0'){print" Попахивает...";}}
+if ($_GET['act'] == 'stok2') {
+ $ferrr = mysql_query("SELECT n" . $_GET['n'] . " FROM `podzem4` WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $retr = mysql_fetch_array($ferrr);
+ $stloc = $retr["n" . $_GET['n'] . ""];
+ $shans = rand(0, 100);
+ if ($shans < 51) {
+ mysql_query("UPDATE `podzem4` SET n" . $_GET['n'] . "='12.0' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $stloc = '12.0';
+ }
+ if ($stloc == '12.1') {
+ $d = $_GET['n'] + 10;
+ $d2 = $_GET['n'] - 10;
+ $d3 = $_GET['n'] + 1;
+ $d4 = $_GET['n'] - 1;
+ if ($mesto == $d or $mesto == $d2 or $mesto == $d3 or $mesto == $d4) {
+ if ($stloc == '12.1') {
+ mysql_query("UPDATE `podzem4` SET n" . mysql_escape_string($_GET['n']) . "='12.0' WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ }
+ $f = mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Гайка'");
+ if ($g = mysql_fetch_array($f)) {
+ $koll = $g["maxdur"];
+ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Гайка'");
+ } else {
+ $fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','" . $user['id'] . "','200','0.1','0','Лука')");
+ }
+ $mis = "Гайка";
+ podzem_brat();
+ print" Вы получили 'Гайка'";
+ }
+ } else {
+ if ($stloc == '12.0') {
+ print" Попахивает...";
+ }
+ }
}
/////////////////////////////////////
-if($mesto == '1'){$mesto = '01';}
-if($mesto == '2'){$mesto = '02';}
-if($mesto == '3'){$mesto = '03';}
-if($mesto == '4'){$mesto = '04';}
-if($mesto == '5'){$mesto = '05';}
-if($mesto == '6'){$mesto = '06';}
-if($mesto == '7'){$mesto = '07';}
-if($mesto == '8'){$mesto = '08';}
-if($mesto == '9'){$mesto = '09';}
+if ($mesto == '1') {
+ $mesto = '01';
+}
+if ($mesto == '2') {
+ $mesto = '02';
+}
+if ($mesto == '3') {
+ $mesto = '03';
+}
+if ($mesto == '4') {
+ $mesto = '04';
+}
+if ($mesto == '5') {
+ $mesto = '05';
+}
+if ($mesto == '6') {
+ $mesto = '06';
+}
+if ($mesto == '7') {
+ $mesto = '07';
+}
+if ($mesto == '8') {
+ $mesto = '08';
+}
+if ($mesto == '9') {
+ $mesto = '09';
+}
// переходы
- if(isset($_GET['left'])){
- mysql_query("UPDATE `labirint` SET `vector` = '".mysql_escape_string($_GET['left'])."' WHERE `user_id` = '{$_SESSION['uid']}' ;");
- //header('Location:canalizaciya.php');
+if (isset($_GET['left'])) {
+ mysql_query("UPDATE `labirint` SET `vector` = '" . mysql_escape_string($_GET['left']) . "' WHERE `user_id` = '{$_SESSION['uid']}' ;");
+ //header('Location:canalizaciya.php');
+ exit("");
+}
+if (isset($_GET['right'])) {
+ mysql_query("UPDATE `labirint` SET `vector` = '" . mysql_escape_string($_GET['right']) . "' WHERE `user_id` = '{$_SESSION['uid']}' ;");
+ //header('Location:canalizaciya.php');
exit("");
- }
- if(isset($_GET['right'])){
- mysql_query("UPDATE `labirint` SET `vector` = '".mysql_escape_string($_GET['right'])."' WHERE `user_id` = '{$_SESSION['uid']}' ;");
- //header('Location:canalizaciya.php');
- exit("");
- }
-
-$fer = mysql_query("SELECT n".mysql_escape_string($rhar[$mesto][$_GET['path']])." FROM podzem3 WHERE glava='".$mir['glava']."' and name='".$mir['name']."'");
-if($ret = @mysql_fetch_array($fer)){
-$stoi = $ret["n".$rhar[$mesto][$_GET['path']].""];
-}
-
-if($rhar[$mesto][$_GET['path']] > 0 and $_GET['path'] < 4 and $_GET['path'] >= 0 and ($_SESSION['time'] <= time()) and ($stoi=='' or $stoi>'500')) {
-if($_GET['path']==0) {$loc2=$mesto+10;}
-if($_GET['path']==1) {$loc2=$mesto+1;}
-if($_GET['path']==2) {$loc2=$mesto-10;}
-if($_GET['path']==3) {$loc2=$mesto-1;}
-$fers = mysql_query("SELECT n$loc2,v$loc2 FROM podzem4 WHERE glava='$glava' and name='".$mir['name']."'");
-$rets = mysql_fetch_array($fers);
-$ins = mysql_query("SELECT id FROM `inventory` WHERE `owner`='".$user['id']."' and `type`='200' and `name`='Ключик №".$rets["n$loc2"]."'");
-$setr = mysql_fetch_array($ins);
-if($rets["n$loc2"]>=1 and $rets["n$loc2"]<=10 and !$setr){
-print" Нужен ключ №".$rets["n$loc2"]."".$rets["n$mesto"]."";}else{
-$vrem=30*60+time();
-if($_GET['path']==0) {$nav='t=t-12';}
-if($_GET['path']==1) {$nav='l=l+12';}
-if($_GET['path']==2) {$nav='t=t+12';}
-if($_GET['path']==3) {$nav='l=l-12';}
-mysql_query("UPDATE `labirint` SET `location` = '".mysql_escape_string($rhar[$mesto][$_GET['path']])."',`visit_time`='$vrem',$nav WHERE `user_id` = '{$_SESSION['uid']}' ;");
-$_SESSION['time'] = time()+1;
-//header('Location:canalizaciya.php');
-exit("");
-
}
- }
-?>
-
-
-
+$fer = mysql_query("SELECT n" . mysql_escape_string($rhar[$mesto][$_GET['path']]) . " FROM podzem3 WHERE glava='" . $mir['glava'] . "' and name='" . $mir['name'] . "'");
+if ($ret = mysql_fetch_array($fer)) {
+ $stoi = $ret["n" . $rhar[$mesto][$_GET['path']] . ""];
+}
+if ($rhar[$mesto][$_GET['path']] > 0 and $_GET['path'] < 4 and $_GET['path'] >= 0 and ($_SESSION['time'] <= time()) and ($stoi == '' or $stoi > '500')) {
+ if ($_GET['path'] == 0) {
+ $loc2 = $mesto + 10;
+ }
+ if ($_GET['path'] == 1) {
+ $loc2 = $mesto + 1;
+ }
+ if ($_GET['path'] == 2) {
+ $loc2 = $mesto - 10;
+ }
+ if ($_GET['path'] == 3) {
+ $loc2 = $mesto - 1;
+ }
+ $fers = mysql_query("SELECT n$loc2,v$loc2 FROM podzem4 WHERE glava='$glava' and name='" . $mir['name'] . "'");
+ $rets = mysql_fetch_array($fers);
+ $ins = mysql_query("SELECT id FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Ключик №" . $rets["n$loc2"] . "'");
+ $setr = mysql_fetch_array($ins);
+ if ($rets["n$loc2"] >= 1 and $rets["n$loc2"] <= 10 and !$setr) {
+ print" Нужен ключ №" . $rets["n$loc2"] . "" . $rets["n$mesto"] . "";
+ } else {
+ $vrem = 30 * 60 + time();
+ if ($_GET['path'] == 0) {
+ $nav = 't=t-12';
+ }
+ if ($_GET['path'] == 1) {
+ $nav = 'l=l+12';
+ }
+ if ($_GET['path'] == 2) {
+ $nav = 't=t+12';
+ }
+ if ($_GET['path'] == 3) {
+ $nav = 'l=l-12';
+ }
+ mysql_query("UPDATE `labirint` SET `location` = '" . mysql_escape_string($rhar[$mesto][$_GET['path']]) . "',`visit_time`='$vrem',$nav WHERE `user_id` = '{$_SESSION['uid']}' ;");
+ $_SESSION['time'] = time() + 1;
+ header('Location:canalizaciya.php');
+ exit;
-
-
-
-%s',Nick::id($user)->battle());
-?>
-
-
-
-Персонаж |
-Hp |
-Звание |
-Подземелье |
-
-
-$rog=mysql_query("SELECT login,name,glava FROM `labirint` WHERE `glava`='$glava'");
-while($more=mysql_fetch_array($rog)){
-$big = mysql_fetch_array(mysql_query("SELECT hp,maxhp,id FROM `users` WHERE `login` = '".$more['login']."'"));
+echo sprintf('%s ', Nick::id($user)->battle());
?>
-
-
- target=_blank title="Информация о =$more['login']?>">=$more['login']?> |
-=$big['hp']?>/=$big['maxhp']?> |
- |
-=$more['name']?> |
- if($user['login']==$more['glava'] and $more['login']==$more['glava']){ ?>
- |
-
-}
-print" ";
-}
-?>
-
-
-
-print" ";
-
-if($mir['dead']>'0'){print" Кол-во смертей: ".$mir['dead']."
";}
-
-include "podzem_res.php";
-?>
- |
-
-
-include"navig.php";
-echo build_move_image($mesto, $vektor, 1);
-?>
- |
-
-
-
-
- |
-
-
+
+
+
+
+
+ Персонаж |
+ Hp |
+ Звание |
+ Подземелье |
+
+
+ $rog = mysql_query("SELECT login,name,glava FROM `labirint` WHERE `glava`='$glava'");
+ while ($more = mysql_fetch_array($rog)){
+ $big = mysql_fetch_array(mysql_query("SELECT hp,maxhp,id FROM `users` WHERE `login` = '" . $more['login'] . "'"));
+ ?>
+
+
+ target=_blank
+ title="Информация о = $more['login'] ?>">= $more['login'] ?> |
+ = $big['hp'] ?>/= $big['maxhp'] ?> |
+ if ($more['login'] == $more['glava']) {
+ print"Лидер";
+ } else {
+ print"Рядовой";
+ } ?> |
+ = $more['name'] ?> |
+
+
+
+
+
+
+
+
+ |
+ ";
+ }
+ ?>
+
+
+
+ '0') {
+ print"
Кол-во смертей: " . $mir['dead'] . "";
+ }
+ include "podzem_res.php";
+ ?>
+
+
+
+
+
-
-
-
-
-
-