Внедрение шаблонизатора. Решение самых идиотских ошибок вёрстки. Кое-где исправлены ошибки синтаксиса php.

This commit is contained in:
Igor Barkov (iwork) 2020-09-30 22:12:34 +03:00
parent 8b1a2e9b38
commit a4de6c51a3
41 changed files with 4688 additions and 5715 deletions

View File

@ -11,7 +11,6 @@ if (empty($user['admin'])) {
header("HTTP/1.0 404 Not Found"); header("HTTP/1.0 404 Not Found");
exit; exit;
} }
header("Cache-Control: no-cache");
$al = db::c()->query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc(); $al = db::c()->query('SELECT * FROM `aligns` WHERE `align` = "?s" LIMIT 1', $user['align'])->fetch_assoc();

View File

@ -23,6 +23,7 @@ class Template
<html lang="ru"> <html lang="ru">
<meta charset="utf-8"> <meta charset="utf-8">
<link href="/css/main.css" rel="stylesheet"> <link href="/css/main.css" rel="stylesheet">
<link href="/css/btn.css" rel=stylesheet >
<title>$title</title> <title>$title</title>
HTML_HEADER; HTML_HEADER;
if (!$return) { if (!$return) {

View File

@ -391,7 +391,7 @@ TASK;
return $r; return $r;
} }
public function endq($id, $tp, $user) public function endq($id, $tp, $user):void
{ {
$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1')); $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= "' . $user['level'] . '" AND `max_lvl` >= "' . $user['level'] . '" AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
$qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1')); $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $user['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));

View File

@ -145,8 +145,6 @@ function takeshopitem($item, $table = "shop", $present = '', $onlyonetrip = '',
define('_BOTSEPARATOR_', 10000000); define('_BOTSEPARATOR_', 10000000);
header("Cache-Control: no-cache");
function level_up($uid) function level_up($uid)
{ {
$us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `exp`, `nextup`, `stats`, `master`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc(); $us = db::c()->query('SELECT `id`, `login`, `level`, `money`, `exp`, `nextup`, `stats`, `master`, `ip`, `in_tower` FROM `users` WHERE `id` =?i', $uid)->fetch_assoc();

View File

@ -10,7 +10,7 @@ if (empty($_SESSION['uid'])) {
require_once 'functions.php'; require_once 'functions.php';
if (!($user->room >= 37 AND $user->room <= 41)) { if (!($user->room >= 37 && $user->room <= 41)) {
header("Location: main.php"); header("Location: main.php");
exit; exit;
} }
@ -19,15 +19,27 @@ $castleOwners = db::c()->query('SELECT * FROM `clans` WHERE `short` = (SELECT *
if ($castleOwners['id'] == $user['klan']) { if ($castleOwners['id'] == $user['klan']) {
// если мой клан // если мой клан
if ($_GET['goto'] == 'arsenal') $user->room = 38; if ($_GET['goto'] == 'arsenal') {
if ($_GET['goto'] == 'home') $user->room = 37; $user->room = 38;
if ($_GET['goto'] == 'dvor') $user->room = 39; }
if ($_GET['goto'] == 'master') $user->room = 40; if ($_GET['goto'] == 'home') {
if ($_GET['goto'] == 'rest') $user->room = 41; $user->room = 37;
}
if ($_GET['goto'] == 'dvor') {
$user->room = 39;
}
if ($_GET['goto'] == 'master') {
$user->room = 40;
}
if ($_GET['goto'] == 'rest') {
$user->room = 41;
}
if (in_array($_GET['goto'], ['arsenal', 'home', 'dvor', 'master', 'rest'])) { if (in_array($_GET['goto'], ['arsenal', 'home', 'dvor', 'master', 'rest'])) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user->room, $user->room, $_SESSION['uid']); db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $user->room, $user->room, $_SESSION['uid']);
header('location: gotzamok.php'); header('location: gotzamok.php');
} else $status = 'В этом замке нет такого места!'; } else {
$status = 'В этом замке нет такого места!';
}
} }
switch ($user->room) { switch ($user->room) {
@ -45,7 +57,7 @@ if ($user->room == 38) {
if ($_GET['back']) { if ($_GET['back']) {
$item = db::c()->query('SELECT * FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back'])->fetch_assoc(); $item = db::c()->query('SELECT * FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back'])->fetch_assoc();
if ($_SESSION['uid'] == $item['owner'] OR $_SESSION['uid'] == $glava['glava']) { if ($_SESSION['uid'] == $item['owner'] or $_SESSION['uid'] == $glava['glava']) {
$status = 'Вы забрали вещь из арсенала.'; $status = 'Вы забрали вещь из арсенала.';
db::c()->query('UPDATE `inventory` SET `owner` = ?i WHERE `id` = ?i', $_SESSION['uid'], $item['id_it']); db::c()->query('UPDATE `inventory` SET `owner` = ?i WHERE `id` = ?i', $_SESSION['uid'], $item['id_it']);
db::c()->query('DELETE FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back']); db::c()->query('DELETE FROM `gotzam_arsenal` WHERE `id` = ?i', $_GET['back']);
@ -84,24 +96,20 @@ if ($user->room == 40) {
} else $status = 'Не хватает денег!'; } else $status = 'Не хватает денег!';
} }
} }
Template::header('Клановый замок');
?> ?>
<HTML>
<head>
<link rel=stylesheet href="css/main.css">
<script src="js/main.js"></script> <script src="js/main.js"></script>
<meta charset="utf-8">
<style> <style>
body { body {
background: url('i/<?= $backgroundImage ?>.jpg') no-repeat top right; background: url('i/<?= $backgroundImage ?>.jpg') no-repeat top right;
} }
</style> </style>
</head> <h3>Приветствую тебя в замке <img src='i/clan/<?= $castleOwners['short'] ?>.gif'> <?= $castleOwners['name'] ?>,
<body> воин!</h3>
<h3>Приветствую тебя в замке <img src='i/clan/<?= $castleOwners['short'] ?>.gif'> <?= $castleOwners['name'] ?>, воин!</h3> <div style="text-align: right;">
<div style="text-align: right;"> <button onClick="hrefToFrame('city.php?bps')">Вернуться</button>
<button onClick="hrefToFrame('city.php?bps')">Вернуться</button> </div>
</div> <div><?php if (!empty($status)) err($status); ?></div>
<div><?php if (!empty($status)) err($status); ?></div>
<?php <?php
if ($castleOwners['id'] == $user['klan']) { ?> if ($castleOwners['id'] == $user['klan']) { ?>
@ -153,12 +161,12 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<BR> <BR>
<small>Положил: <?= Nick::id($item['owner'])->full(1) ?><BR></small> <small>Положил: <?= Nick::id($item['owner'])->full(1) ?><BR></small>
<?php <?php
if ($_SESSION['uid'] == $item['owner'] OR $_SESSION['uid'] == $glava['glava']): ?> if ($_SESSION['uid'] == $item['owner'] or $_SESSION['uid'] == $glava['glava']): ?>
<A HREF="?back=<?= $item['id'] ?>">забрать</A><BR> <A HREF="?back=<?= $item['id'] ?>">забрать</A><BR>
<?php else: $status = 'Вы не можете забрать эту вещь из арсенала.'; <?php else: $status = 'Вы не можете забрать эту вещь из арсенала.';
endif; ?> endif; ?>
</TD> </TD>
<TD valign=top> Тут был showitem($row); </TD> <TD valign=top> Тут был showitem($row);</TD>
</TR> </TR>
<?php endwhile; ?> <?php endwhile; ?>
</table> </table>
@ -172,7 +180,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
<IMG SRC="i/sh/<?= $row['img'] ?>"> <IMG SRC="i/sh/<?= $row['img'] ?>">
<BR><A HREF="?add=<?= $row['id'] ?>&sid=&sale=1">сдать в арсенал</A> <BR><A HREF="?add=<?= $row['id'] ?>&sid=&sale=1">сдать в арсенал</A>
</TD> </TD>
<TD valign=top> Тут был showitem($row); </TD> <TD valign=top> Тут был showitem($row);</TD>
</TR> </TR>
<?php endwhile; ?> <?php endwhile; ?>
</table> </table>
@ -205,6 +213,4 @@ if ($castleOwners['id'] == $user['klan']) { ?>
</td> </td>
</tr> </tr>
</table> </table>
<? } else $status = 'Ворота замка закрыты, привратник отказывается даже разговаривать с тобой...'; ?> <? } else $status = 'Ворота замка закрыты, привратник отказывается даже разговаривать с тобой...'; ?>
</body>
</HTML>

View File

@ -1,271 +1,310 @@
<?php <?php
session_start(); session_start();
if(empty($_SESSION['uid'])) { exit; } if (empty($_SESSION['uid'])) {
exit;
}
require_once 'functions.php'; require_once 'functions.php';
$error = ''; $error = '';
function login($uid) { function login($uid)
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan` FROM `users` WHERE `id` = "'.mysql_real_escape_string($uid).'" LIMIT 1')); {
if(isset($user['id'])) { $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan` FROM `users` WHERE `id` = "' . mysql_real_escape_string($uid) . '" LIMIT 1'));
$align_img = '<img src="i/align_'.($user['align']?$user['align']:0).'.gif" /> '; if (isset($user['id'])) {
if($user['klan'] != '') { $align_img = '<img src="i/align_' . ($user['align'] ? $user['align'] : 0) . '.gif" /> ';
$clan = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `clans` WHERE `id` = "'.$user['klan'].'" LIMIT 1')); if ($user['klan'] != '') {
$clan_img = '<img title="'.$clan['name'].'" src="i/clan/'.$clan['name'].'.gif" /> '; $clan = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `clans` WHERE `id` = "' . $user['klan'] . '" LIMIT 1'));
} else { $clan_img = '<img title="' . $clan['name'] . '" src="i/clan/' . $clan['name'] . '.gif" /> ';
$clan_img = '';
}
$r = $align_img.$clan_img.' <b>'.$user['login'].' ['.$user['level'].']</b><a href="http://capitalcity.old-dark.ru/inf.php?id='.$user['id'].'" target="_blank"><img src="http://capitalcity.old-dark.ru/i/inf.gif" /></a>';
} else {
$r = 'Место свободно';
}
return $r;
}
function form_start($uid) {
$r = ''; $go = '';
if($uid > 0) {
$user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan`, `zayrist` FROM `users` WHERE `id` = "'.$uid.'" LIMIT 1'));
if(isset($user['id'])) {
if($user['zayrist']) {
$zv = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1'));
if(isset($zv['id'])) {
$r .= '<form method="POST">';
if($zv['uid1'] == $user['id']) {
$go = '<input type="submit" name="startZv" value="Начать поход" /> / ';
}
for($i = 1; $i <= 3; $i++) {
$nick .= login($zv['uid'.$i]).', ';
}
$nc = rtrim($nick, ', ');
$r .= '<table style="padding-top: 25px;"><tr><td>Ваша группа («'.$zv['name'].'»): '.$nc.' '.$go.'<input type="submit" name="leaveZv" value="Покинуть заявку" /></td></tr></table>';
$r .= '</form>';
} else { } else {
$user['zayrist'] = 0; $clan_img = '';
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
} }
} $r = $align_img . $clan_img . ' <b>' . $user['login'] . ' [' . $user['level'] . ']</b><a href="http://capitalcity.old-dark.ru/inf.php?id=' . $user['id'] . '" target="_blank"><img src="http://capitalcity.old-dark.ru/i/inf.gif" /></a>';
} else {
$r = 'Место свободно';
} }
} return $r;
return $r;
} }
function forms($level) {
$r = '<br /></br />'; function form_start($uid)
$sp = mysql_query('SELECT `id`, `name`, `pass`, `comment`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `level` = "'.(int)$level.'" ORDER BY `id` DESC'); {
if(mysql_num_rows($sp) > 0) { $r = '';
while($pl = mysql_fetch_array($sp)) { $go = '';
$i = 1; if ($uid > 0) {
while($i <= 3) { $user = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `level`, `klan`, `zayrist` FROM `users` WHERE `id` = "' . $uid . '" LIMIT 1'));
$nick .= login($pl['uid'.$i]).', '; if (isset($user['id']) ?? $user['zayrist']) {
$i++; $zv = mysql_fetch_array(mysql_query('SELECT `id`, `name`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
} if (isset($zv['id'])) {
$nc = rtrim($nick, ', '); $r .= '<form method="POST">';
$r .= '<table><tr><td>Группа («'.$pl['name'].'»): '.$nc.' <input type="hidden" name="zvId" value="'.$pl['id'].'" /> <input type="submit" name="gotoZv" value="Вступить в заявку" /></td></tr></table>'; if ($zv['uid1'] == $user['id']) {
$go = '<input type="submit" name="startZv" value="Начать поход" /> / ';
}
for ($i = 1; $i <= 3; $i++) {
$nick .= login($zv['uid' . $i]) . ', ';
}
$nc = rtrim($nick, ', ');
$r .= '<table style="padding-top: 25px;"><tr><td>Ваша группа («' . $zv['name'] . '»): ' . $nc . ' ' . $go . '<input type="submit" name="leaveZv" value="Покинуть заявку" /></td></tr></table>';
$r .= '</form>';
} else {
$user['zayrist'] = 0;
mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
}
}
} }
} else { return $r;
$r .= '<i>Заявок вашего уровня нет</i>';
}
unset($sp, $pl, $nick, $nc, $i);
return $r;
} }
if(isset($_POST['buyFirst'])) { function forms($level)
if(isset($user['id'])) { {
if($user['money'] >= 5) { $r = '<br /></br />';
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "'.$user['id'].'" LIMIT 1')); $sp = mysql_query('SELECT `id`, `name`, `pass`, `comment`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `level` = "' . (int)$level . '" ORDER BY `id` DESC');
if(isset($Firts['id'])) { if (mysql_num_rows($sp) > 0) {
$error = 'У Вас уже есть Фамильный Герб'; while ($pl = mysql_fetch_array($sp)) {
} else { $i = 1;
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "'.$user['id'].'" LIMIT 1')); while ($i <= 3) {
if(isset($Second['id'])) { $nick .= login($pl['uid' . $i]) . ', ';
$error = 'У Вас уже есть Фамильный Герб'; $i++;
}
$nc = rtrim($nick, ', ');
$r .= '<table><tr><td>Группа («' . $pl['name'] . '»): ' . $nc . ' <input type="hidden" name="zvId" value="' . $pl['id'] . '" /> <input type="submit" name="gotoZv" value="Вступить в заявку" /></td></tr></table>';
}
} else {
$r .= '<i>Заявок вашего уровня нет</i>';
}
unset($sp, $pl, $nick, $nc, $i);
return $r;
}
if (isset($_POST['buyFirst'])) {
if (isset($user['id'])) {
if ($user['money'] >= 5) {
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if (isset($Firts['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
} else {
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if (isset($Second['id'])) {
$error = 'У Вас уже есть Фамильный Герб';
} else {
$user['money'] -= 5;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб за 5кр.', '1', '" . time() . "')");
$error = 'Вы купили Фамильный Герб';
}
}
} else { } else {
$user['money'] -= 5; $error = 'Недостаточно средств';
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
takeshopitem(1930, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"".$user['login']."\" купил Фамильный Герб за 5кр.', '1', '".time()."')");
$error = 'Вы купили Фамильный Герб';
} }
}
} else { } else {
$error = 'Недостаточно средств'; $error = 'Вы не авторизированы';
} }
} else {
$error = 'Вы не авторизированы';
}
} }
if(isset($_POST['buySecond'])) { if (isset($_POST['buySecond'])) {
if(isset($user['id'])) { if (isset($user['id'])) {
if($user['money'] >= 15) { if ($user['money'] >= 15) {
$Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "'.$user['id'].'" LIMIT 1')); $Firts = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if(isset($Firts['id'])) { if (isset($Firts['id'])) {
$error = 'У Вас уже есть Фамильный Герб'; $error = 'У Вас уже есть Фамильный Герб';
} else { } else {
$Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "'.$user['id'].'" LIMIT 1')); $Second = mysql_fetch_array(mysql_query('SELECT `id` FROM `inventory` WHERE `type` = 200 AND `name` = "Фамильный Герб (х2)" AND `owner` = "' . $user['id'] . '" LIMIT 1'));
if(isset($Second['id'])) { if (isset($Second['id'])) {
$error = 'У Вас уже есть Фамильный Герб'; $error = 'У Вас уже есть Фамильный Герб';
} else {
$user['money'] -= 15;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"" . $user['login'] . "\" купил Фамильный Герб (x2) за 15кр.', '1', '" . time() . "')");
$error = 'Вы купили Фамильный Герб (x2)';
}
}
} else { } else {
$user['money'] -= 15; $error = 'Недостаточно средств';
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
takeshopitem(1931, 'shop', '', '', 0, 0, $user['id'], 1, '', 0);
mysql_query("INSERT INTO `delo` (`author`, `pers`, `text`, `type`, `date`) VALUES ('0', '{$user['id']}', '\"".$user['login']."\" купил Фамильный Герб (x2) за 15кр.', '1', '".time()."')");
$error = 'Вы купили Фамильный Герб (x2)';
} }
}
} else { } else {
$error = 'Недостаточно средств'; $error = 'Вы не авторизированы';
} }
} else {
$error = 'Вы не авторизированы';
}
} }
if($_POST['addZayavka']) { if ($_POST['addZayavka']) {
if(isset($user['id'])) { if (isset($user['id'])) {
$name = mysql_real_escape_string($_POST['nameZv']); $name = mysql_real_escape_string($_POST['nameZv']);
$pass = mysql_real_escape_string($_POST['passZv']); $pass = mysql_real_escape_string($_POST['passZv']);
$comment = mysql_real_escape_string($_POST['commentZv']); $comment = mysql_real_escape_string($_POST['commentZv']);
$zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1')); $zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
if($user['zayrist'] > 0 && isset($zv['id'])) { if ($user['zayrist'] > 0 && isset($zv['id'])) {
$error = 'Вы уже состоите в заявке'; $error = 'Вы уже состоите в заявке';
} elseif(strlen($name) > 15) { } elseif (strlen($name) > 15) {
$error = 'Название может состоять максимум из 15 символов'; $error = 'Название может состоять максимум из 15 символов';
} elseif(strlen($name) < 3) { } elseif (strlen($name) < 3) {
$error = 'Название может состоять минимум из 3 символов'; $error = 'Название может состоять минимум из 3 символов';
} elseif(strlen($pass) > 6) { } elseif (strlen($pass) > 6) {
$error = 'Пароль может состоять максимум из 6 символов'; $error = 'Пароль может состоять максимум из 6 символов';
} elseif(strlen($comment) > 20) { } elseif (strlen($comment) > 20) {
$error = 'Комментарий может состоять максимум из 20 символов'; $error = 'Комментарий может состоять максимум из 20 символов';
} else {
mysql_query('INSERT INTO `group_ristal` (`name`, `pass`, `comment`, `time`, `uid1`) VALUES ("' . $name . '", "' . $pass . '", "' . $comment . '", "' . time() . '", "' . $user['id'] . '")');
$user['zayrist'] = mysql_insert_id();
mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$error = 'Заявка создана';
}
} else { } else {
mysql_query('INSERT INTO `group_ristal` (`name`, `pass`, `comment`, `time`, `uid1`) VALUES ("'.$name.'", "'.$pass.'", "'.$comment.'", "'.time().'", "'.$user['id'].'")'); $error = 'Вы не авторизированы';
$user['zayrist'] = mysql_insert_id();
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
$error = 'Заявка создана';
} }
} else {
$error = 'Вы не авторизированы';
}
} }
if(isset($_POST['leaveZv'])) { if (isset($_POST['leaveZv']) ?? $user['zayrist']) {
if($user['zayrist'] > 0) { $zv = mysql_fetch_array(mysql_query('SELECT `id`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "' . $user['zayrist'] . '" LIMIT 1'));
$zv = mysql_fetch_array(mysql_query('SELECT `id`, `uid1`, `uid2`, `uid3` FROM `group_ristal` WHERE `id` = "'.$user['zayrist'].'" LIMIT 1')); if (isset($zv['id'])) {
if(isset($zv['id'])) { $i = 1;
$i = 1; $j = 3; $k = 0; $h = 0; $j = 3;
while($i <= 3) { $k = 0;
if($k == 0 && $zv['uid'.$i] != $user['id']) { $h = 0;
$k = $zv['uid'.$i]; while ($i <= 3) {
$h = $i; if ($k == 0 && $zv['uid' . $i] != $user['id']) {
} $k = $zv['uid' . $i];
$i++; $h = $i;
} }
$i = 1; $i++;
while($i <= 3) { }
if($zv['uid'.$i] == $user['id']) { $i = 1;
if($i > 1) { while ($i <= 3) {
$zv['uid'.$i] = 0; if ($zv['uid' . $i] == $user['id']) {
} else { if ($i > 1) {
$zv['uid'.$i] = $k; $zv['uid' . $i] = 0;
$zv['uid'.$h] = 0; } else {
} $zv['uid' . $i] = $k;
} $zv['uid' . $h] = 0;
if($zv['uid'.$i] == 0) { }
$j--; }
} if ($zv['uid' . $i] == 0) {
$i++; $j--;
} }
if($j < 1) { $i++;
mysql_query('DELETE FROM `group_ristal` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); }
$error = 'Заявка была удалена<br />'; if ($j < 1) {
$user['zayrist'] = 0; mysql_query('DELETE FROM `group_ristal` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); $error = 'Заявка была удалена<br />';
} else { $user['zayrist'] = 0;
mysql_query('UPDATE `group_ristal` SET `uid1` = "'.$zv['uid1'].'", `uid2` = "'.$zv['uid2'].'", `uid3` = "'.$zv['uid3'].'" WHERE `id` = "'.$zv['id'].'" lIMIT 1'); mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
$user['zayrist'] = 0; } else {
mysql_query('UPDATE `users` SET `zayrist` = "'.$user['zayrist'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); mysql_query('UPDATE `group_ristal` SET `uid1` = "' . $zv['uid1'] . '", `uid2` = "' . $zv['uid2'] . '", `uid3` = "' . $zv['uid3'] . '" WHERE `id` = "' . $zv['id'] . '" lIMIT 1');
$error = 'Вы покинули заявку<br />'; $user['zayrist'] = 0;
} mysql_query('UPDATE `users` SET `zayrist` = "' . $user['zayrist'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
unset($zv); $error = 'Вы покинули заявку<br />';
}
unset($zv);
} }
}
} }
if($_GET['exit'] == 1) { if ($_GET['exit'] == 1) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); mysql_query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: city.php'); header('Location: city.php');
} }
Template::header('group_arena');
?> ?>
<html lang="ru"> <script>
<head> function growl(title, color, message, stycky) {
<title></title> if (!stycky) {
<meta charset="UTF-8" /> stycky = false;
<link rel="stylesheet" href="css/main.css" /> }
<script>function growl(title, color, message, stycky) { if(!stycky) { stycky = false; } if(!color) { color = 'Red'; } $.jGrowl(message, { header: '<img src="/i/jgrowl_moover.png" class="jgrowl-moover" title="Передвинуть" style="cursor: pointer;" /> <font style="color: '+color+';">'+title+'</font>', sticky: stycky, glue: 'before' }); }</script> if (!color) {
<script>function shows() { color = 'Red';
const clas = $("#alt").attr('class'); }
$("#mkgrp").toggle(); if(clas == 'show') { $("#alt").attr('class','hide'); $("#alt").text('Скрыть ...'); } else { $("#alt").attr('class','show'); $("#alt").text('Создать группу'); } }</script> $.jGrowl(message, {
<style>body { background-image: url('i/r240_1.jpg'); background-repeat: no-repeat; background-position: top right; }</style> header: '<img src="/i/jgrowl_moover.png" class="jgrowl-moover" title="Передвинуть" style="cursor: pointer;" /> <font style="color: ' + color + ';">' + title + '</font>',
</head> sticky: stycky,
glue: 'before'
});
}
<body > function shows() {
<table class="allzeroes"> const clas = $("#alt").attr('class');
$("#mkgrp").toggle();
if (clas == 'show') {
$("#alt").attr('class', 'hide');
$("#alt").text('Скрыть ...');
} else {
$("#alt").attr('class', 'show');
$("#alt").text('Создать группу');
}
}</script>
<style>
body {
background-image: url('i/r240_1.jpg');
background-repeat: no-repeat;
background-position: top right;
}
</style>
<table class="allzeroes">
<tr> <tr>
<td> <td>
<div align=center> <div align=center>
<h3>Турниры: Групповые сражения.</h3> <h3>Турниры: Групповые сражения.</h3>
<b>Внимание! В боях этой локации разрешается использовать свитки "Восстановления энергии" номиналом не более 180НР!</b><br /><br /> <b>Внимание! В боях этой локации разрешается использовать свитки "Восстановления энергии" номиналом не
<span style="color: Red;"><b>Внимание! При старте группового турнира руны автоматически будут сняты с персонажа. <br />Проверьте, что ваши вещи после снятия рун не упадут, и не забудьте надеть руны после выхода из локации!</b></span> более 180НР!</b><br/><br/>
</div> <span style="color: Red;"><b>Внимание! При старте группового турнира руны автоматически будут сняты с персонажа. <br/>Проверьте, что ваши вещи после снятия рун не упадут, и не забудьте надеть руны после выхода из локации!</b></span>
<? if($user['zayrist'] == 0) { ?><div align=left><h4>Принять участие в турнире:</h4></div><a onclick="shows();" href="#" class="show" id="alt">Создать группу</a><br /><? echo forms($user['level']); } else { echo form_start($user['id']); } ?> </div>
<div id="mkgrp" style="display: none;"> <? if ($user['zayrist'] == 0) { ?>
<fieldset style="text-align: justify; width: 250px; max-width: 250px; height: 100px; max-height: 100px; margin-top: 15px;"> <div align=left><h4>Принять участие в турнире:</h4></div><a onclick="shows();" href="#" class="show"
<form method="post"> id="alt">Создать группу</a>
Название: <input type="text" name="nameZv" size="20" /><br /> <br/><? echo forms($user['level']);
Комментарий: <input type="text" name="commentZv" size="15" /><br /> } else {
Пароль: <input type="text" name="passZv" size="10" /><br /><br /> echo form_start($user['id']);
<input type="submit" name="addZayavka" value="Создать группу" /> } ?>
</form> <div id="mkgrp" style="display: none;">
</fieldset> <fieldset
</div> style="text-align: justify; width: 250px; max-width: 250px; height: 100px; max-height: 100px; margin-top: 15px;">
<div align="left"><p>&nbsp;</p><h4>Победители 10-ти предыдущих турниров: <span id="levelCheck"><?=$user['level'];?></span>-е уровни </h4></div> <form method="post">
<div id="rate"></div> Название: <input type="text" name="nameZv" size="20"/><br/>
Комментарий: <input type="text" name="commentZv" size="15"/><br/>
Пароль: <input type="text" name="passZv" size="10"/><br/><br/>
<input type="submit" name="addZayavka" value="Создать группу"/>
</form>
</fieldset>
</div>
<div align="left"><p>&nbsp;</p><h4>Победители 10-ти предыдущих турниров: <span
id="levelCheck"><?= $user['level']; ?></span>-е уровни </h4></div>
<div id="rate"></div>
</td> </td>
<td align=right><button onclick="location.href='city.php?zaliv'">Вернуться</button><br /><br /> <td align=right>
<form method="POST"> <button onclick="location.href='city.php?zaliv'">Вернуться</button>
<input type="submit" value="Купить «Фамильный Герб» 5 кр." style="background-color: #A9AFC0;" name="buyFirst" /> <br/><br/>
<input type="submit" value="Купить «Фамильный Герб (х2)» 15 кр." style="background-color: #A9AFC0;" name="buySecond" /> <form method="POST">
</form> <input type="submit" value="Купить «Фамильный Герб» 5 кр." style="background-color: #A9AFC0;"
name="buyFirst"/>
<input type="submit" value="Купить «Фамильный Герб (х2)» 15 кр." style="background-color: #A9AFC0;"
name="buySecond"/>
</form>
</td> </td>
</tr> </tr>
</table> </table>
<div id="response"></div> <div id="response"></div>
<script> <script>
$(function() { $(function () {
let level =; let level =;
$('#rate').load('ajax/rate_ruins.php?level='+level); $('#rate').load('ajax/rate_ruins.php?level=' + level);
$.jGrowl.defaults.closerTemplate = '<div style="text-align: center; cursor: pointer;"><b>[ Закрыть ]</b></div>'; $.jGrowl.defaults.closerTemplate = '<div style="text-align: center; cursor: pointer;"><b>[ Закрыть ]</b></div>';
$.jGrowl.defaults.closeTemplate = '<img src="i/clear.gif" alt="x" title="Закрыть" />'; $.jGrowl.defaults.closeTemplate = '<img src="i/clear.gif" alt="x" title="Закрыть" />';
$('body').delegate('div#jGrowl .jgrowl-moover', 'click', function () {
const j = $(this).closest('div#jGrowl');
const c = j.hasClass('top-right') ? 'top-left' : 'top-right';
j.removeClass('top-left top-right').addClass(c);
});
$("#rate").on("click", "a", function (e) {
const level = $(this).attr("id");
$('#rate').load('ajax/rate_ruins.php?level=' + level);
});
$('body').delegate('div#jGrowl .jgrowl-moover', 'click', function() {
const j = $(this).closest('div#jGrowl');
const c = j.hasClass('top-right') ? 'top-left' : 'top-right';
j.removeClass('top-left top-right').addClass(c);
}); });
</script>
<? if ($error != '') {
$("#rate").on("click", "a", function(e) { echo "<script>growl('Внимание', 'Red', '$error');</script>";
const level = $(this).attr("id"); }
$('#rate').load('ajax/rate_ruins.php?level='+level);
});
});
</script>
<?if($error != '') { echo "<script>growl('Внимание', 'Red', '$error');</script>"; } ?>
</body>
</html>

View File

@ -42,34 +42,21 @@ $hr = new hellround;
$mytrip = $hr->is_in_trip($user['id']); $mytrip = $hr->is_in_trip($user['id']);
$tr = $hr->get_par($mytrip); $tr = $hr->get_par($mytrip);
Template::header('hell');
if ($mytrip > 0) { if ($mytrip > 0) {
?> ?>
<HTML> <style>
<HEAD> body {
<link rel=stylesheet type="text/css" href="css/main.css"> background-image: url('i/hell.jpg');
<meta content="text/html; charset=utf-8" http-equiv=Content-type> background-repeat: no-repeat;
<style> background-position: top right;
body { }
background-image: url('i/hell. jpg'); </style>
background-repeat: no-repeat; <?php
background-position: top right;
}
</style>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
<?
echo "<h3>Приближается <i>" . ($tr['volna'] + 1) . "</i> волна нашествия...</h3>"; echo "<h3>Приближается <i>" . ($tr['volna'] + 1) . "</i> волна нашествия...</h3>";
// диалоговый бот // диалоговый бот
?>
<table width=100%>
</table>
</BODY>
</HTML>
<?
} else { } else {
if ($_GET['start'] > 0) { if ($_GET['start'] > 0) {
$f = mysql_fetch_array(mysql_query("SELECT `date_out` FROM `hellround_pohod` WHERE `owner`= " . $user['id'] . " ORDER by `id` DESC LIMIT 1;")); $f = mysql_fetch_array(mysql_query("SELECT `date_out` FROM `hellround_pohod` WHERE `owner`= " . $user['id'] . " ORDER by `id` DESC LIMIT 1;"));
if ((time() - strtotime($f['date_out'])) < 3600 * 24) { if ((time() - strtotime($f['date_out'])) < 3600 * 24) {
@ -82,20 +69,14 @@ if ($mytrip > 0) {
} }
?> ?>
<HTML> <style>
<HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<style>
body { body {
background-image: url('i/hell. jpg'); background-image: url('i/hell.jpg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top right; background-position: top right;
} }
</style> </style>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
<TABLE border=0 width=100% cellspacing="0" cellpadding="0"> <TABLE border=0 width=100% cellspacing="0" cellpadding="0">
<td align=left> <td align=left>
<INPUT TYPE="button" onclick="location.href = 'hell.php?start=1';" value="НАЧАТЬ ПОХОД" name="strah"> <INPUT TYPE="button" onclick="location.href = 'hell.php?start=1';" value="НАЧАТЬ ПОХОД" name="strah">
@ -139,8 +120,5 @@ if ($mytrip > 0) {
</fieldset> </fieldset>
</center> </center>
</FORM> </FORM>
</BODY>
</HTML>
<? <?
} }
?>

View File

@ -1,14 +1,18 @@
<? <?php
session_start(); session_start();
if(empty($_SESSION['uid'])) { header('Location: index.php'); exit; } if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
include('config.php'); include('config.php');
$user = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$_SESSION['uid'].'" LIMIT 1')); $user = new User($_SESSION['uid']);
$hostel = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `type`, `time` FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1')); $hostel = mysql_fetch_array(mysql_query('SELECT `id`, `uid`, `type`, `time` FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
#include('functions.php'); #include('functions.php');
$error = ''; $rs = ''; $error = '';
$base = array(1 => array('type' => 'Сумка'), 2 => array('type' => 'Сундук'), 3 => array('type' => 'Комната'), 4 => array('type' => 'Амбар')); $rs = '';
$times = array(1 => 7, 2 => 14, 3 => 21, 4 => 28); $base = [1 => ['type' => 'Сумка'], 2 => ['type' => 'Сундук'], 3 => ['type' => 'Комната'], 4 => ['type' => 'Амбар']];
$cost = array(1 => array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160)); $times = [1 => 7, 2 => 14, 3 => 21, 4 => 28];
$cost = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]];
function remove_hostel_items($u) function remove_hostel_items($u)
{ {
@ -21,7 +25,7 @@ function remove_hostel_items($u)
function select_arenda($u, $type, $redirect = false) function select_arenda($u, $type, $redirect = false)
{ {
$hostel = mysql_fetch_array(mysql_query('SELECT `id` FROM `hostel` WHERE `uid` = "' . $u['id'] . '" LIMIT 1')); $hostel = mysql_fetch_array(mysql_query('SELECT `id` FROM `hostel` WHERE `uid` = "' . $u['id'] . '" LIMIT 1'));
$price = array(1 => 8, 2 => 15, 3 => 25, 4 => 40); $price = [1 => 8, 2 => 15, 3 => 25, 4 => 40];
if (!isset($u['id'])) { if (!isset($u['id'])) {
$r = 'Персонаж не найден ...'; $r = 'Персонаж не найден ...';
} else { } else {
@ -42,252 +46,281 @@ function select_arenda($u, $type, $redirect = false)
$r = 'Неверный тип аренды ...'; $r = 'Неверный тип аренды ...';
} }
} }
if ($redirect == true) { if ($redirect) {
header('Location: main.php'); header('Location: main.php');
} }
return $r; return $r;
} }
if ($_GET['exit'] == 1) {
if($_GET['exit'] == 1) { if ($user['sleep'] == 0) {
if($user['sleep'] == 0) { mysql_query('UPDATE `users`,`online` SET `users`.`room` = 26, `online`.`room` = 26 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 26, `online`.`room` = 26 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); header('Location: city.php');
header('Location: city.php');
} else {
$error = 'Вы спите ...';
}
}
if($_GET['to_room'] == 1) {
if(isset($hostel['id'])) {
if($hostel['time'] > time()) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 661, `online`.`room` = 661 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"');
header('Location: hostel_room.php');
} else { } else {
$error = 'У Вас просрочена аренда. Оплатите что-бы продолжить пользоваться нашими услугами ...'; $error = 'Вы спите ...';
} }
} else {
$error = 'У Вас, нету комнаты ...';
}
} }
if($_GET['pays']) { if ($_GET['to_room'] == 1) {
if((int)$_GET['pays'] >= 1 && (int)$_GET['pays'] <= 4) { if (isset($hostel['id'])) {
if(isset($hostel['id'])) { if ($hostel['time'] > time()) {
if($user['money'] >= $cost[$hostel['type']][(int)$_GET['pays']]) { mysql_query('UPDATE `users`,`online` SET `users`.`room` = 661, `online`.`room` = 661 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
$time = $hostel['time']+60*60*24*$times[(int)$_GET['pays']]; header('Location: hostel_room.php');
$user['money'] -= $cost[$hostel['type']][(int)$_GET['pays']]; } else {
$hostel['time'] = $time; $error = 'У Вас просрочена аренда. Оплатите что-бы продолжить пользоваться нашими услугами ...';
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); }
mysql_query('UPDATE `hostel` SET `time` = "'.$time.'" WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1');
$error = 'Всё прошло успешно ...';
} else {
$error = 'Недостаточно денег ...';
}
} else { } else {
$error = 'Ошибка #1'; $error = 'У Вас, нету комнаты ...';
} }
}
} }
if(isset($_POST['select']) && isset($_POST['tariff'])) { if ($_GET['pays'] && (int)$_GET['pays'] >= 1 && (int)$_GET['pays'] <= 4) {
if($_POST['tariff'] == 0) { if (isset($hostel['id'])) {
$error = 'Выберите тариф ...'; if ($user['money'] >= $cost[$hostel['type']][(int)$_GET['pays']]) {
} else { $time = $hostel['time'] + 60 * 60 * 24 * $times[(int)$_GET['pays']];
$error = select_arenda($user, (int)$_POST['tariff']); $user['money'] -= $cost[$hostel['type']][(int)$_GET['pays']];
} $hostel['time'] = $time;
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('UPDATE `hostel` SET `time` = "' . $time . '" WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
$error = 'Всё прошло успешно ...';
} else {
$error = 'Недостаточно денег ...';
}
} else {
$error = 'Ошибка #1';
}
} }
if($_GET['del'] == 1) { if (isset($_POST['select']) && isset($_POST['tariff'])) {
if(isset($hostel['id']) && $hostel['time'] > time()) { if ($_POST['tariff'] == 0) {
mysql_query('DELETE FROM `hostel` WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1'); $error = 'Выберите тариф ...';
remove_hostel_items($user['id']); } else {
$error = 'Вы успешно отказались от аренды ...'; $error = select_arenda($user, (int)$_POST['tariff']);
unset($hostel); }
} elseif(isset($hostel['id']) && $hostel['time'] < time()) {
$error = 'Нельзя отказаться от услуг если имеется задолежнность ...';
}
} }
if(isset($_POST['deselect']) && isset($_POST['retariff'])) { if ($_GET['del'] == 1) {
if(isset($hostel['id']) && $hostel['time'] > time()) { if (isset($hostel['id']) && $hostel['time'] > time()) {
mysql_query('DELETE FROM `hostel` WHERE `uid` = "'.$user['id'].'" AND `id` = "'.$hostel['id'].'" LIMIT 1'); mysql_query('DELETE FROM `hostel` WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
remove_hostel_items($user['id']); remove_hostel_items($user['id']);
select_arenda($user, (int)$_POST['retariff'], true); $error = 'Вы успешно отказались от аренды ...';
} elseif(isset($hostel['id']) && $hostel['time'] < time()) { unset($hostel);
$error = 'Нельзя сменить услугу если имеется задолежнность ...'; } elseif (isset($hostel['id']) && $hostel['time'] < time()) {
} $error = 'Нельзя отказаться от услуг если имеется задолежнность ...';
}
} }
if($_GET['sleep'] && $user['sleep'] == 0) { if (isset($_POST['deselect']) && isset($_POST['retariff'])) {
if($user['sleep_time'] <= time()) { if (isset($hostel['id']) && $hostel['time'] > time()) {
if($user['vip'] == 1) { $sl = 8; } elseif($user['vip'] == 2) { $sl = 12; } elseif($user['vip'] == 3) { $sl = 18; } else { $sl = 2; } mysql_query('DELETE FROM `hostel` WHERE `uid` = "' . $user['id'] . '" AND `id` = "' . $hostel['id'] . '" LIMIT 1');
mysql_query('UPDATE `users` SET `sleep` = "'.(time()+60*60*$sl).'", `sleep_time` = "'.(time()+60*60*8).'" WHERE `id` = "'.$user['id'].'" LIMIT 1'); remove_hostel_items($user['id']);
mysql_query('INSERT INTO `effects` (`type`, `name`, `time`, `owner`) VALUES ("8", "Сон", "'.(time()+60*60*$sl).'", "'.$user['id'].'")'); select_arenda($user, (int)$_POST['retariff'], true);
$ef = mysql_query('SELECT `id`, `time`, `type` FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 5 AND `type` != 4 AND `type` != 2 AND `type` != 3 AND `type` != 8'); } elseif (isset($hostel['id']) && $hostel['time'] < time()) {
while($pl = mysql_fetch_array($ef)) { $error = 'Нельзя сменить услугу если имеется задолежнность ...';
$tm = $pl['time']-time(); }
mysql_query('UPDATE `effects` SET `sleep` = "'.$tm.'" WHERE `id` = "'.$pl['id'].'" AND `owner` = "'.$user['id'].'"'); }
if ($_GET['sleep'] && $user['sleep'] == 0) {
if ($user['sleep_time'] <= time()) {
if ($user['vip'] == 1) {
$sl = 8;
} elseif ($user['vip'] == 2) {
$sl = 12;
} elseif ($user['vip'] == 3) {
$sl = 18;
} else {
$sl = 2;
}
mysql_query('UPDATE `users` SET `sleep` = "' . (time() + 60 * 60 * $sl) . '", `sleep_time` = "' . (time() + 60 * 60 * 8) . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('INSERT INTO `effects` (`type`, `name`, `time`, `owner`) VALUES ("8", "Сон", "' . (time() + 60 * 60 * $sl) . '", "' . $user['id'] . '")');
$ef = mysql_query('SELECT `id`, `time`, `type` FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `type` != 11 AND `type` != 12 AND `type` != 13 AND `type` != 14 AND `type` != 5 AND `type` != 4 AND `type` != 2 AND `type` != 3 AND `type` != 8');
while ($pl = mysql_fetch_array($ef)) {
$tm = $pl['time'] - time();
mysql_query('UPDATE `effects` SET `sleep` = "' . $tm . '" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "' . $user['id'] . '"');
}
header('Location: hostel.php');
} else {
$error = 'Нельзя спать ... Приходите через : ' . timeOut($user['sleep_time'] - time());
}
}
if ($_GET['unsleep'] && $user['sleep'] > 0) {
mysql_query('UPDATE `users` SET `sleep` = "0" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('DELETE FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `type` = "8" LIMIT 1');
$ef = mysql_query('SELECT `id`, `time`, `sleep` FROM `effects` WHERE `owner` = "' . $user['id'] . '" AND `sleep` != 0');
while ($pl = mysql_fetch_array($ef)) {
$tm = time() + $pl['sleep'];
mysql_query('UPDATE `effects` SET `time` = "' . $tm . '", `sleep` = "0" WHERE `id` = "' . $pl['id'] . '" AND `owner` = "' . $user['id'] . '"');
} }
header('Location: hostel.php'); header('Location: hostel.php');
} else {
$error = 'Нельзя спать ... Приходите через : '.timeOut($user['sleep_time']-time());
}
} }
Template::header('Хостел');
if($_GET['unsleep'] && $user['sleep'] > 0) {
mysql_query('UPDATE `users` SET `sleep` = "0" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('DELETE FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `type` = "8" LIMIT 1');
$ef = mysql_query('SELECT `id`, `time`, `sleep` FROM `effects` WHERE `owner` = "'.$user['id'].'" AND `sleep` != 0');
while($pl = mysql_fetch_array($ef)) {
$tm = time()+$pl['sleep'];
mysql_query('UPDATE `effects` SET `time` = "'.$tm.'", `sleep` = "0" WHERE `id` = "'.$pl['id'].'" AND `owner` = "'.$user['id'].'"');
}
header('Location: hostel.php');
}
?> ?>
<!doctype html> <script src="js/ajaxLoad.js"></script>
<html> <? if (isset($hostel['id'])) { ?>
<head> <script>
<title>404</title> $(document).ready(function () {
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> $("#retariff option[value='<?=$hostel['type']; ?>']").remove();
<meta http-equiv="content-language" content="ru" /> });
<script src="js/ajaxLoad.js"></script> </script>
<? if(isset($hostel['id'])) { ?> <? } ?>
<script> <link rel="stylesheet" href="css/hostel.css"/>
$(document).ready(function() {
$("#retariff option[value='<?=$hostel['type']; ?>']").remove();
});
</script>
<? } ?>
<link rel="stylesheet" type="text/css" href="css/hostel.css" />
</head>
<body>
<div class="contentContainer"> <div class="contentContainer">
<div style="text-align: center;"><span class="hs">Гостиница, Холл</span></div> <div style="text-align: center;"><span class="hs">Гостиница, Холл</span></div>
<div class="buttonContainer"> <div class="buttonContainer">
<? if($user['sleep'] == 0) { ?> <? if ($user['sleep'] == 0) { ?>
<input type="button" class="btns button-route" value="Уснуть" onclick="location.href='?sleep=1';" /> <input type="button" class="btns button-route" value="Уснуть" onclick="location.href='?sleep=1';"/>
<? } else { ?> <? } else { ?>
<input type="button" class="btns button-route" value="Пробудиться" onclick="location.href='?unsleep=1';" /> <input type="button" class="btns button-route" value="Пробудиться" onclick="location.href='?unsleep=1';"/>
<? } ?> <? } ?>
<input type="button" class="btns" value="Обновить" onclick="location.href='main.php';" /> <input type="button" class="btns" value="Обновить" onclick="location.href='main.php';"/>
<input type="button" class="btns button-route" value="На улицу" onclick="location.href='?exit=1';" /> <input type="button" class="btns button-route" value="На улицу" onclick="location.href='?exit=1';"/>
<input type="button" class="btns button-route" value="Комната" onclick="location.href='?to_room=1';" /> <input type="button" class="btns button-route" value="Комната" onclick="location.href='?to_room=1';"/>
</div>
<div id="hostelLeft">
<div id="hostelInteractive">
<? if(!isset($hostel['id'])) { ?>
<fieldset class="hostelClientState">
<legend>Станьте нашим клиентом</legend>
<form method="post" style="text-align: center; width: 100%;">
<input type="hidden" name="act" value="settariff" />
<p>Выберите подходящий для Вас вариант обслуживания:</p>
<div style="text-align: center; width: 100%;">
<select name="tariff" class="tariff">
<option value="0">Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
<input type="submit" class="button" value="Выбрал" name="select" />
<? if($error != '') { echo '<br /><b style="color: Red;">'.$error.'</b><br />'; } ?>
</div>
</form>
</fieldset>
<? } else { ?>
<fieldset class="hostelClientState">
<legend>Добро пожаловать!</legend>
<form method="post" style="text-align: center; width: 100%;">
<p>Вы выбрали вариант предоставления жилья : <b><?=$base[$hostel['type']]['type']; ?></b></p>
<p>Аренда оплачена по: <? echo date('h:i d.m.y', $hostel['time']); ?> (<small><? echo timeOut($hostel['time']-time()); ?></small>)</p>
<div style="text-align: center; width: 100%;">
Сменить вариант аренды <select name="retariff" id="retariff">
<option value="0">Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
<input type="submit" class="button" value="Сменить" name="deselect" />
</div>
</form>
<a href="javascript: void(0);" style="float: left; margin-left: 3px;" onclick="if(confirm('Вы уверены?')) { location.href='?del=1'; }">Расторгнуть договор</a> <a href="javascript: void(0);" onclick="ajaxLoad('/hostel_checkpoint.php', 'hostelInteractive', {act:'pay'})" style="float: right; margin-right: 3px;">Внести предоплату</a>
<? if($error != '') { echo '<br /><center><b style="color: Red;">'.$error.'</b></center><br />'; } ?>
</fieldset>
<? } ?>
</div> </div>
<fieldset class="hostelRules" style="overflow: hidden;">
<legend>Правила проживания</legend>
<div style="overflow: auto; height: 168px !important; margin: 0; padding: 0;">
<div style="margin: 0; padding: 0; height: 100%;">
<h2>И что я получу за свои кровные?</h2>
У нас ты можешь:
<br/>- хранить свое барахло и прочий хлам.
<h2>Охрана у вас есть? Не воруют?</h2>
Самые любопытные могут получить в сурло прямо здесь - в холле.
<br />- Устраивать беспорядки в комнатах не позволено.
<br />- Прислуга у нас проверенная - пожитки твои не тронут.
<h2>И сколько стоит всё это удовольствие?</h2>
- Комнаты есть разные, для людей разного достатка. Смотри справа расценки.
<br />- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой.
<br />- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря.
<h2>Как всем этим пользоваться?</h2> <div id="hostelLeft">
Всё просто. Плати и живи. <div id="hostelInteractive">
<br />Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида вещей, фильтр поможет разобраться. <? if (!isset($hostel['id'])) { ?>
<h2>Что ещё мне нужно знать?</h2> <fieldset class="hostelClientState">
- При смене размера комнаты, ты теряешь оставшееся оплаченное время. <legend>Станьте нашим клиентом</legend>
<br />- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для погашения задолжености. <form method="post" style="text-align: center; width: 100%;">
<br />- Если долг будет разумный, то подарки забирать с полки не будем. <input type="hidden" name="act" value="settariff"/>
<br />- Быстро сориентироваться с шмотом поможет фильтр предметов. <p>Выберите подходящий для Вас вариант обслуживания:</p>
<br />- Если что потеряешь - твои проблемы. <div style="text-align: center; width: 100%;">
<select name="tariff" class="tariff">
<option value="0">Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
<input type="submit" class="button" value="Выбрал" name="select"/>
<? if ($error != '') {
echo '<br /><b style="color: Red;">' . $error . '</b><br />';
} ?>
</div>
</form>
</fieldset>
<? } else { ?>
<fieldset class="hostelClientState">
<legend>Добро пожаловать!</legend>
<form method="post" style="text-align: center; width: 100%;">
<p>Вы выбрали вариант предоставления жилья : <b><?= $base[$hostel['type']]['type']; ?></b></p>
<p>Аренда оплачена по: <? echo date('h:i d.m.y', $hostel['time']); ?>
(<small><? echo timeOut($hostel['time'] - time()); ?></small>)</p>
<div style="text-align: center; width: 100%;">
Сменить вариант аренды <select name="retariff" id="retariff">
<option value="0">Выбор ...</option>
<option value="1">Сумка</option>
<option value="2">Сундук</option>
<option value="3">Комната</option>
<option value="4">Амбар</option>
</select>
<input type="submit" class="button" value="Сменить" name="deselect"/>
</div>
</form>
<a href="javascript: void(0);" style="float: left; margin-left: 3px;"
onclick="if(confirm('Вы уверены?')) { location.href='?del=1'; }">Расторгнуть договор</a> <a
href="javascript: void(0);"
onclick="ajaxLoad('/hostel_checkpoint.php', 'hostelInteractive', {act:'pay'})"
style="float: right; margin-right: 3px;">Внести предоплату</a>
<? if ($error != '') {
echo '<br /><center><b style="color: Red;">' . $error . '</b></center><br />';
} ?>
</fieldset>
<? } ?>
</div> </div>
</div> <fieldset class="hostelRules" style="overflow: hidden;">
</fieldset> <legend>Правила проживания</legend>
</div> <div style="overflow: auto; height: 168px !important; margin: 0; padding: 0;">
<div style="margin: 0; padding: 0; height: 100%;">
<h2>И что я получу за свои кровные?</h2>
У нас ты можешь:
<br/>- хранить свое барахло и прочий хлам.
<h2>Охрана у вас есть? Не воруют?</h2>
Самые любопытные могут получить в сурло прямо здесь - в холле.
<br/>- Устраивать беспорядки в комнатах не позволено.
<br/>- Прислуга у нас проверенная - пожитки твои не тронут.
<h2>И сколько стоит всё это удовольствие?</h2>
- Комнаты есть разные, для людей разного достатка. Смотри справа расценки.
<br/>- Платить нужно каждый день. Пока не заплатишь - на лестницу не ногой.
<br/>- Вместимость - это сколько твоих вещей влезет в комнату, имеется ввиду общая масса инвентаря.
<div id="hostelRight"> <h2>Как всем этим пользоваться?</h2>
<fieldset> Всё просто. Плати и живи.
<legend>Тарифы и услуги</legend> <br/>Приходишь, платишь по долгам, проходишь в аппартаменты. В сундуке есть секции для каждого вида
<br /> вещей, фильтр поможет разобраться.
<table class="tarifsList" cellpadding="0" cellspacing="0"> <h2>Что ещё мне нужно знать?</h2>
<caption>Сумка</caption> - При смене размера комнаты, ты теряешь оставшееся оплаченное время.
<tbody> <br/>- При просрочке платы более 60 суток, мы оставляем за собой право сдать вещи на аукцион для
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">15 ед.</td></tr> погашения задолжености.
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">8.00 кр.</td></tr> <br/>- Если долг будет разумный, то подарки забирать с полки не будем.
</tbody> <br/>- Быстро сориентироваться с шмотом поможет фильтр предметов.
</table> <br/>- Если что потеряешь - твои проблемы.
<br /> </div>
<table class="tarifsList" cellpadding="0" cellspacing="0"> </div>
<caption>Сундук</caption> </fieldset>
<tbody> </div>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">30 ед.</td></tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">15.00 кр.</td></tr>
</tbody>
</table>
<br />
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Комната</caption>
<tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">50 ед.</td></tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">25.00 кр.</td></tr>
</tbody>
</table>
<br />
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Амбар</caption>
<tbody>
<tr><td class="tarifListLabel">Вместимость</td><td class="tarifListValue">100 ед.</td></tr>
<tr><td class="tarifListLabel">Стоимость (7 сут.)</td><td class="tarifListValue">40.00 кр.</td></tr>
</tbody>
</table>
</fieldset>
</div>
</div>
</body> <div id="hostelRight">
</html> <fieldset>
<legend>Тарифы и услуги</legend>
<br/>
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Сумка</caption>
<tbody>
<tr>
<td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">15 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">8.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Сундук</caption>
<tbody>
<tr>
<td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">30 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">15.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Комната</caption>
<tbody>
<tr>
<td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">50 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">25.00 кр.</td>
</tr>
</tbody>
</table>
<br/>
<table class="tarifsList" cellpadding="0" cellspacing="0">
<caption>Амбар</caption>
<tbody>
<tr>
<td class="tarifListLabel">Вместимость</td>
<td class="tarifListValue">100 ед.</td>
</tr>
<tr>
<td class="tarifListLabel">Стоимость (7 сут.)</td>
<td class="tarifListValue">40.00 кр.</td>
</tr>
</tbody>
</table>
</fieldset>
</div>
</div>

View File

@ -1,23 +1,24 @@
<? <?
session_start(); session_start();
if(empty($_SESSION['uid'])) { header('Location: index.php'); exit; } if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
require_once "functions.php"; require_once "functions.php";
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1')); $hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$base = array(1 => array(8, 16, 24, 32), 2 => array(15, 30, 45, 60), 3 => array(25, 50, 75, 100), 4 => array(40, 80, 120, 160)); $base = [1 => [8, 16, 24, 32], 2 => [15, 30, 45, 60], 3 => [25, 50, 75, 100], 4 => [40, 80, 120, 160]];
if(isset($_POST['act']) && $_POST['act'] == 'pay') { if (isset($_POST['act']) && $_POST['act'] == 'pay' && isset($user['id']) && isset($hostel['id'])) {
if(isset($user['id']) && isset($hostel['id'])) {
echo '<fieldset class="hostelClientState">'; echo '<fieldset class="hostelClientState">';
echo '<legend>Предварительная оплата</legend>'; echo '<legend>Предварительная оплата</legend>';
echo '<div style="text-align: center;"><p class="NORMAL" style="margin: 5px 0">'; echo '<div style="text-align: center;"><p class="NORMAL" style="margin: 5px 0">';
echo 'Аренда оплачена по: <b>'.date('h:i d.m.y', $hostel['time']).'</b> <small>('.timeOut($hostel['time']-time()).')</small></p></div>'; echo 'Аренда оплачена по: <b>' . date('h:i d.m.y', $hostel['time']) . '</b> <small>(' . timeOut($hostel['time'] - time()) . ')</small></p></div>';
echo '<table align="center" class="periods"><caption style="text-align: left;">Выберите срок предоплаты.</caption> echo '<table align="center" class="periods"><caption style="text-align: left;">Выберите срок предоплаты.</caption>
<tbody> <tbody>
<tr class="caption"><th>Сутки</th><td title="7 дн.">7</td><td title="14 дн.">14</td><td title="21 дн.">21</td><td title="28 дн.">28</td></tr> <tr class="caption"><th>Сутки</th><td title="7 дн.">7</td><td title="14 дн.">14</td><td title="21 дн.">21</td><td title="28 дн.">28</td></tr>
<tr class="value"><th>Сумма</th><td title="7 дн."><a href="?pays=1">'.$base[$hostel['type']][0].'</a></td><td title="14 дн."><a href="?pays=2">'.$base[$hostel['type']][1].'</a></td><td title="21 дн."><a href="?pays=3">'.$base[$hostel['type']][2].'</a></td><td title="28 дн."><a href="?pays=4">'.$base[$hostel['type']][3].'</a></td></tr> <tr class="value"><th>Сумма</th><td title="7 дн."><a href="?pays=1">' . $base[$hostel['type']][0] . '</a></td><td title="14 дн."><a href="?pays=2">' . $base[$hostel['type']][1] . '</a></td><td title="21 дн."><a href="?pays=3">' . $base[$hostel['type']][2] . '</a></td><td title="28 дн."><a href="?pays=4">' . $base[$hostel['type']][3] . '</a></td></tr>
</tbody> </tbody>
</table> </table>
<div style="color: red; font-size: 9px; padding-top: 3px;"><b>Внимание!</b> При расторжении договора или смене тарифа, внесенная плата не возвращается</div></fieldset></div>'; <div style="color: red; font-size: 9px; padding-top: 3px;"><b>Внимание!</b> При расторжении договора или смене тарифа, внесенная плата не возвращается</div></fieldset></div>';
}
} }

View File

@ -1,22 +1,29 @@
<?php <?php
session_start(); session_start();
if(empty($_SESSION['uid'])) { header('Location: index.php'); exit; } if (empty($_SESSION['uid'])) {
header('Location: index.php');
exit;
}
require_once "functions.php"; require_once "functions.php";
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0")); $d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0"));
$in = mysql_fetch_array(mysql_query('SELECT COUNT(*) AS `cnt` FROM `inventory` WHERE `owner` = "-101'.$user['id'].'"')); $in = mysql_fetch_array(mysql_query('SELECT COUNT(*) AS `cnt` FROM `inventory` WHERE `owner` = "-101' . $user['id'] . '"'));
$hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'.$user['id'].'" LIMIT 1')); $hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "' . $user['id'] . '" LIMIT 1'));
$base = array(1 => 15, 2 => 30, 3 => 50, 4 => 100); $base = [1 => 15, 2 => 30, 3 => 50, 4 => 100];
$vips = array(1 => 0.15, 2 => 0.30, 3 => 0.45); $vips = [1 => 0.15, 2 => 0.30, 3 => 0.45];
function show_item($row, $txt, $place) function show_item($row, $txt, $place)
{ {
if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) destructitem($row['id']); if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) {
destructitem($row['id']);
}
$r = ''; $r = '';
$ntxt = "В инвентаре"; $ntxt = "В инвентаре";
if ($txt == "В сундук") $ntxt = "В сундуке"; if ($txt == "В сундук") {
$ntxt = "В сундуке";
}
$magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $$row['magic'])->fetch_assoc(); $magic = db::c()->query('SELECT * FROM `magic` WHERE `id` = ?i', $$row['magic'])->fetch_assoc();
$incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1')); $incmagic = mysql_fetch_array(mysql_query('SELECT * FROM `magic` WHERE `id` = \'' . $row['includemagic'] . '\' LIMIT 1'));
@ -28,8 +35,8 @@ function show_item($row, $txt, $place)
$magic['time'] = $incmagic['time']; $magic['time'] = $incmagic['time'];
$magic['targeted'] = $incmagic['targeted']; $magic['targeted'] = $incmagic['targeted'];
} }
#href="?search=1&otdel='.$row['otdel'].'&place='.$place.'&itm='.$row['id'].'&set=1"
if (isset($row['id'])) { if (isset($row['id'])) {
//todo подтянуть отображение предмета из класса
$r .= '<div id="inv_' . $row['id'] . '"><table><tbody>'; $r .= '<div id="inv_' . $row['id'] . '"><table><tbody>';
$r .= '<tr valign="top" style="border: 2px groove threedface;">'; $r .= '<tr valign="top" style="border: 2px groove threedface;">';
$r .= '<td class="even links original"><img src="/i/sh/' . $row['img'] . '"> $r .= '<td class="even links original"><img src="/i/sh/' . $row['img'] . '">
@ -56,7 +63,9 @@ function show_item($row, $txt, $place)
if (!$row['needident']) { if (!$row['needident']) {
if ($magic['chanse']) { if ($magic['chanse']) {
if ($magic['chanse'] >= 95) $magic['chanse'] = 95; if ($magic['chanse'] >= 95) {
$magic['chanse'] = 95;
}
$r .= 'Вероятность срабатывания: ' . $magic['chanse'] . '%<br />'; $r .= 'Вероятность срабатывания: ' . $magic['chanse'] . '%<br />';
} }
if ($magic['time']) { if ($magic['time']) {
@ -67,7 +76,7 @@ function show_item($row, $txt, $place)
} }
$r .= '<div class="need">'; $r .= '<div class="need">';
$user = array(); $user = [];
if ($row['nsila']) { if ($row['nsila']) {
$r .= '&bull; '; $r .= '&bull; ';
@ -238,7 +247,7 @@ function show_item($row, $txt, $place)
$r .= '<span style="color: maroon;"><b>Свойства предмета не идентифицированы</b></span><br />'; $r .= '<span style="color: maroon;"><b>Свойства предмета не идентифицированы</b></span><br />';
} }
$osob = array(22, 23); $osob = [22, 23];
if (in_array($row['type'], $osob)) { if (in_array($row['type'], $osob)) {
$r .= 'Особенности:<br />'; $r .= 'Особенности:<br />';
if ($row['type'] == 22) { if ($row['type'] == 22) {
@ -277,164 +286,185 @@ function show_itm_hostel($uid, $otdel, $type = 1)
return $r; return $r;
} }
if($user['vip'] > 0 && $user['vip_time'] > time()) { if ($user['vip'] > 0 && $user['vip_time'] > time()) {
$count = $base[$hostel['type']]; $count = $base[$hostel['type']];
$count += floor($base[$hostel['type']]*$vips[$user['vip']]); $count += floor($base[$hostel['type']] * $vips[$user['vip']]);
} else { } else {
$count = $base[$hostel['type']]; $count = $base[$hostel['type']];
} }
if($_GET['search']) { if ($_GET['search']) {
$r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']); $r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']);
} else { } else {
$r = '<tr><td width="100%" align="center" class="even" style="text-align: center;"><b><center>Поиск ...</center></b></td></tr>'; $r = '<tr><td width="100%" align="center" class="even" style="text-align: center;"><b><center>Поиск ...</center></b></td></tr>';
} }
if($_GET['set'] && $_GET['set'] == 1) { if ($_GET['set'] && $_GET['set'] == 1) {
$it = mysql_fetch_array(mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `id` = "'.(int)$_GET['itm'].'" LIMIT 1')); $it = mysql_fetch_array(mysql_query('SELECT `id`, `owner` FROM `inventory` WHERE `id` = "' . (int)$_GET['itm'] . '" LIMIT 1'));
if(isset($it['id'])) { if (isset($it['id'])) {
if($it['owner'] == $user['id']) { if ($it['owner'] == $user['id']) {
if($in['cnt'] < $count) { if ($in['cnt'] < $count) {
mysql_query('UPDATE `inventory` SET `owner` = "-101'.$user['id'].'" WHERE `id` = "'.$it['id'].'" LIMIT 1'); mysql_query('UPDATE `inventory` SET `owner` = "-101' . $user['id'] . '" WHERE `id` = "' . $it['id'] . '" LIMIT 1');
$in['cnt']++; $in['cnt']++;
} else { } else {
$error = 'Не хватает места ...'; $error = 'Не хватает места ...';
} }
} elseif($it['owner'] == '-101'.$user['id']) { } elseif ($it['owner'] == '-101' . $user['id']) {
mysql_query('UPDATE `inventory` SET `owner` = "'.$user['id'].'" WHERE `id` = "'.$it['id'].'" LIMIT 1'); mysql_query('UPDATE `inventory` SET `owner` = "' . $user['id'] . '" WHERE `id` = "' . $it['id'] . '" LIMIT 1');
$in['cnt']--; $in['cnt']--;
}
} }
} unset($it);
unset($it); header('Location: hostel_room.php?search=1&otdel=' . $_GET['otdel'] . '&place=' . $_GET['place']);
header('Location: hostel_room.php?search=1&otdel='.$_GET['otdel'].'&place='.$_GET['place']);
} }
if($_GET['search']) { if ($_GET['search']) {
$r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']); $r = show_itm_hostel($user['id'], (int)$_GET['otdel'], (int)$_GET['place']);
} }
####### #######
$w = (270*$d['mass']/get_meshok()); $w_a = 270-$w; $w = (270 * $d['mass'] / get_meshok());
$h = (270*$in['cnt']/$count); $h_a = 270-$h; $w_a = 270 - $w;
$h = (270 * $in['cnt'] / $count);
$h_a = 270 - $h;
####### #######
if($_GET['go_back'] == 1) { if ($_GET['go_back'] == 1) {
mysql_query('UPDATE `users`,`online` SET `users`.`room` = 660, `online`.`room` = 660 WHERE `users`.`id` = "'.$user['id'].'" AND `online`.`id` = "'.$user['id'].'"'); mysql_query('UPDATE `users`,`online` SET `users`.`room` = 660, `online`.`room` = 660 WHERE `users`.`id` = "' . $user['id'] . '" AND `online`.`id` = "' . $user['id'] . '"');
header('Location: hostel.php'); header('Location: hostel.php');
} }
Template::header('hostel_room');
?> ?>
<!doctype html> <script src="js/ajaxLoad.js"></script>
<html> <link rel="stylesheet" type="text/css" href="css/hostel.css"/>
<head> <div class="contentContainer" id="hostelContainer">
<title>404</title> <div id="systemMsg" class="system-msg"></div>
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> <div class="buttonContainer">
<meta http-equiv="content-language" content="ru" /> <input type="button" class="btns" value="Обновить" onclick="location.href='hostel_room.php';"/>
<script src="js/ajaxLoad.js"></script> <input type="button" class="btns button-route" value="Спуститься" onclick="location.href='?go_back=1';"/>
<link rel="stylesheet" type="text/css" href="css/hostel.css" /> <h1>Комнатуха</h1>
</head> </div>
<body> <style type="text/css">
<div class="contentContainer" id="hostelContainer"> .hides {
<div id="systemMsg" class="system-msg"></div><div class="buttonContainer"> display: none;
<input type="button" class="btns" value="Обновить" onclick="location.href='hostel_room.php';" /> }
<input type="button" class="btns button-route" value="Спуститься" onclick="location.href='?go_back=1';" />
<h1>Комнатуха</h1>
</div>
<style type="text/css">
.hides {
display: none;
}
#hstInventory td.item {
width: 85%;
}
#hstInventory td.links {
text-align:center;
vertical-align:middle;
width:117px;
}
#hstInventory td.links span {
display: block;
}
#hstInventory td.original span.pk-current{
display:none;
}
#hstInventory td.moved {
font-weight: bold;
}
#hstInventory td.odd {
background-color: #c7c7c7;
}
#hstInventory td.even {
background-color: #d5d5d5;
}
label{ #hstInventory td.item {
font-weight: bold; width: 85%;
margin-right:15px; }
}
</style>
<script>
function hide_this(id) {
const node = document.getElementById(id);
if(node) {
node.style.display = 'none';
}
}
</script>
<div style="overflow: hidden;">
<fieldset id="hstInventoryA" style="width: 377px; float: left; text-align: center;">
<legend>Фильтр инвентаря</legend>
<div style="height: 53px">
<form method="GET">
<input type="radio" class="radio" id="hstF1" name="place" value="2" /><label for="hstF1">мешок</label>
<input type="radio" class="radio" id="hstF2" name="place" value="1" /><label for="hstF2">сундук</label>
<div style="height: 5px;overflow: hidden;"></div> #hstInventory td.links {
<select name="otdel"> text-align: center;
<option value="-1">&nbsp;</option> vertical-align: middle;
<optgroup label="Оружие"> width: 117px;
<option value="1">кастеты,ножи</option> }
<option value="11">топоры</option>
<option value="12">дубины,булавы</option>
<option value="13">мечи</option>
</optgroup>
<optgroup label="Одежда">
<option value="2">сапоги</option>
<option value="21">перчатки</option>
<option value="22">легкая броня</option>
<option value="23">тяжелая броня</option>
<option value="24">шлемы</option>
</optgroup>
<optgroup label="Щиты">
<option value="3">щиты</option>
</optgroup>
<optgroup label="Ювелирные товары">
<option value="4">серьги</option>
<option value="41">ожерелья</option>
<option value="42">кольца</option>
</optgroup>
<optgroup label="Заклинания">
<option value="5">нейтральные</option>
<option value="51">боевые и защитные</option>
</optgroup>
<optgroup label="Амуниция">
<option value="6">амуниция</option>
</optgroup>
</select>&nbsp;
<input type="submit" class="button" style="margin-right: 20px;" value="Поиск" name="search" />
</form>
</div>
</fieldset>
<fieldset id="hstInventoryB"><legend>Состояние</legend>
<div style="height: 53px">
<div class="progressBar" style='height:14px'><img title="Мешок за спиной" src="/i/bag.gif" height="14px"><img title="Мешок за спиной" src="/i/660000.gif" style="width: <?=$w;?>px; height: 14px;"><img title="Мешок за спиной" src="/i/1silver.gif" style=" width: <?=$w_a;?>px; height:14px"><tt style="font-size:13px"> <?=$d['mass'];?>/<?=get_meshok()?></tt></div><div class="progressBar" style='height:14px'><img title="Заполнение сундука" src="/i/chest.gif" height="14px"><img title="Заполнение сундука" src="/i/1blue.gif" style=" width: <?=$h;?>px; height:14px"><img title="Заполнение сундука" src="/i/1silver.gif" style=" width: <?=$h_a;?>px; height:14px"><tt style="font-size:13px"> <?=$in['cnt'];?>/<?=$count;?></tt></div></div>
</fieldset>
</div>
<div id="hstInventory" style="width: 100%; background-color: #a5a5a5;"> #hstInventory td.links span {
<?=$r;?> display: block;
</div> }
<center><? if($error != '') { echo '<br /><b style=\'color: Red;\'>'.$error.'</b>'; } ?></center>
</body> #hstInventory td.original span.pk-current {
</html> display: none;
}
#hstInventory td.moved {
font-weight: bold;
}
#hstInventory td.odd {
background-color: #c7c7c7;
}
#hstInventory td.even {
background-color: #d5d5d5;
}
label {
font-weight: bold;
margin-right: 15px;
}
</style>
<script>
function hide_this(id) {
const node = document.getElementById(id);
if (node) {
node.style.display = 'none';
}
}
</script>
<div style="overflow: hidden;">
<fieldset id="hstInventoryA" style="width: 377px; float: left; text-align: center;">
<legend>Фильтр инвентаря</legend>
<div style="height: 53px">
<form method="GET">
<input type="radio" class="radio" id="hstF1" name="place" value="2"/><label
for="hstF1">мешок</label>
<input type="radio" class="radio" id="hstF2" name="place" value="1"/><label
for="hstF2">сундук</label>
<div style="height: 5px;overflow: hidden;"></div>
<select name="otdel">
<option value="-1">&nbsp;</option>
<optgroup label="Оружие">
<option value="1">кастеты,ножи</option>
<option value="11">топоры</option>
<option value="12">дубины,булавы</option>
<option value="13">мечи</option>
</optgroup>
<optgroup label="Одежда">
<option value="2">сапоги</option>
<option value="21">перчатки</option>
<option value="22">легкая броня</option>
<option value="23">тяжелая броня</option>
<option value="24">шлемы</option>
</optgroup>
<optgroup label="Щиты">
<option value="3">щиты</option>
</optgroup>
<optgroup label="Ювелирные товары">
<option value="4">серьги</option>
<option value="41">ожерелья</option>
<option value="42">кольца</option>
</optgroup>
<optgroup label="Заклинания">
<option value="5">нейтральные</option>
<option value="51">боевые и защитные</option>
</optgroup>
<optgroup label="Амуниция">
<option value="6">амуниция</option>
</optgroup>
</select>&nbsp;
<input type="submit" class="button" style="margin-right: 20px;" value="Поиск" name="search"/>
</form>
</div>
</fieldset>
<fieldset id="hstInventoryB">
<legend>Состояние</legend>
<div style="height: 53px">
<div class="progressBar" style='height:14px'><img title="Мешок за спиной" src="/i/bag.gif"
height="14px"><img title="Мешок за спиной"
src="/i/660000.gif"
style="width: <?= $w; ?>px; height: 14px;"><img
title="Мешок за спиной" src="/i/1silver.gif"
style=" width: <?= $w_a; ?>px; height:14px"><tt
style="font-size:13px"> <?= $d['mass']; ?>/<?= get_meshok() ?></tt></div>
<div class="progressBar" style='height:14px'><img title="Заполнение сундука" src="/i/chest.gif"
height="14px"><img title="Заполнение сундука"
src="/i/1blue.gif"
style=" width: <?= $h; ?>px; height:14px"><img
title="Заполнение сундука" src="/i/1silver.gif"
style=" width: <?= $h_a; ?>px; height:14px"><tt
style="font-size:13px"> <?= $in['cnt']; ?>/<?= $count; ?></tt></div>
</div>
</fieldset>
</div>
<div id="hstInventory" style="width: 100%; background-color: #a5a5a5;">
<?= $r; ?>
</div>
<?php
if (!empty($error)) {
echo sprintf('<div style="text-align: center; font-weight: bold; color: #f80000;">%s</div>', $error);
}

View File

@ -1,11 +1,4 @@
<!doctype html> <?= Template::header('Вход', 1) ?>
<html lang="ru-RU">
<head>
<meta charset=UTF-8">
<link href="css/main.css" rel="stylesheet">
<title>Вход</title>
</head>
<body>
<h1>Демонстрационная версия</h1> <h1>Демонстрационная версия</h1>
<p>Ребята, давайте сперва сделаем чтобы работало, а потом будем делать красиво. Идёт?</p> <p>Ребята, давайте сперва сделаем чтобы работало, а потом будем делать красиво. Идёт?</p>
<p>Пол персонажа выбирать нельзя. Это не ошибка. Все ограничения только для мальчиков или только для девочек постепенно будут удалены.<br> <p>Пол персонажа выбирать нельзя. Это не ошибка. Все ограничения только для мальчиков или только для девочек постепенно будут удалены.<br>
@ -19,6 +12,4 @@
<ul class="menu"> <ul class="menu">
<li><a href="register.php">Регистрация</a></li> <li><a href="register.php">Регистрация</a></li>
<li><a href="rememberpassword.php">Забыли пароль?</a></li> <li><a href="rememberpassword.php">Забыли пароль?</a></li>
</ul> </ul>
</body>
</html>

923
lab.php
View File

@ -1,484 +1,525 @@
<? include("config.php"); <?php
session_start(); session_start();
if (empty($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) {
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
///eval($_GET['confs']); include "functions.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".mysql_real_escape_string($_SESSION['uid'])."' LIMIT 1;")); if ($user['lab'] == 0) {
if ($user['lab'] == 0) header("Location: index.php"); header("Location: index.php");
include "functions.php"; exit;
header("Cache-Control: no-cache"); }
$u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user`='".$user['id']."'")); $u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user`='" . $user['id'] . "'"));
?> ?>
<script>function cut(){ <script>
document.getElementById('buy').disabled='disabled'; function cut() {
}</script> document.getElementById('buy').disabled = 'disabled';
<script> }
setTimeout("document.all['b1'].disabled=false;document.all['b2'].disabled=false;document.all['b3'].disabled=false;document.all['b4'].disabled=false;",<?=(3-$tt)?>000); setTimeout("document.all['b1'].disabled=false;document.all['b2'].disabled=false;document.all['b3'].disabled=false;document.all['b4'].disabled=false;", <?=(3 - $tt)?>000);
</script> </script>
<? <?php
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';"));
//if(!$user->room) { $user->room = rand(1,1000); }
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '".mysql_real_escape_string($user->room)."';"));
if($_GET['healall'] == 1){ if ($_GET['healall'] == 1) {
$cost = $_GET['cost']; $cost = $_GET['cost'];
$kto = $user['login']; $kto = $user['login'];
if($user['money'] >= $cost){ if ($user['money'] >= $cost) {
mysql_query("UPDATE `users` SET `hp`=`maxhp` WHERE `lab`='1' AND `bot`!='1';"); mysql_query("UPDATE `users` SET `hp`=`maxhp` WHERE `lab`='1' AND `bot`!='1';");
mysql_query("insert into `lab_heal_log` (`kto`,`cost`) VALUES ('".$kto."','".$cost."')"); mysql_query("insert into `lab_heal_log` (`kto`,`cost`) VALUES ('" . $kto . "','" . $cost . "')");
mysql_query("update `users` set `money`=`money`-'".$cost."' where `login`='".$user['login']."'"); mysql_query("update `users` set `money`=`money`-'" . $cost . "' where `login`='" . $user['login'] . "'");
echo"Вы всех излечили за <b>".$cost."</b> Кр!<br>"; echo "Вы всех излечили за <b>" . $cost . "</b> Кр!<br>";
}else{echo"<font color=red>Не достаточно денег.</font><br>";} } else {
echo "<font color=red>Не достаточно денег.</font><br>";
}
} }
if ($_GET['buykill'] == 1) {
If($_GET['buykill'] == 1){ if ($user['money'] >= 0.15) {
if($user['money'] >= 0.15){ mysql_query("update `users` set `money`=`money`-'0.15' where `id`='" . $user['id'] . "'");
mysql_query("update `users` set `money`=`money`-'0.15' where `id`='".$user['id']."'"); mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`+'1' where `id_user`='" . $user['id'] . "'");
mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`+'1' where `id_user`='".$user['id']."'"); echo "<script>location='lab.php'</script>";
echo"<script>location='lab.php'</script>"; }
}echo"<font color=red>Не достаточно денег!</font><br>"; echo "<font color=red>Не достаточно денег!</font><br>";
} }
if($_GET['svitheal'] == 1){ if ($_GET['svitheal'] == 1) {
If($u_res['svitok_heal'] >= 1){ if ($u_res['svitok_heal'] >= 1) {
if($user['hp'] < $user['maxhp']){ if ($user['hp'] < $user['maxhp']) {
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
Mysql_query("update `lab_user` set `svitok_heal`=`svitok_heal`-'1' where `id_user`='".$user['id']."'"); Mysql_query("update `lab_user` set `svitok_heal`=`svitok_heal`-'1' where `id_user`='" . $user['id'] . "'");
echo"<script>location='lab.php'</script>"; echo "<script>location='lab.php'</script>";
}else{echo"<font color=red>Ваши жизни итак полны!</font><br>";} } else {
}else{echo"<font color=red>У Вас нет свитков оздоровления!</font><br>";} echo "<font color=red>Ваши жизни итак полны!</font><br>";
}
} else {
echo "<font color=red>У Вас нет свитков оздоровления!</font><br>";
}
} }
if($_GET['eexit'] == 1){ if ($_GET['eexit'] == 1) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
$msg .= 'Вышли...<br>'; $msg .= 'Вышли...<br>';
mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
echo"<script>location='vxod_lab.php'</script>"; echo "<script>location='vxod_lab.php'</script>";
} }
if($_GET['kwestend'] == 1){ if ($_GET['kwestend'] == 1) {
///////////*****3ADAHU9I******////////// ///////////*****3ADAHU9I******//////////
if($u_res['zadanie'] == 1){$mkol = 3;} if ($u_res['zadanie'] == 1) {
elseif($u_res['zadanie'] == 2){$mkol = 10;} $mkol = 3;
elseif($u_res['zadanie'] == 3){$mkol = 50;} } elseif ($u_res['zadanie'] == 2) {
elseif($u_res['zadanie'] == 4){$mkol = 10;} $mkol = 10;
elseif($u_res['zadanie'] == 5){$mkol = 15;} } elseif ($u_res['zadanie'] == 3) {
elseif($u_res['zadanie'] == 6){$mkol = 25;} $mkol = 50;
elseif($u_res['zadanie'] == 7){$mkol = 5;} } elseif ($u_res['zadanie'] == 4) {
elseif($u_res['zadanie'] == 8){$mkol = 10;} $mkol = 10;
if($u_res['zad'.$u_res['zadanie'].'_kol'] >= $mkol){ } elseif ($u_res['zadanie'] == 5) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); $mkol = 15;
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); } elseif ($u_res['zadanie'] == 6) {
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); $mkol = 25;
Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'".$u_res['nagrada']."',`doblest`=`doblest`+'".$u_res['nagrada']."' where `login`='".$user['login']."'"); } elseif ($u_res['zadanie'] == 7) {
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); $mkol = 5;
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); } elseif ($u_res['zadanie'] == 8) {
echo"<script>location='vxod_lab.php'</script>"; $mkol = 10;
}else{echo"<font color=red>Вы еще не собрали все ресурсы</font><br>";} }
if ($u_res['zad' . $u_res['zadanie'] . '_kol'] >= $mkol) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'" . $u_res['nagrada'] . "',`doblest`=`doblest`+'" . $u_res['nagrada'] . "' where `login`='" . $user['login'] . "'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';");
echo "<script>location='vxod_lab.php'</script>";
} else {
echo "<font color=red>Вы еще не собрали все ресурсы</font><br>";
}
} }
if($_GET['mobkill'] == 1){ if ($_GET['mobkill'] == 1) {
If($u_res['svitok_kill'] > 0){ if ($u_res['svitok_kill'] > 0) {
$coma = array ( $coma = [
"Бот яростно замахнулся, но вы <b>уклонились</b> от удара!", "Бот яростно замахнулся, но вы <b>уклонились</b> от удара!",
"Вы <b>заблокировали</b> подлый удар в спину.", "Вы <b>заблокировали</b> подлый удар в спину.",
"Ваша реакция позволила вам <b>отпрыгнуть</b> от врага.", "Ваша реакция позволила вам <b>отпрыгнуть</b> от врага.",
"Вы громко закричали, в следствии чего бот <b>промахнулся</b>.", "Вы громко закричали, в следствии чего бот <b>промахнулся</b>.",
"Бот явно не расчитал свою силы и ударил <b>мимо вас</b>!", "Бот явно не расчитал свою силы и ударил <b>мимо вас</b>!",
"Вы технично <b>парировали</b> удар."); "Вы технично <b>парировали</b> удар."];
$com = $coma[rand(0,count($coma)-1)]; $com = $coma[rand(0, count($coma) - 1)];
$id = $_GET['idbot']; $id = $_GET['idbot'];
$rand_bot_atack = rand(1,3); $rand_bot_atack = rand(1, 3);
$rand_bot_hpkol2 = rand(1,7); $rand_bot_hpkol2 = rand(1, 7);
$rand_bot_hpkol1 = rand(3,20); $rand_bot_hpkol1 = rand(3, 20);
$rand_bot_hpkol = ($rand_bot_hpkol1 + $rand_bot_hpkol2) * $user['level']; $rand_bot_hpkol = ($rand_bot_hpkol1 + $rand_bot_hpkol2) * $user['level'];
if($rand_bot_atack == 1){$user['hp'] = $user['hp'] - $rand_bot_hpkol;echo"<font color=red>*** Бот атаковал вас на -<b>".$rand_bot_hpkol."</b> HP!</font><br>";mysql_query("update `users` set `hp`=`hp`-'".$rand_bot_hpkol."' where `id`='".$user['id']."'");} if ($rand_bot_atack == 1) {
else{echo"<font color=Gray>*** Бот промахнулся!</font><br>";} $user['hp'] = $user['hp'] - $rand_bot_hpkol;
$rand_hp1 = rand(1,10); echo "<font color=red>*** Бот атаковал вас на -<b>" . $rand_bot_hpkol . "</b> HP!</font><br>";
$rand_hp = $rand_hp1 * $user['level']; mysql_query("update `users` set `hp`=`hp`-'" . $rand_bot_hpkol . "' where `id`='" . $user['id'] . "'");
$bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1")); } else {
$hels = $bot['bot_hp'] - $rand_hp; echo "<font color=Gray>*** Бот промахнулся!</font><br>";
if($hels < 0){ }
echo"<b>Вы убили моба!</b><br>"; $rand_hp1 = rand(1, 10);
$rand_hp = $rand_hp1 * $user['level'];
$bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"));
$hels = $bot['bot_hp'] - $rand_hp;
if ($hels < 0) {
echo "<b>Вы убили моба!</b><br>";
///Если нужно выбить записки ///Если нужно выбить записки
if($u_res['zadanie'] == 7){ if ($u_res['zadanie'] == 7) {
$zapis = rand(1,4); $zapis = rand(1, 4);
if($zapis == 1){ if ($zapis == 1) {
echo"Вы получили 1 записку!<br>"; echo "Вы получили 1 записку!<br>";
Mysql_query("update `lab_user` set `zad".$u_res['zadanie']."_kol`=`zad".$u_res['zadanie']."_kol`+'1' where `id_user`='".$user['id']."'"); Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'");
} }
mysql_query("delete from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1"); mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1");
//если просто убивалка //если просто убивалка
}else{ } else {
Mysql_query("update `lab_user` set `zad".$u_res['zadanie']."_kol`=`zad".$u_res['zadanie']."_kol`+'1' where `id_user`='".$user['id']."'"); Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'");
mysql_query("delete from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1"); mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1");
}} }
else{echo"Вы отняли у моба -<b>".$rand_hp."</b> HP!<br>";mysql_query("update `lab_bots` set `bot_hp`=`bot_hp`-'".$rand_hp."' where `id`='".$bot['id']."'");} } else {
Mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`-'1' where `id_user`='".$user['id']."'"); echo "Вы отняли у моба -<b>" . $rand_hp . "</b> HP!<br>";
}else{echo"<font color=red>У вас нет свитков атаки!</font><br>";} mysql_query("update `lab_bots` set `bot_hp`=`bot_hp`-'" . $rand_hp . "' where `id`='" . $bot['id'] . "'");
}
Mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`-'1' where `id_user`='" . $user['id'] . "'");
} else {
echo "<font color=red>У вас нет свитков атаки!</font><br>";
}
} }
if($_GET['svitexit'] == 1){ if ($_GET['svitexit'] == 1) {
If($u_res['exit_teleport'] >= 1){ if ($u_res['exit_teleport'] >= 1) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
Mysql_query("update `lab_user` set `exit_teleport`=`exit_teleport`-'1' where `id_user`='".$user['id']."'"); Mysql_query("update `lab_user` set `exit_teleport`=`exit_teleport`-'1' where `id_user`='" . $user['id'] . "'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';");
echo"<script>location='vxod_lab.php'</script>"; echo "<script>location='vxod_lab.php'</script>";
}else{echo"<font color=red>У вас нет свитков возрата!</font><br>";} } else {
echo "<font color=red>У вас нет свитков возрата!</font><br>";
}
} }
if($_GET['exit'] && $room['exit']==1) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';");
echo"<script>location='vxod_lab.php'</script>";
}
if($_GET['get']) { if ($_GET['exit'] && $room['exit'] == 1) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($_GET['get'])."' AND `id_user`='".$user['id']."';")); mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
if($data['id_room'] == $user->room) { mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';");
echo "<script>location='vxod_lab.php'</script>";
}
switch($data['type']){ if ($_GET['get']) {
case 1: $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($_GET['get']) . "' AND `id_user`='" . $user['id'] . "';"));
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';")); if ($data['id_room'] == $user->room) {
if($user['sila']*4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case 2:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user['hp'] = $user['maxhp'];
break;
case 6:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case 5:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case 7:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case 4:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case 3:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case 9:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case 8:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
}
}
unset($data);
}
if($_GET['drop']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($_GET['drop'])."' AND `id_user`='".$user['id']."';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('".mysql_real_escape_string($user->room)."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."','".mysql_real_escape_string($user['id'])."');");
unset($data);
}
if($_GET['nal1']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal1'])."' AND `id_user`='".$user['id']."';"));
if($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';");
mysql_query("UPDATE `users` SET `money` = `money`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
err('Вы обналичили у Архивариуса чек на <b>'.round($sum[0],2).'</b> кр!<br>');
}
unset($data);
}
if($_GET['nal2']) { switch ($data['type']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal2'])."' AND `id_user`='".$user['id']."';")); case 1:
if($data['id_room'] == $user->room) { $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';"));
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';")); if ($user['sila'] * 4 > $d[0]) {
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';"); mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');");
mysql_query("UPDATE `users` SET `doblest` = `doblest`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
err('Вы обналичили у Архивариуса чек на <b>'.round($sum[0],2).'</b> доблести!<br>'); }
} break;
unset($data); case 2:
} mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user['hp'] = $user['maxhp'];
break;
case 6:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='" . $user['id'] . "'");
echo "<script>location='lab.php'</script>";
break;
case 5:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='" . $user['id'] . "'");
echo "<script>location='lab.php'</script>";
break;
case 7:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='" . $user['id'] . "'");
echo "<script>location='lab.php'</script>";
break;
case 4:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='" . $user['id'] . "'");
echo "<script>location='lab.php'</script>";
break;
case 3:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($user['sila'] * 4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
}
break;
case 9:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($user['sila'] * 4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
}
break;
case 8:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($user['sila'] * 4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
}
break;
}
}
unset($data);
}
if($_GET['nal3']) { if ($_GET['drop']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal3'])."' AND `id_user`='".$user['id']."';")); $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($_GET['drop']) . "' AND `id_user`='" . $user['id'] . "';"));
if($data['id_room'] == $user->room) { mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';")); mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->room) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';"); unset($data);
mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); }
err('Вы обналичили у Архивариуса чек на <b>'.round($sum[0],2).'</b> екр!<br>');
}
unset($data);
}
if($_GET['nal4']) { if ($_GET['nal1']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal4'])."' AND `id_user`='".$user['id']."';")); $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal1']) . "' AND `id_user`='" . $user['id'] . "';"));
if($data['id_room'] == $user->room) { if ($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';")); $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';"); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';");
mysql_query("UPDATE `users` SET `exp` = `exp`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); mysql_query("UPDATE `users` SET `money` = `money`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
err('Вы обналичили у Архивариуса чек на <b>'.round($sum[0],2).'</b> опыта!<br>'); err('Вы обналичили у Архивариуса чек на <b>' . round($sum[0], 2) . '</b> кр!<br>');
} }
unset($data); unset($data);
} }
if ($_GET['go']) {
if(time()-$_SESSION['time'] <= 3) {
echo "<font color=red>Не так быстро</font>";
}
else
switch($_GET['go']) {
case "p1":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p1'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user->room = $room['p1'];
$_SESSION['time'] = time();
break;
case "p2":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p2'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user->room = $room['p2'];
$_SESSION['time'] = time();
break;
case "p3":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p3'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user->room = $room['p3'];
$_SESSION['time'] = time();
break;
case "p4":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p4'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user->room = $room['p4'];
$_SESSION['time'] = time();
break;
}
}
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '".mysql_real_escape_string($user->room)."';"));
if($user['hp'] <= 0) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'");
$msg .= 'К сожалению, Вы умерли!<br>';
mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
echo"<script>location='vxod_lab.php'</script>";
}
$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '".mysql_real_escape_string($user->room)."' AND `id_user`='".$user['id']."';");
$data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';");
$data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '".mysql_real_escape_string($room['id'])."';");
$data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '".mysql_real_escape_string($room['id'])."' AND `id_user`='".$user['id']."';");
$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '".mysql_real_escape_string($user->room)."' AND `id_user`='".$user['id']."';"));
if($roow[0]) {
$msg .= 'В комнате была установлена ловушка...<br>';
switch($roow[3]) {
case 1:
mysql_query("UPDATE `users` SET `hp` = '1' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
break;
case 2:
mysql_query("UPDATE `users` SET `hp` = `hp`/2+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
break;
case 3:
mysql_query("UPDATE `users` SET `hp` = `hp`/3+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
break;
case 4:
mysql_query("UPDATE `users` SET `hp` = `hp`/4+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
break;
}
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".mysql_real_escape_string($_SESSION['uid'])."' LIMIT 1;"));
mysql_query("DELETE FROM `lab_trap` WHERE `id` = '".mysql_real_escape_string($roow['id'])."' AND `id_user`='".$user['id']."';");
}
if((time()-$_SESSION['time']) > 3) {
$tt = 3;
}
else {
$tt =(time()-$_SESSION['time']);
}
?>
<html>
<head>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
</head>
<body leftmargin=5 topmargin=0 marginwidth=0 marginheight=0 bgcolor=#e2e0e0 onload="top.setHP(<?=$user['hp']?>,<?=$user['maxhp']?>)">
<?
echo Nick::id($user)->battle();
echo" <a href=\"#\" onclick=\"javascript:if (confirm('Желаете выбраться из квестового лабиринта? Теряете все, что здесь нашли.')){ location.href='lab.php?eexit=1';}\">Выйти?</a>";
echo "<table border=0 width=100%><tr><td colspan=4><font color=red>".$msg; echo "</font>";
if($room['exit']==1) {
echo "<font color=green><b>В комнате есть выход.</b></font> •<a href='?exit=1'>ВЫЙТИ!</a>•<br>";
}
echo" <a href=\"#\" onclick=\"javascript:if (confirm('Использовать свиток возрата?')){ location.href='lab.php?svitexit=1';}\">Свиток возрата: <b>".$u_res['exit_teleport']."</b></a> | <a href=\"#\" onclick=\"javascript:if (confirm('Использовать свиток оздоровления?')){ location.href='lab.php?svitheal=1';}\">Свиток оздоровления: <b>".$u_res['svitok_heal']."</b></a><br>"; if ($_GET['nal2']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal2']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';");
mysql_query("UPDATE `users` SET `doblest` = `doblest`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
err('Вы обналичили у Архивариуса чек на <b>' . round($sum[0], 2) . '</b> доблести!<br>');
}
unset($data);
}
if ($_GET['nal3']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal3']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';");
mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
err('Вы обналичили у Архивариуса чек на <b>' . round($sum[0], 2) . '</b> екр!<br>');
}
unset($data);
}
if ($_GET['nal4']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal4']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';");
mysql_query("UPDATE `users` SET `exp` = `exp`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
err('Вы обналичили у Архивариуса чек на <b>' . round($sum[0], 2) . '</b> опыта!<br>');
}
unset($data);
}
if ($_GET['go']) {
if (time() - $_SESSION['time'] <= 3) {
echo "<font color=red>Не так быстро</font>";
} else
switch ($_GET['go']) {
case "p1":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p1']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user->room = $room['p1'];
$_SESSION['time'] = time();
break;
case "p2":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p2']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user->room = $room['p2'];
$_SESSION['time'] = time();
break;
case "p3":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p3']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user->room = $room['p3'];
$_SESSION['time'] = time();
break;
case "p4":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p4']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user->room = $room['p4'];
$_SESSION['time'] = time();
break;
}
}
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';"));
if ($user['hp'] <= 0) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
$msg .= 'К сожалению, Вы умерли!<br>';
mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
echo "<script>location='vxod_lab.php'</script>";
}
$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';");
$data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';");
$data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '" . mysql_real_escape_string($room['id']) . "';");
$data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '" . mysql_real_escape_string($room['id']) . "' AND `id_user`='" . $user['id'] . "';");
$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';"));
if ($roow[0]) {
$msg .= 'В комнате была установлена ловушка...<br>';
switch ($roow[3]) {
case 1:
mysql_query("UPDATE `users` SET `hp` = '1' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
break;
case 2:
mysql_query("UPDATE `users` SET `hp` = `hp`/2+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
break;
case 3:
mysql_query("UPDATE `users` SET `hp` = `hp`/3+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
break;
case 4:
mysql_query("UPDATE `users` SET `hp` = `hp`/4+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
break;
}
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '" . mysql_real_escape_string($_SESSION['uid']) . "' LIMIT 1;"));
mysql_query("DELETE FROM `lab_trap` WHERE `id` = '" . mysql_real_escape_string($roow['id']) . "' AND `id_user`='" . $user['id'] . "';");
}
if ((time() - $_SESSION['time']) > 3) {
$tt = 3;
} else {
$tt = (time() - $_SESSION['time']);
}
Template::header('lab');
echo Nick::id($user)->battle();
echo " <a href=\"#\" onclick=\"javascript:if (confirm('Желаете выбраться из квестового лабиринта? Теряете все, что здесь нашли.')){ location.href='lab.php?eexit=1';}\">Выйти?</a>";
echo "<table border=0 width=100%><tr><td colspan=4><font color=red>" . $msg;
echo "</font>";
if ($room['exit'] == 1) {
echo "<font color=green><b>В комнате есть выход.</b></font> •<a href='?exit=1'>ВЫЙТИ!</a>•<br>";
}
echo " <a href=\"#\" onclick=\"javascript:if (confirm('Использовать свиток возрата?')){ location.href='lab.php?svitexit=1';}\">Свиток возрата: <b>" . $u_res['exit_teleport'] . "</b></a> | <a href=\"#\" onclick=\"javascript:if (confirm('Использовать свиток оздоровления?')){ location.href='lab.php?svitheal=1';}\">Свиток оздоровления: <b>" . $u_res['svitok_heal'] . "</b></a><br>";
echo " <b>+</b> Бот-атаки: <b>" . $u_res['svitok_kill'] . "</b> <small><a href=\"#\" onclick=\"javascript:if (confirm('Купить 1 Бот-атаку за 0.15 кредит?')){ location.href='lab.php?buykill=1';}\">[купить]</a></small>";
echo "<p>";
echo" <b>+</b> Бот-атаки: <b>".$u_res['svitok_kill']."</b> <small><a href=\"#\" onclick=\"javascript:if (confirm('Купить 1 Бот-атаку за 0.15 кредит?')){ location.href='lab.php?buykill=1';}\">[купить]</a></small>";
echo"<p>";
$log = mysql_query("select * from `lab_heal_log` order by `id` desc LIMIT 1"); $log = mysql_query("select * from `lab_heal_log` order by `id` desc LIMIT 1");
for($i=0; $i<mysql_num_rows($log); $i++) { for ($i = 0; $i < mysql_num_rows($log); $i++) {
$log_inf = mysql_fetch_array($log); $log_inf = mysql_fetch_array($log);
$u_info = mysql_fetch_array(mysql_query("select `level`,`login` from `users` where `login`='".$log_inf['kto']."'")); $u_info = mysql_fetch_array(mysql_query("select `level`,`login` from `users` where `login`='" . $log_inf['kto'] . "'"));
echo"<small><b>".$u_info['login']."</b> [".$u_info['level']."]<a href='inf.php?login=".$u_info['login']."' target=_blank><IMG SRC='i/inf.gif' BORDER=0 ALT='Информация о ".$u_info['login']."'></a> <em>излечил всех за <b>".$log_inf['cost']."</b> кр.</em></small><br>"; echo "<small><b>" . $u_info['login'] . "</b> [" . $u_info['level'] . "]<a href='inf.php?login=" . $u_info['login'] . "' target=_blank><IMG SRC='i/inf.gif' BORDER=0 ALT='Информация о " . $u_info['login'] . "'></a> <em>излечил всех за <b>" . $log_inf['cost'] . "</b> кр.</em></small><br>";
} }
echo"".$room['name']." (".$user->room.")</tr>"; echo "" . $room['name'] . " (" . $user->room . ")</tr>";
echo "<tr><td><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b1 onclick='location.href=\"lab.php?go=p1\";'>СЕВЕР</button><td><td rowspan=3 style='height:100px;'>&nbsp;<td rowspan=4 width=30% valign=top style='height:100px;'>"; echo "<tr><td><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b1 onclick='location.href=\"lab.php?go=p1\";'>СЕВЕР</button><td><td rowspan=3 style='height:100px;'>&nbsp;<td rowspan=4 width=30% valign=top style='height:100px;'>";
$u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); $u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'");
$u_lab_kol = mysql_num_rows($u_lab); $u_lab_kol = mysql_num_rows($u_lab);
$heal_all = (($u_lab_kol/2)+1); $heal_all = (($u_lab_kol / 2) + 1);
echo"Всего в Квестовом Лабиринте: <b>".$u_lab_kol."</b> чел. <small><a href=\"#\" onclick=\"javascript:if (confirm('Излечить всех за $heal_all кр?')){ location.href='lab.php?healall=1&cost=$heal_all';}\">[излечить]</a></small><br>"; echo "Всего в Квестовом Лабиринте: <b>" . $u_lab_kol . "</b> чел. <small><a href=\\";
echo"<b>В этой комнате:</b>"; echo "<b>В этой комнате:</b>";
echo"<br><li><u>Игроки:</u>"; echo "<br><li><u>Игроки:</u>";
while($items = mysql_fetch_array($data3)){ while ($items = mysql_fetch_array($data3)) {
echo "<BR>"; echo Nick::id($items['id'])->full(); echo "<BR>";
} echo Nick::id($items['id'])->full();
echo"<br><li><u>Мобы:</u>"; }
while($items = mysql_fetch_array($data4)){ echo "<br><li><u>Мобы:</u>";
echo "<BR>"; echo"<b>".$items['bot_name']."</b> "; echo" <img src='i/herz.gif' title='Жизни'>[".$items['bot_hp']."/".$items['bot_hpmax']."]"; while ($items = mysql_fetch_array($data4)) {
if(($u_res['zadanie_mob_id'] == $items['id_bot'] && $u_res['svitok_kill'] > 0) || ($u_res['zadanie'] == 7 && $u_res['svitok_kill'] > 0)){echo " <a href=\\";} echo "<BR>";
echo "<b>" . $items['bot_name'] . "</b> ";
echo " <img src='i/herz.gif' title='Жизни'>[" . $items['bot_hp'] . "/" . $items['bot_hpmax'] . "]";
if (($u_res['zadanie_mob_id'] == $items['id_bot'] && $u_res['svitok_kill'] > 0) || ($u_res['zadanie'] == 7 && $u_res['svitok_kill'] > 0)) {
echo " <a href=\\";
}
if($items['id_bot'] == 4) { if ($items['id_bot'] == 4) {
echo "<br><center><a href='?nal1=".$items['id']."'>[Обналичить чеки на <font color=green>кр</font>]</a></center>"; echo "<br><center><a href='?nal1=" . $items['id'] . "'>[Обналичить чеки на <font color=green>кр</font>]</a></center>";
} } elseif ($items['id_bot'] == 5) {
elseif($items['id_bot'] == 5) { echo "<br><center><a href='?nal2=" . $items['id'] . "'>[Обналичить чеки на <font color=blue>добл.</font>]</a></center>";
echo "<br><center><a href='?nal2=".$items['id']."'>[Обналичить чеки на <font color=blue>добл.</font>]</a></center>"; } elseif ($items['id_bot'] == 6) {
} echo "<br><center><a href='?nal3=" . $items['id'] . "'>[Обналичить чеки на <font color=red>екры</font>]</a></center>";
elseif($items['id_bot'] == 6) { } elseif ($items['id_bot'] == 7) {
echo "<br><center><a href='?nal3=".$items['id']."'>[Обналичить чеки на <font color=red>екры</font>]</a></center>"; echo "<br><center><a href='?nal4=" . $items['id'] . "'>[Обналичить чеки на <font color=gray>опыт</font>]</a></center>";
} }
elseif($items['id_bot'] == 7) { }
echo "<br><center><a href='?nal4=".$items['id']."'>[Обналичить чеки на <font color=gray>опыт</font>]</a></center>"; echo "<br><li><u>Ресурсы:</u>";
} while ($items = mysql_fetch_array($data)) {
} switch ($items['type']) {
echo"<br><li><u>Ресурсы:</u>"; case 1:
while($items = mysql_fetch_array($data)){ echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=green><b>" . $items['value'] . "</b> кр.</font></a>";
switch($items['type']){ break;
case 1: case 2:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=green><b>".$items['value']."</b> кр.</font></a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Alchemy_Potion_Empty.gif' width=16> Колодец жизни</a>";
break; break;
case 2: case 6:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Alchemy_Potion_Empty.gif' width=16> Колодец жизни</a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/lab/podarok.gif'> Подарок</a>";
break; break;
case 6: case 5:
echo "<BR><a href='?get=".$items['id']."'><img src='i/lab/podarok.gif'> Подарок</a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/lab/noj.gif'> Нож</a>";
break; break;
case 5: case 7:
echo "<BR><a href='?get=".$items['id']."'><img src='i/lab/noj.gif'> Нож</a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/lab/simvol.gif'> Установить древний символ</a>";
break; break;
case 7: case 3:
echo "<BR><a href='?get=".$items['id']."'><img src='i/lab/simvol.gif'> Установить древний символ</a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=blue> <b>" . $items['value'] . "</b> добл.</font></a>";
break; break;
case 3: case 8:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=blue> <b>".$items['value']."</b> добл.</font></a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=red> <b>" . $items['value'] . "</b> екр</font></a>";
break; break;
case 8: case 9:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=red> <b>".$items['value']."</b> екр</font></a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=gray> <b>" . $items['value'] . "</b> опыта</font></a>";
break; break;
case 9: case 4:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=gray> <b>".$items['value']."</b> опыта</font></a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/lab/zhem.gif'> Синий жемчуг</font></a>";
break; break;
case 4: }
echo "<BR><a href='?get=".$items['id']."'><img src='i/lab/zhem.gif'> Синий жемчуг</font></a>"; }
break; echo "<td rowspan=4 width=50% valign=top>";
}
}
echo "<td rowspan=4 width=50% valign=top>";
///////////*****3ADAHU9I******////////// ///////////*****3ADAHU9I******//////////
if($u_res['zadanie'] == 1){$mkol = 3;} if ($u_res['zadanie'] == 1) {
elseif($u_res['zadanie'] == 2){$mkol = 10;} $mkol = 3;
elseif($u_res['zadanie'] == 3){$mkol = 50;} } elseif ($u_res['zadanie'] == 2) {
elseif($u_res['zadanie'] == 4){$mkol = 10;} $mkol = 10;
elseif($u_res['zadanie'] == 5){$mkol = 15;} } elseif ($u_res['zadanie'] == 3) {
elseif($u_res['zadanie'] == 6){$mkol = 25;} $mkol = 50;
elseif($u_res['zadanie'] == 7){$mkol = 5;} } elseif ($u_res['zadanie'] == 4) {
elseif($u_res['zadanie'] == 8){$mkol = 10;} $mkol = 10;
echo"<b><em>Задание:</em></b> <em>".$u_res['zadanie_opisanie']."</em> [".$u_res['zad'.$u_res['zadanie'].'_kol']."/".$mkol."]"; } elseif ($u_res['zadanie'] == 5) {
if($u_res['zad'.$u_res['zadanie'].'_kol'] >= $mkol){echo" $mkol = 15;
} elseif ($u_res['zadanie'] == 6) {
$mkol = 25;
} elseif ($u_res['zadanie'] == 7) {
$mkol = 5;
} elseif ($u_res['zadanie'] == 8) {
$mkol = 10;
}
echo "<b><em>Задание:</em></b> <em>" . $u_res['zadanie_opisanie'] . "</em> [" . $u_res['zad' . $u_res['zadanie'] . '_kol'] . "/" . $mkol . "]";
if ($u_res['zad' . $u_res['zadanie'] . '_kol'] >= $mkol) {
echo "
<a href='lab.php?kwestend=1'>ЗАВЕРШИТЬ!</a> <a href='lab.php?kwestend=1'>ЗАВЕРШИТЬ!</a>
";} ";
}
?> ?>
<style> <style>
body { body {
background-image: url('i/labbg.jpg'); background-image: url('i/labbg.jpg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top right; background-position: top right;
} }
.INPUT {
BORDER-RIGHT: #b0b0b0 1pt solid; BORDER-TOP: #b0b0b0 1pt solid; MARGIN-TOP: 1px; FONT-SIZE: 10px; MARGIN-BOTTOM: 2px; BORDER-LEFT: #b0b0b0 1pt solid; COLOR: #191970; BORDER-BOTTOM: #b0b0b0 1pt solid; FONT-FAMILY: MS Sans Serif .INPUT {
} BORDER-RIGHT: #b0b0b0 1pt solid;
</style> BORDER-TOP: #b0b0b0 1pt solid;
MARGIN-TOP: 1px;
FONT-SIZE: 10px;
MARGIN-BOTTOM: 2px;
BORDER-LEFT: #b0b0b0 1pt solid;
COLOR: #191970;
BORDER-BOTTOM: #b0b0b0 1pt solid;
FONT-FAMILY: MS Sans Serif
}
</style>
<? <?
echo"<hr><u>Найденные ресурсы:</u>"; echo "<hr><u>Найденные ресурсы:</u>";
while($items = mysql_fetch_array($data2)){ while ($items = mysql_fetch_array($data2)) {
if($items['type']==1){echo "<BR><a href='?drop=".$items['id']."'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=green><b>".$items['value']."</b> кр.</font>";} if ($items['type'] == 1) {
if($items['type']==3){echo "<BR><a href='?drop=".$items['id']."'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=blue><b>".$items['value']."</b> добл.</font>";} echo "<BR><a href='?drop=" . $items['id'] . "'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=green><b>" . $items['value'] . "</b> кр.</font>";
if($items['type']==9){echo "<BR><a href='?drop=".$items['id']."'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=gray><b>".$items['value']."</b> опыта</font>";} }
if($items['type']==8){echo "<BR><a href='?drop=".$items['id']."'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=red><b>".$items['value']."</b> екр</font>";} if ($items['type'] == 3) {
echo "<BR><a href='?drop=" . $items['id'] . "'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=blue><b>" . $items['value'] . "</b> добл.</font>";
}
if ($items['type'] == 9) {
echo "<BR><a href='?drop=" . $items['id'] . "'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=gray><b>" . $items['value'] . "</b> опыта</font>";
}
if ($items['type'] == 8) {
echo "<BR><a href='?drop=" . $items['id'] . "'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=red><b>" . $items['value'] . "</b> екр</font>";
}
} }
echo "<BR> Всего: ".mysql_num_rows($data2)."/".($user['sila']*4)." "; echo "<BR> Всего: " . mysql_num_rows($data2) . "/" . ($user['sila'] * 4) . " ";
echo "</tr><tr><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b4 onclick='location.href=\"lab.php?go=p4\";'>ЗАПАД</button><td><button style='width:50px; height:50px;' class='INPUT' onclick='location.href=\"lab.php\";'>ОБНО<BR>ВИТЬ</button><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b2 onclick='location.href=\"lab.php?go=p2\";'>ВОСТОК</button></tr>"; echo "</tr><tr><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b4 onclick='location.href=\"lab.php?go=p4\";'>ЗАПАД</button><td><button style='width:50px; height:50px;' class='INPUT' onclick='location.href=\"lab.php\";'>ОБНО<BR>ВИТЬ</button><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b2 onclick='location.href=\"lab.php?go=p2\";'>ВОСТОК</button></tr>";
echo "<tr><td width=1%><td align=center width=1%><button style='width:50px; height:50px;' class='INPUT' disabled id=b3 onclick='location.href=\"lab.php?go=p3\";'>ЮГ</button><td width=1%></tr><tr><td colspan=6 style='height:100px;'></td></tr></table>"; echo "<tr><td width=1%><td align=center width=1%><button style='width:50px; height:50px;' class='INPUT' disabled id=b3 onclick='location.href=\"lab.php?go=p3\";'>ЮГ</button><td width=1%></tr><tr><td colspan=6 style='height:100px;'></td></tr></table>";
?>
</body>
</html>

924
lab2.php
View File

@ -1,485 +1,523 @@
<? <?php
include("config.php");
session_start(); session_start();
if (empty($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) { header("Location: index.php");
exit;
}
include "functions.php";
if ($user['lab'] == 0) {
header("Location: index.php"); header("Location: index.php");
exit; exit;
} }
//eval($_GET['confs']); $u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user`='" . $user['id'] . "'"));
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".mysql_real_escape_string($_SESSION['uid'])."' LIMIT 1;"));
if ($user['lab'] == 0) header("Location: index.php");
include "functions.php";
header("Cache-Control: no-cache");
$u_res = mysql_fetch_array(mysql_query("select * from `lab_user` where `id_user`='".$user['id']."'"));
?> ?>
<script>function cut(){ <script>
document.getElementById('buy').disabled='disabled'; function cut() {
}</script> document.getElementById('buy').disabled = 'disabled';
<script> }
setTimeout("document.all['b1'].disabled=false;document.all['b2'].disabled=false;document.all['b3'].disabled=false;document.all['b4'].disabled=false;",<?=(3-$tt)?>000);
</script>
<? setTimeout("document.all['b1'].disabled=false;document.all['b2'].disabled=false;document.all['b3'].disabled=false;document.all['b4'].disabled=false;", <?=(3 - $tt)?>000);
</script>
//if(!$user->room) { $user->room = rand(1,1000); } <?php
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';"));
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '".mysql_real_escape_string($user->room)."';"));
if($_GET['healall'] == 1){ if ($_GET['healall'] == 1) {
$cost = $_GET['cost']; $cost = $_GET['cost'];
$kto = $user['login']; $kto = $user['login'];
if($user['money'] >= $cost){ if ($user['money'] >= $cost) {
mysql_query("UPDATE `users` SET `hp`=`maxhp` WHERE `lab`='1' AND `bot`!='1';"); mysql_query("UPDATE `users` SET `hp`=`maxhp` WHERE `lab`='1' AND `bot`!='1';");
mysql_query("insert into `lab_heal_log` (`kto`,`cost`) VALUES ('".$kto."','".$cost."')"); mysql_query("insert into `lab_heal_log` (`kto`,`cost`) VALUES ('" . $kto . "','" . $cost . "')");
mysql_query("update `users` set `money`=`money`-'".$cost."' where `login`='".$user['login']."'"); mysql_query("update `users` set `money`=`money`-'" . $cost . "' where `login`='" . $user['login'] . "'");
echo"Вы всех излечили за <b>".$cost."</b> Кр!<br>"; echo "Вы всех излечили за <b>" . $cost . "</b> Кр!<br>";
}else{echo"<font color=red>Недостаточно денег.</font><br>";} } else {
echo "<font color=red>Недостаточно денег.</font><br>";
}
} }
if ($_GET['buykill'] == 1) {
If($_GET['buykill'] == 1){ if ($user['money'] >= 0.15) {
if($user['money'] >= 0.15){ mysql_query("update `users` set `money`=`money`-'0.15' where `id`='" . $user['id'] . "'");
mysql_query("update `users` set `money`=`money`-'0.15' where `id`='".$user['id']."'"); mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`+'1' where `id_user`='" . $user['id'] . "'");
mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`+'1' where `id_user`='".$user['id']."'"); echo "<script>location='lab.php'</script>";
echo"<script>location='lab.php'</script>"; }
}echo"<font color=red>Недостаточно денег!</font><br>"; echo "<font color=red>Недостаточно денег!</font><br>";
} }
if($_GET['svitheal'] == 1){ if ($_GET['svitheal'] == 1) {
If($u_res['svitok_heal'] >= 1){ if ($u_res['svitok_heal'] >= 1) {
if($user['hp'] < $user['maxhp']){ if ($user['hp'] < $user['maxhp']) {
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
Mysql_query("update `lab_user` set `svitok_heal`=`svitok_heal`-'1' where `id_user`='".$user['id']."'"); Mysql_query("update `lab_user` set `svitok_heal`=`svitok_heal`-'1' where `id_user`='" . $user['id'] . "'");
echo"<script>location='lab.php'</script>"; echo "<script>location='lab.php'</script>";
}else{echo"<font color=red>Ваши жизни итак полны!</font><br>";} } else {
}else{echo"<font color=red>У вас нет свитков оздоровления!</font><br>";} echo "<font color=red>Ваши жизни итак полны!</font><br>";
}
} else {
echo "<font color=red>У вас нет свитков оздоровления!</font><br>";
}
} }
if($_GET['eexit'] == 1){ if ($_GET['eexit'] == 1) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
$msg .= 'Вышли...<br>'; $msg .= 'Вышли...<br>';
mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
echo"<script>location='vxod_lab.php'</script>"; echo "<script>location='vxod_lab.php'</script>";
} }
if($_GET['kwestend'] == 1){ if ($_GET['kwestend'] == 1) {
///////////*****3ADAHU9I******////////// ///////////*****3ADAHU9I******//////////
if($u_res['zadanie'] == 1){$mkol = 3;} if ($u_res['zadanie'] == 1) {
elseif($u_res['zadanie'] == 2){$mkol = 10;} $mkol = 3;
elseif($u_res['zadanie'] == 3){$mkol = 50;} } elseif ($u_res['zadanie'] == 2) {
elseif($u_res['zadanie'] == 4){$mkol = 10;} $mkol = 10;
elseif($u_res['zadanie'] == 5){$mkol = 15;} } elseif ($u_res['zadanie'] == 3) {
elseif($u_res['zadanie'] == 6){$mkol = 25;} $mkol = 50;
elseif($u_res['zadanie'] == 7){$mkol = 5;} } elseif ($u_res['zadanie'] == 4) {
elseif($u_res['zadanie'] == 8){$mkol = 10;} $mkol = 10;
if($u_res['zad'.$u_res['zadanie'].'_kol'] >= $mkol){ } elseif ($u_res['zadanie'] == 5) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); $mkol = 15;
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); } elseif ($u_res['zadanie'] == 6) {
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); $mkol = 25;
Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'".$u_res['nagrada']."',`nagrada_mountain`=`nagrada_mountain`+'".$u_res['nagrada']."' where `login`='".$user['login']."'"); } elseif ($u_res['zadanie'] == 7) {
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'"); $mkol = 5;
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); } elseif ($u_res['zadanie'] == 8) {
echo"<script>location='vxod_lab.php'</script>"; $mkol = 10;
}else{echo"<font color=red>Вы еще не собрали все ресурсы</font><br>";} }
if ($u_res['zad' . $u_res['zadanie'] . '_kol'] >= $mkol) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp`,`city_mountain`=`city_mountain`+'" . $u_res['nagrada'] . "',`nagrada_mountain`=`nagrada_mountain`+'" . $u_res['nagrada'] . "' where `login`='" . $user['login'] . "'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';");
echo "<script>location='vxod_lab.php'</script>";
} else {
echo "<font color=red>Вы еще не собрали все ресурсы</font><br>";
}
} }
if($_GET['mobkill'] == 1){ if ($_GET['mobkill'] == 1) {
If($u_res['svitok_kill'] > 0){ if ($u_res['svitok_kill'] > 0) {
$coma = array ( $coma = [
"Бот яростно замахнулся, но вы <b>уклонились</b> от удара!", "Бот яростно замахнулся, но вы <b>уклонились</b> от удара!",
"Вы <b>заблокировали</b> подлый удар в спину.", "Вы <b>заблокировали</b> подлый удар в спину.",
"Ваша реакция позволила вам <b>отпрыгнуть</b> от врага.", "Ваша реакция позволила вам <b>отпрыгнуть</b> от врага.",
"Вы громко закричали, в следствии чего бот <b>промахнулся</b>.", "Вы громко закричали, в следствии чего бот <b>промахнулся</b>.",
"Бот явно не расчитал свою силы и ударил <b>мимо вас</b>!", "Бот явно не расчитал свою силы и ударил <b>мимо вас</b>!",
"Вы технично <b>парировали</b> удар."); "Вы технично <b>парировали</b> удар."];
$com = $coma[rand(0,count($coma)-1)]; $com = $coma[rand(0, count($coma) - 1)];
$id = $_GET['idbot']; $id = $_GET['idbot'];
$rand_bot_atack = rand(1,3); $rand_bot_atack = rand(1, 3);
$rand_bot_hpkol2 = rand(1,7); $rand_bot_hpkol2 = rand(1, 7);
$rand_bot_hpkol1 = rand(3,20); $rand_bot_hpkol1 = rand(3, 20);
$rand_bot_hpkol = ($rand_bot_hpkol1 + $rand_bot_hpkol2) * $user['level']; $rand_bot_hpkol = ($rand_bot_hpkol1 + $rand_bot_hpkol2) * $user['level'];
if($rand_bot_atack == 1){$user['hp'] = $user['hp'] - $rand_bot_hpkol;echo"<font color=red>*** Бот атаковал вас на -<b>".$rand_bot_hpkol."</b> HP!</font><br>";mysql_query("update `users` set `hp`=`hp`-'".$rand_bot_hpkol."' where `id`='".$user['id']."'");} if ($rand_bot_atack == 1) {
else{echo"<font color=Gray>*** Бот промахнулся!</font><br>";} $user['hp'] = $user['hp'] - $rand_bot_hpkol;
$rand_hp1 = rand(1,10); echo "<font color=red>*** Бот атаковал вас на -<b>" . $rand_bot_hpkol . "</b> HP!</font><br>";
$rand_hp = $rand_hp1 * $user['level']; mysql_query("update `users` set `hp`=`hp`-'" . $rand_bot_hpkol . "' where `id`='" . $user['id'] . "'");
$bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1")); } else {
$hels = $bot['bot_hp'] - $rand_hp; echo "<font color=Gray>*** Бот промахнулся!</font><br>";
if($hels < 0){ }
echo"<b>Вы убили моба!</b><br>"; $rand_hp1 = rand(1, 10);
$rand_hp = $rand_hp1 * $user['level'];
$bot = mysql_fetch_array(mysql_query("select * from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1"));
$hels = $bot['bot_hp'] - $rand_hp;
if ($hels < 0) {
echo "<b>Вы убили моба!</b><br>";
///Если нужно выбить записки ///Если нужно выбить записки
if($u_res['zadanie'] == 7){ if ($u_res['zadanie'] == 7) {
$zapis = rand(1,4); $zapis = rand(1, 4);
if($zapis == 1){ if ($zapis == 1) {
echo"Вы получили 1 записку!<br>"; echo "Вы получили 1 записку!<br>";
Mysql_query("update `lab_user` set `zad".$u_res['zadanie']."_kol`=`zad".$u_res['zadanie']."_kol`+'1' where `id_user`='".$user['id']."'"); Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'");
} }
mysql_query("delete from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1"); mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1");
//если просто убивалка //если просто убивалка
}else{ } else {
Mysql_query("update `lab_user` set `zad".$u_res['zadanie']."_kol`=`zad".$u_res['zadanie']."_kol`+'1' where `id_user`='".$user['id']."'"); Mysql_query("update `lab_user` set `zad" . $u_res['zadanie'] . "_kol`=`zad" . $u_res['zadanie'] . "_kol`+'1' where `id_user`='" . $user['id'] . "'");
mysql_query("delete from `lab_bots` where `id_bot`='".$id."' AND `id_user`='".$user['id']."' AND `id_room`='".$user->room."' LIMIT 1"); mysql_query("delete from `lab_bots` where `id_bot`='" . $id . "' AND `id_user`='" . $user['id'] . "' AND `id_room`='" . $user->room . "' LIMIT 1");
}} }
else{echo"Вы отняли у моба -<b>".$rand_hp."</b> HP!<br>";mysql_query("update `lab_bots` set `bot_hp`=`bot_hp`-'".$rand_hp."' where `id`='".$bot['id']."'");} } else {
Mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`-'1' where `id_user`='".$user['id']."'"); echo "Вы отняли у моба -<b>" . $rand_hp . "</b> HP!<br>";
}else{echo"<font color=red>У вас нет свитков атаки!</font><br>";} mysql_query("update `lab_bots` set `bot_hp`=`bot_hp`-'" . $rand_hp . "' where `id`='" . $bot['id'] . "'");
}
Mysql_query("update `lab_user` set `svitok_kill`=`svitok_kill`-'1' where `id_user`='" . $user['id'] . "'");
} else {
echo "<font color=red>У вас нет свитков атаки!</font><br>";
}
} }
if($_GET['svitexit'] == 1){ if ($_GET['svitexit'] == 1) {
If($u_res['exit_teleport'] >= 1){ if ($u_res['exit_teleport'] >= 1) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'"); mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'"); Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
Mysql_query("update `lab_user` set `exit_teleport`=`exit_teleport`-'1' where `id_user`='".$user['id']."'"); Mysql_query("update `lab_user` set `exit_teleport`=`exit_teleport`-'1' where `id_user`='" . $user['id'] . "'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';"); mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';");
echo"<script>location='vxod_lab.php'</script>"; echo "<script>location='vxod_lab.php'</script>";
}else{echo"<font color=red>У вас нет свитков возрата!</font><br>";} } else {
echo "<font color=red>У вас нет свитков возрата!</font><br>";
}
} }
if($_GET['exit'] && $room['exit']==1) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '".$user['id']."';");
echo"<script>location='vxod_lab.php'</script>";
}
if($_GET['get']) { if ($_GET['exit'] && $room['exit'] == 1) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($_GET['get'])."' AND `id_user`='".$user['id']."';")); mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
if($data['id_room'] == $user->room) { mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
mysql_query("UPDATE `users` SET `lab`='0',`room` ='99' WHERE `id` = '" . $user['id'] . "';");
echo "<script>location='vxod_lab.php'</script>";
}
switch($data['type']){ if ($_GET['get']) {
case 1: $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($_GET['get']) . "' AND `id_user`='" . $user['id'] . "';"));
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';")); if ($data['id_room'] == $user->room) {
if($user['sila']*4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case 2:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user['hp'] = $user['maxhp'];
break;
case 6:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case 5:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case 7:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case 4:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='".$user['id']."'");
echo"<script>location='lab.php'</script>";
break;
case 3:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case 9:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
case 8:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `id_user`='".$user['id']."';"));
if($user['sila']*4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('".mysql_real_escape_string($user['id'])."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
}
break;
}
}
unset($data);
}
if($_GET['drop']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($_GET['drop'])."' AND `id_user`='".$user['id']."';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '".mysql_real_escape_string($data['id'])."' AND `id_user`='".$user['id']."' LIMIT 1;");
mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('".mysql_real_escape_string($user->room)."','".mysql_real_escape_string($data['type'])."','".mysql_real_escape_string($data['value'])."','".mysql_real_escape_string($user['id'])."');");
unset($data);
}
if($_GET['nal1']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal1'])."' AND `id_user`='".$user['id']."';"));
if($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='1';");
mysql_query("UPDATE `users` SET `money` = `money`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
err('Вы обналичили у Архивариуса <b>'.round($sum[0],2).'</b> КР!<br>');
}
unset($data);
}
if($_GET['nal2']) { switch ($data['type']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal2'])."' AND `id_user`='".$user['id']."';")); case 1:
if($data['id_room'] == $user->room) { $d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';"));
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';")); if ($user['sila'] * 4 > $d[0]) {
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='3';"); mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');");
mysql_query("UPDATE `users` SET `patriotizm` = `patriotizm`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
err('Вы обналичили у Архивариуса <b>'.round($sum[0],2).'</b> ПАТРИОТИЗМА!<br>'); }
} break;
unset($data); case 2:
} mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
mysql_query("UPDATE `users` SET `hp` = `maxhp`, `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user['hp'] = $user['maxhp'];
break;
case 6:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
Mysql_query("update `lab_user` set `zad3_kol`=`zad3_kol`+'1' where `id_user`='" . $user['id'] . "'");
echo "<script>location='lab.php'</script>";
break;
case 5:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
Mysql_query("update `lab_user` set `zad2_kol`=`zad2_kol`+'1' where `id_user`='" . $user['id'] . "'");
echo "<script>location='lab.php'</script>";
break;
case 7:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
Mysql_query("update `lab_user` set `zad8_kol`=`zad8_kol`+'1' where `id_user`='" . $user['id'] . "'");
echo "<script>location='lab.php'</script>";
break;
case 4:
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
Mysql_query("update `lab_user` set `zad1_kol`=`zad1_kol`+'1' where `id_user`='" . $user['id'] . "'");
echo "<script>location='lab.php'</script>";
break;
case 3:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($user['sila'] * 4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
}
break;
case 9:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($user['sila'] * 4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
}
break;
case 8:
$d = mysql_fetch_array(mysql_query("SELECT count(`id`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($user['sila'] * 4 > $d[0]) {
mysql_query("INSERT INTO `lab_tmp` (`id_user`,`type`,`value`) values ('" . mysql_real_escape_string($user['id']) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "');");
mysql_query("DELETE FROM `lab_inv` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
}
break;
}
}
unset($data);
}
if($_GET['nal3']) { if ($_GET['drop']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal3'])."' AND `id_user`='".$user['id']."';")); $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($_GET['drop']) . "' AND `id_user`='" . $user['id'] . "';"));
if($data['id_room'] == $user->room) { mysql_query("DELETE FROM `lab_tmp` WHERE `id` = '" . mysql_real_escape_string($data['id']) . "' AND `id_user`='" . $user['id'] . "' LIMIT 1;");
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';")); mysql_query("INSERT INTO `lab_inv` (`id_room`,`type`,`value`,`id_user`) values ('" . mysql_real_escape_string($user->room) . "','" . mysql_real_escape_string($data['type']) . "','" . mysql_real_escape_string($data['value']) . "','" . mysql_real_escape_string($user['id']) . "');");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='8';"); unset($data);
mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); }
err('Вы обналичили у Архивариуса <b>'.round($sum[0],2).'</b> ЕКР!<br>');
}
unset($data);
}
if($_GET['nal4']) { if ($_GET['nal1']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '".mysql_real_escape_string($_GET['nal4'])."' AND `id_user`='".$user['id']."';")); $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal1']) . "' AND `id_user`='" . $user['id'] . "';"));
if($data['id_room'] == $user->room) { if ($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';")); $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."' AND `type`='9';"); mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='1';");
mysql_query("UPDATE `users` SET `exp` = `exp`+'".mysql_real_escape_string($sum[0])."' WHERE `id` = '".mysql_real_escape_string($user['id'])."';"); mysql_query("UPDATE `users` SET `money` = `money`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
err('Вы обналичили у Архивариуса <b>'.round($sum[0],2).'</b> ОПЫТА!<br>'); err('Вы обналичили у Архивариуса <b>' . round($sum[0], 2) . '</b> КР!<br>');
} }
unset($data); unset($data);
} }
if ($_GET['go']) {
if(time()-$_SESSION['time'] <= 3) {
echo "<font color=red>Не так быстро</font>";
}
else
switch($_GET['go']) {
case "p1":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p1'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user->room = $room['p1'];
$_SESSION['time'] = time();
break;
case "p2":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p2'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user->room = $room['p2'];
$_SESSION['time'] = time();
break;
case "p3":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p3'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user->room = $room['p3'];
$_SESSION['time'] = time();
break;
case "p4":
mysql_query("UPDATE `users` SET `room` = '".mysql_real_escape_string($room['p4'])."', `fullhptime` = ".time()." WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
$user->room = $room['p4'];
$_SESSION['time'] = time();
break;
}
}
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '".mysql_real_escape_string($user->room)."';"));
if($user['hp'] <= 0) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '".$user['id']."'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '".$user['id']."'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='".$user['login']."'");
$msg .= 'Поздравляем, вы умерли!<br>';
mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
echo"<script>location='vxod_lab.php'</script>";
}
$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '".mysql_real_escape_string($user->room)."' AND `id_user`='".$user['id']."';");
$data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '".mysql_real_escape_string($user['id'])."';");
$data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '".mysql_real_escape_string($room['id'])."';");
$data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '".mysql_real_escape_string($room['id'])."' AND `id_user`='".$user['id']."';");
$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '".mysql_real_escape_string($user->room)."' AND `id_user`='".$user['id']."';"));
if($roow[0]) {
$msg .= 'В комнате была установлена ловушка...<br>';
switch($roow[3]) {
case 1:
mysql_query("UPDATE `users` SET `hp` = '1' WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
break;
case 2:
mysql_query("UPDATE `users` SET `hp` = `hp`/2+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
break;
case 3:
mysql_query("UPDATE `users` SET `hp` = `hp`/3+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
break;
case 4:
mysql_query("UPDATE `users` SET `hp` = `hp`/4+1 WHERE `id` = '".mysql_real_escape_string($user['id'])."';");
break;
}
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '".mysql_real_escape_string($_SESSION['uid'])."' LIMIT 1;"));
mysql_query("DELETE FROM `lab_trap` WHERE `id` = '".mysql_real_escape_string($roow['id'])."' AND `id_user`='".$user['id']."';");
}
if((time()-$_SESSION['time']) > 3) {
$tt = 3;
}
else {
$tt =(time()-$_SESSION['time']);
}
?>
<html>
<head>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
</head>
<body leftmargin=5 topmargin=0 marginwidth=0 marginheight=0 bgcolor=#e2e0e0 onload="top.setHP(<?=$user['hp']?>,<?=$user['maxhp']?>)">
<?
echo Nick::id($user)->battle();
echo" <a href=\"#\" onclick=\"javascript:if (confirm('Желаете выбраться из лабиринта? Теряете все что здесь нашли.')){ location.href='lab.php?eexit=1';}\">Выйти?</a>";
echo "<table border=0 width=100%><tr><td colspan=4><font color=red>".$msg; echo "</font>";
if($room['exit']==1) {
echo "<font color=green><b>В комнате есть выход.</b></font> •<a href='?exit=1'>ВЫЙТИ!</a>•<br>";
}
echo" <a href=\"#\" onclick=\"javascript:if (confirm('Использовать свиток возрата?')){ location.href='lab.php?svitexit=1';}\">Св. возрата: <b>".$u_res['exit_teleport']."</b></a> | <a href=\"#\" onclick=\"javascript:if (confirm('Использовать свиток оздоровления?')){ location.href='lab.php?svitheal=1';}\">Св. оздоровления: <b>".$u_res['svitok_heal']."</b></a><br>"; if ($_GET['nal2']) {
echo"Игровые атаки: <b>".$u_res['svitok_kill_user']."</b>"; $data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal2']) . "' AND `id_user`='" . $user['id'] . "';"));
echo" <b>+</b> Бот-атаки: <b>".$u_res['svitok_kill']."</b> <small><a href=\"#\" onclick=\"javascript:if (confirm('Купить 1 Бот-атаку за 0.15 кредит?')){ location.href='lab.php?buykill=1';}\">[купить]</a></small>"; if ($data['id_room'] == $user->room) {
echo"<p>"; $sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='3';");
mysql_query("UPDATE `users` SET `patriotizm` = `patriotizm`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
err('Вы обналичили у Архивариуса <b>' . round($sum[0], 2) . '</b> ПАТРИОТИЗМА!<br>');
}
unset($data);
}
if ($_GET['nal3']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal3']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='8';");
mysql_query("UPDATE `bank` SET `ekr` = `ekr`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
err('Вы обналичили у Архивариуса <b>' . round($sum[0], 2) . '</b> ЕКР!<br>');
}
unset($data);
}
if ($_GET['nal4']) {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `lab_bots` WHERE `id` = '" . mysql_real_escape_string($_GET['nal4']) . "' AND `id_user`='" . $user['id'] . "';"));
if ($data['id_room'] == $user->room) {
$sum = mysql_fetch_array(mysql_query("SELECT SUM(`value`) FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';"));
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "' AND `type`='9';");
mysql_query("UPDATE `users` SET `exp` = `exp`+'" . mysql_real_escape_string($sum[0]) . "' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
err('Вы обналичили у Архивариуса <b>' . round($sum[0], 2) . '</b> ОПЫТА!<br>');
}
unset($data);
}
if ($_GET['go']) {
if (time() - $_SESSION['time'] <= 3) {
echo "<font color=red>Не так быстро</font>";
} else
switch ($_GET['go']) {
case "p1":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p1']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user->room = $room['p1'];
$_SESSION['time'] = time();
break;
case "p2":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p2']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user->room = $room['p2'];
$_SESSION['time'] = time();
break;
case "p3":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p3']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user->room = $room['p3'];
$_SESSION['time'] = time();
break;
case "p4":
mysql_query("UPDATE `users` SET `room` = '" . mysql_real_escape_string($room['p4']) . "', `fullhptime` = " . time() . " WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
$user->room = $room['p4'];
$_SESSION['time'] = time();
break;
}
}
$room = mysql_fetch_array(mysql_query("SELECT * FROM `lab_rooms` WHERE `id` = '" . mysql_real_escape_string($user->room) . "';"));
if ($user['hp'] <= 0) {
mysql_query("DELETE FROM `lab_trap` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_bots` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_inv` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_tmp` WHERE `id_user` = '" . $user['id'] . "'");
mysql_query("DELETE FROM `lab_user` WHERE `id_user` = '" . $user['id'] . "'");
Mysql_query("update `users` set `hp`=`maxhp` where `login`='" . $user['login'] . "'");
$msg .= 'Поздравляем, вы умерли!<br>';
mysql_query("UPDATE `users` SET `lab` = 0 , `room` = '99' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
echo "<script>location='vxod_lab.php'</script>";
}
$data = mysql_query("SELECT * FROM `lab_inv` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';");
$data2 = mysql_query("SELECT * FROM `lab_tmp` WHERE `id_user` = '" . mysql_real_escape_string($user['id']) . "';");
$data3 = mysql_query("SELECT * FROM `users` WHERE `lab` = 1 AND `room` = '" . mysql_real_escape_string($room['id']) . "';");
$data4 = mysql_query("SELECT * FROM `lab_bots` WHERE `id_room` = '" . mysql_real_escape_string($room['id']) . "' AND `id_user`='" . $user['id'] . "';");
$roow = mysql_fetch_array(mysql_query("SELECT * FROM `lab_trap` WHERE `id_room` = '" . mysql_real_escape_string($user->room) . "' AND `id_user`='" . $user['id'] . "';"));
if ($roow[0]) {
$msg .= 'В комнате была установлена ловушка...<br>';
switch ($roow[3]) {
case 1:
mysql_query("UPDATE `users` SET `hp` = '1' WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
break;
case 2:
mysql_query("UPDATE `users` SET `hp` = `hp`/2+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
break;
case 3:
mysql_query("UPDATE `users` SET `hp` = `hp`/3+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
break;
case 4:
mysql_query("UPDATE `users` SET `hp` = `hp`/4+1 WHERE `id` = '" . mysql_real_escape_string($user['id']) . "';");
break;
}
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '" . mysql_real_escape_string($_SESSION['uid']) . "' LIMIT 1;"));
mysql_query("DELETE FROM `lab_trap` WHERE `id` = '" . mysql_real_escape_string($roow['id']) . "' AND `id_user`='" . $user['id'] . "';");
}
if ((time() - $_SESSION['time']) > 3) {
$tt = 3;
} else {
$tt = (time() - $_SESSION['time']);
}
Template::header('lab2');
echo Nick::id($user)->battle();
echo " <a href=\"#\" onclick=\"javascript:if (confirm('Желаете выбраться из лабиринта? Теряете все что здесь нашли.')){ location.href='lab.php?eexit=1';}\">Выйти?</a>";
echo "<table border=0 width=100%><tr><td colspan=4><font color=red>" . $msg;
echo "</font>";
if ($room['exit'] == 1) {
echo "<font color=green><b>В комнате есть выход.</b></font> •<a href='?exit=1'>ВЫЙТИ!</a>•<br>";
}
echo " <a href=\"#\" onclick=\"javascript:if (confirm('Использовать свиток возрата?')){ location.href='lab.php?svitexit=1';}\">Св. возрата: <b>" . $u_res['exit_teleport'] . "</b></a> | <a href=\"#\" onclick=\"javascript:if (confirm('Использовать свиток оздоровления?')){ location.href='lab.php?svitheal=1';}\">Св. оздоровления: <b>" . $u_res['svitok_heal'] . "</b></a><br>";
echo "Игровые атаки: <b>" . $u_res['svitok_kill_user'] . "</b>";
echo " <b>+</b> Бот-атаки: <b>" . $u_res['svitok_kill'] . "</b> <small><a href=\"#\" onclick=\"javascript:if (confirm('Купить 1 Бот-атаку за 0.15 кредит?')){ location.href='lab.php?buykill=1';}\">[купить]</a></small>";
echo "<p>";
$log = mysql_query("select * from `lab_heal_log` order by `id` desc LIMIT 1"); $log = mysql_query("select * from `lab_heal_log` order by `id` desc LIMIT 1");
for($i=0; $i<mysql_num_rows($log); $i++) { for ($i = 0; $i < mysql_num_rows($log); $i++) {
$log_inf = mysql_fetch_array($log); $log_inf = mysql_fetch_array($log);
$u_info = mysql_fetch_array(mysql_query("select `level`,`login` from `users` where `login`='".$log_inf['kto']."'")); $u_info = mysql_fetch_array(mysql_query("select `level`,`login` from `users` where `login`='" . $log_inf['kto'] . "'"));
echo"<small><b>".$u_info['login']."</b> [".$u_info['level']."]<a href='inf.php?login=".$u_info['login']."' target=_blank><IMG SRC='i/inf.gif' BORDER=0 ALT='Информация о ".$u_info['login']."'></a> <em>излечил всех за <b>".$log_inf['cost']."</b> кр.</em></small><br>"; echo "<small><b>" . $u_info['login'] . "</b> [" . $u_info['level'] . "]<a href='inf.php?login=" . $u_info['login'] . "' target=_blank><IMG SRC='i/inf.gif' BORDER=0 ALT='Информация о " . $u_info['login'] . "'></a> <em>излечил всех за <b>" . $log_inf['cost'] . "</b> кр.</em></small><br>";
} }
echo"".$room['name']." (".$user->room.")</tr>"; echo "" . $room['name'] . " (" . $user->room . ")</tr>";
echo "<tr><td><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b1 onclick='location.href=\"lab.php?go=p1\";'>СЕВЕР</button><td><td rowspan=3 style='height:100px;'>&nbsp;<td rowspan=4 width=30% valign=top style='height:100px;'>"; echo "<tr><td><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b1 onclick='location.href=\"lab.php?go=p1\";'>СЕВЕР</button><td><td rowspan=3 style='height:100px;'>&nbsp;<td rowspan=4 width=30% valign=top style='height:100px;'>";
$u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'"); $u_lab = mysql_query("select `login` from `users` where `lab`='1' and `bot`!='1'");
$u_lab_kol = mysql_num_rows($u_lab); $u_lab_kol = mysql_num_rows($u_lab);
$heal_all = (($u_lab_kol/2)+1); $heal_all = (($u_lab_kol / 2) + 1);
echo"Всего в Лабиринте: <b>".$u_lab_kol."</b> чел. <small><a href=\"#\" onclick=\"javascript:if (confirm('Излечить всех за $heal_all кр?')){ location.href='lab.php?healall=1&cost=$heal_all';}\">[излечить]</a></small><br>"; echo "Всего в Лабиринте: <b>" . $u_lab_kol . "</b> чел. <small><a href=\"#\" onclick=\"javascript:if (confirm('Излечить всех за $heal_all кр?')){ location.href='lab.php?healall=1&cost=$heal_all';}\">[излечить]</a></small><br>";
echo"<b>В этой комнате:</b>"; echo "<b>В этой комнате:</b>";
echo"<br><li><u>Игроки:</u>"; echo "<br><li><u>Игроки:</u>";
while($items = mysql_fetch_array($data3)){ while ($items = mysql_fetch_array($data3)) {
echo "<BR>"; echo Nick::id($items['id'])->full(); echo "<BR>";
} echo Nick::id($items['id'])->full();
echo"<br><li><u>Мобы:</u>"; }
while($items = mysql_fetch_array($data4)){ echo "<br><li><u>Мобы:</u>";
echo "<BR>"; echo"<b>".$items['bot_name']."</b> "; echo" <img src='i/herz.gif' title='Жизни'>[".$items['bot_hp']."/".$items['bot_hpmax']."]"; while ($items = mysql_fetch_array($data4)) {
if(($u_res['zadanie_mob_id'] == $items['id_bot'] && $u_res['svitok_kill'] > 0) || ($u_res['zadanie'] == 7 && $u_res['svitok_kill'] > 0)){echo " <a href=\\";} echo "<BR>";
echo "<b>" . $items['bot_name'] . "</b> ";
echo " <img src='i/herz.gif' title='Жизни'>[" . $items['bot_hp'] . "/" . $items['bot_hpmax'] . "]";
if (($u_res['zadanie_mob_id'] == $items['id_bot'] && $u_res['svitok_kill'] > 0) || ($u_res['zadanie'] == 7 && $u_res['svitok_kill'] > 0)) {
echo " <a href=\\";
}
if($items['id_bot'] == 4) { if ($items['id_bot'] == 4) {
echo "<br><center><a href='?nal1=".$items['id']."'>[Обналичить чеки <font color=green>КР</font>]</a></center>"; echo "<br><center><a href='?nal1=" . $items['id'] . "'>[Обналичить чеки <font color=green>КР</font>]</a></center>";
} } elseif ($items['id_bot'] == 5) {
elseif($items['id_bot'] == 5) { echo "<br><center><a href='?nal2=" . $items['id'] . "'>[Обналичить чеки <font color=blue>ПАТР.</font>]</a></center>";
echo "<br><center><a href='?nal2=".$items['id']."'>[Обналичить чеки <font color=blue>ПАТР.</font>]</a></center>"; } elseif ($items['id_bot'] == 6) {
} echo "<br><center><a href='?nal3=" . $items['id'] . "'>[Обналичить чеки <font color=red>ЕКР</font>]</a></center>";
elseif($items['id_bot'] == 6) { } elseif ($items['id_bot'] == 7) {
echo "<br><center><a href='?nal3=".$items['id']."'>[Обналичить чеки <font color=red>ЕКР</font>]</a></center>"; echo "<br><center><a href='?nal4=" . $items['id'] . "'>[Обналичить чеки <font color=gray>ОПЫТА</font>]</a></center>";
} }
elseif($items['id_bot'] == 7) { }
echo "<br><center><a href='?nal4=".$items['id']."'>[Обналичить чеки <font color=gray>ОПЫТА</font>]</a></center>"; echo "<br><li><u>Ресурсы:</u>";
} while ($items = mysql_fetch_array($data)) {
} switch ($items['type']) {
echo"<br><li><u>Ресурсы:</u>"; case 1:
while($items = mysql_fetch_array($data)){ echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=green><b>" . $items['value'] . "</b> кр.</font></a>";
switch($items['type']){ break;
case 1: case 2:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=green><b>".$items['value']."</b> кр.</font></a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Alchemy_Potion_Empty.gif' width=16> Колодец жизни</a>";
break; break;
case 2: case 6:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Alchemy_Potion_Empty.gif' width=16> Колодец жизни</a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/lab/podarok.gif'> Подарок</a>";
break; break;
case 6: case 5:
echo "<BR><a href='?get=".$items['id']."'><img src='i/lab/podarok.gif'> Подарок</a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/lab/noj.gif'> Нож</a>";
break; break;
case 5: case 7:
echo "<BR><a href='?get=".$items['id']."'><img src='i/lab/noj.gif'> Нож</a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/lab/simvol.gif'> Установить древний символ</a>";
break; break;
case 7: case 3:
echo "<BR><a href='?get=".$items['id']."'><img src='i/lab/simvol.gif'> Установить древний символ</a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=blue> <b>" . $items['value'] . "</b> патр.</font></a>";
break; break;
case 3: case 8:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=blue> <b>".$items['value']."</b> патр.</font></a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=red> <b>" . $items['value'] . "</b> екр</font></a>";
break; break;
case 8: case 9:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=red> <b>".$items['value']."</b> екр</font></a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=gray> <b>" . $items['value'] . "</b> опыта</font></a>";
break; break;
case 9: case 4:
echo "<BR><a href='?get=".$items['id']."'><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=gray> <b>".$items['value']."</b> опыта</font></a>"; echo "<BR><a href='?get=" . $items['id'] . "'><img src='i/lab/zhem.gif'> Синий жемчуг</font></a>";
break; break;
case 4: }
echo "<BR><a href='?get=".$items['id']."'><img src='i/lab/zhem.gif'> Синий жемчуг</font></a>"; }
break; echo "<td rowspan=4 width=50% valign=top>";
}
}
echo "<td rowspan=4 width=50% valign=top>";
///////////*****3ADAHU9I******////////// ///////////*****3ADAHU9I******//////////
if($u_res['zadanie'] == 1){$mkol = 3;} if ($u_res['zadanie'] == 1) {
elseif($u_res['zadanie'] == 2){$mkol = 10;} $mkol = 3;
elseif($u_res['zadanie'] == 3){$mkol = 50;} } elseif ($u_res['zadanie'] == 2) {
elseif($u_res['zadanie'] == 4){$mkol = 10;} $mkol = 10;
elseif($u_res['zadanie'] == 5){$mkol = 15;} } elseif ($u_res['zadanie'] == 3) {
elseif($u_res['zadanie'] == 6){$mkol = 25;} $mkol = 50;
elseif($u_res['zadanie'] == 7){$mkol = 5;} } elseif ($u_res['zadanie'] == 4) {
elseif($u_res['zadanie'] == 8){$mkol = 10;} $mkol = 10;
echo"<b><em>Задание:</em></b> <em>".$u_res['zadanie_opisanie']."</em> [".$u_res['zad'.$u_res['zadanie'].'_kol']."/".$mkol."]"; } elseif ($u_res['zadanie'] == 5) {
if($u_res['zad'.$u_res['zadanie'].'_kol'] >= $mkol){echo" $mkol = 15;
} elseif ($u_res['zadanie'] == 6) {
$mkol = 25;
} elseif ($u_res['zadanie'] == 7) {
$mkol = 5;
} elseif ($u_res['zadanie'] == 8) {
$mkol = 10;
}
echo "<b><em>Задание:</em></b> <em>" . $u_res['zadanie_opisanie'] . "</em> [" . $u_res['zad' . $u_res['zadanie'] . '_kol'] . "/" . $mkol . "]";
if ($u_res['zad' . $u_res['zadanie'] . '_kol'] >= $mkol) {
echo "
<a href='lab.php?kwestend=1'>ЗАВЕРШИТЬ!</a> <a href='lab.php?kwestend=1'>ЗАВЕРШИТЬ!</a>
";} ";
}
?> ?>
<style> <style>
body { body {
background-image: url('i/labbg.jpg'); background-image: url('i/labbg.jpg');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top right; background-position: top right;
} }
.INPUT {
BORDER-RIGHT: #b0b0b0 1pt solid; BORDER-TOP: #b0b0b0 1pt solid; MARGIN-TOP: 1px; FONT-SIZE: 10px; MARGIN-BOTTOM: 2px; BORDER-LEFT: #b0b0b0 1pt solid; COLOR: #191970; BORDER-BOTTOM: #b0b0b0 1pt solid; FONT-FAMILY: MS Sans Serif
}
</style>
<?
echo"<hr><u>Найденные ресурсы:</u>";
while($items = mysql_fetch_array($data2)){
if($items['type']==1){echo "<BR><a href='?drop=".$items['id']."'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=green><b>".$items['value']."</b> кр.</font>";}
if($items['type']==3){echo "<BR><a href='?drop=".$items['id']."'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=blue><b>".$items['value']."</b> патр.</font>";}
if($items['type']==9){echo "<BR><a href='?drop=".$items['id']."'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=gray><b>".$items['value']."</b> опыта</font>";}
if($items['type']==8){echo "<BR><a href='?drop=".$items['id']."'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=red><b>".$items['value']."</b> екр</font>";}
} .INPUT {
echo "<BR> Всего: ".mysql_num_rows($data2)."/".($user['sila']*4)." "; BORDER-RIGHT: #b0b0b0 1pt solid;
echo "</tr><tr><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b4 onclick='location.href=\"lab.php?go=p4\";'>ЗАПАД</button><td><button style='width:50px; height:50px;' class='INPUT' onclick='location.href=\"lab.php\";'>ОБНО<BR>ВИТЬ</button><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b2 onclick='location.href=\"lab.php?go=p2\";'>ВОСТОК</button></tr>"; BORDER-TOP: #b0b0b0 1pt solid;
echo "<tr><td width=1%><td align=center width=1%><button style='width:50px; height:50px;' class='INPUT' disabled id=b3 onclick='location.href=\"lab.php?go=p3\";'>ЮГ</button><td width=1%></tr><tr><td colspan=6 style='height:100px;'></td></tr></table>"; MARGIN-TOP: 1px;
FONT-SIZE: 10px;
MARGIN-BOTTOM: 2px;
BORDER-LEFT: #b0b0b0 1pt solid;
COLOR: #191970;
BORDER-BOTTOM: #b0b0b0 1pt solid;
FONT-FAMILY: MS Sans Serif
}
</style>
<?php
echo "<hr><u>Найденные ресурсы:</u>";
while ($items = mysql_fetch_array($data2)) {
if ($items['type'] == 1) {
echo "<BR><a href='?drop=" . $items['id'] . "'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=green><b>" . $items['value'] . "</b> кр.</font>";
}
if ($items['type'] == 3) {
echo "<BR><a href='?drop=" . $items['id'] . "'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=blue><b>" . $items['value'] . "</b> патр.</font>";
}
if ($items['type'] == 9) {
echo "<BR><a href='?drop=" . $items['id'] . "'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=gray><b>" . $items['value'] . "</b> опыта</font>";
}
if ($items['type'] == 8) {
echo "<BR><a href='?drop=" . $items['id'] . "'><img src='i/clear.gif'></a><img src='i/INV_Scroll_03.gif' width=16>Чек на <font color=red><b>" . $items['value'] . "</b> екр</font>";
}
?> }
</body> echo "<BR> Всего: " . mysql_num_rows($data2) . "/" . ($user['sila'] * 4) . " ";
</html> echo "</tr><tr><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b4 onclick='location.href=\"lab.php?go=p4\";'>ЗАПАД</button><td><button style='width:50px; height:50px;' class='INPUT' onclick='location.href=\"lab.php\";'>ОБНО<BR>ВИТЬ</button><td><button style='width:50px; height:50px;' class='INPUT' disabled id=b2 onclick='location.href=\"lab.php?go=p2\";'>ВОСТОК</button></tr>";
echo "<tr><td width=1%><td align=center width=1%><button style='width:50px; height:50px;' class='INPUT' disabled id=b3 onclick='location.href=\"lab.php?go=p3\";'>ЮГ</button><td width=1%></tr><tr><td colspan=6 style='height:100px;'></td></tr></table>";

View File

@ -1,456 +1,453 @@
<?php <?php
ob_start("ob_gzhandler"); ob_start("ob_gzhandler");
session_start(); session_start();
if(empty($_SESSION['uid'])) { header("Location: index.php"); } if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once "functions.php"; require_once "functions.php";
header("Cache-Control: no-cache");
$errkom = ''; $errkom = '';
if ($user->room == 1051) {
mysql_query('DELETE FROM `laba_zv` WHERE `time` < "' . (time() - 1 * 60 * 60) . '"');
$var = mysql_fetch_array(mysql_query('SELECT `id`, `vals` FROM `actions` WHERE `vals` > "' . time() . '" AND `uid` = "' . $user['id'] . '" AND `vars` = "go_labirint" LIMIT 1'));
$zv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `uid1` = "' . $user['id'] . '" OR `uid2` = "' . $user['id'] . '" OR `uid3` = "' . $user['id'] . '" OR `uid4` = "' . $user['id'] . '" LIMIT 1'));
$re = '';
if (isset($_GET['exitlaba'])) {
if (isset($zv['id'])) {
$re = 'Подали заявку и убегаем? Не хорошо!';
} else {
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '2601', `online`.`room` = '2601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'");
header('Location: city.php');
}
} elseif (isset($_GET['pz1'])) {
if (isset($zv['id'])) {
$re = 'Вы уже подали заявку...';
} else {
if ($user['level'] < 4) {
$re = 'Персонажам до 4-го уровня запрещается посещать лабиринт!';
} elseif (isset($var['id'])) {
$tm = timeOut($var['vals'] - time());
$re = 'Следующий поход через: ' . $tm;
} else {
$_POST['type_gors'] = (int)$_POST['type_gors'];
if ($_POST['type_gors'] == 0 && $user['level'] > 6) {
$re = 'Лабиринт для новичков доступен для 4-6 уровней!';
} elseif ($_POST['type_gors'] == 1 && $user['level'] < 7) {
$re = 'Лабиринт для опытных доступен с 7 уровня!';
} elseif ($_POST['type_gors'] == 2 && ($user['level'] < 9 || $user['rep_laba'] < 20000)) {
$re = 'Легендарный Лабиринт доступен с 9 уровня!<br />Так-же требуется 20000 репутации Лабиринтов! У Вас : ' . $user['rep_laba'] . ' репутации Лабиринтов.';
} else {
mysql_query('INSERT INTO `laba_zv` (`uid1`, `time`, `com`, `pass`, `type`, `level`) VALUES ("' . $user['id'] . '", "' . time() . '", "' . mysql_real_escape_string(htmlspecialchars($_POST['text'])) . '", "' . mysql_real_escape_string($_POST['text']) . '", "' . mysql_real_escape_string($_POST['type_gors']) . '", "' . $user['level'] . '")');
header('Location: lab_enter.php');
}
}
}
} elseif (isset($_GET['cancelzv'])) {
if (!isset($zv['id'])) {
$re = 'Вы не участвуете ни в одной из заявок!<br />';
} else {
$i = 1;
$j = 4;
$k = 0;
$h = 0;
while ($i <= 4) {
if ($k == 0 && $zv['uid' . $i] != $user['id']) {
$k = $zv['uid' . $i];
$h = $i;
}
$i++;
}
$i = 1;
while ($i <= 4) {
if ($zv['uid' . $i] == $user['id']) {
if ($i > 1) {
$zv['uid' . $i] = 0;
} else {
$zv['uid' . $i] = $k;
$zv['uid' . $h] = 0;
}
}
if ($zv['uid' . $i] == 0) {
$j--;
}
$i++;
}
if ($j < 1) {
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
} else {
mysql_query('UPDATE `laba_zv` SET `uid1` = "' . $zv['uid1'] . '", `uid2` = "' . $zv['uid2'] . '", `uid3` = "' . $zv['uid3'] . '", `uid4` = "' . $zv['uid4'] . '" WHERE `id` = "' . $zv['id'] . '" lIMIT 1');
}
$re = 'Заявка успешно отменена!<br />';
unset($zv);
}
} elseif (isset($_GET['priemzv'])) {
if (isset($zv['id'])) {
$re = 'Вы уже состоите в одной из заявок!';
} else {
$tozv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `id` = "' . mysql_real_escape_string($_GET['priemzv']) . '" LIMIT 1'));
if (!isset($tozv['id'])) {
$re = 'Заявка не найдена!';
} elseif (isset($var['id'])) {
$tm = timeOut($var['vals'] - time());
$re = 'Следующий поход через: ' . $tm;
} else {
if ($tozv['uid1'] > 0 && $tozv['uid2'] > 0 && $tozv['uid3'] > 0 && $tozv['uid4'] > 0) {
$re = 'В заявке нет свободных мест!';
} else {
$i = 1;
$j = 0;
while ($i <= 4) {
if ($tozv['uid' . $i] == 0 && $j == 0) {
$j = $i;
}
$i++;
}
mysql_query('UPDATE `laba_zv` SET `uid' . $j . '` = "' . $user['id'] . '" WHERE `id` = "' . $tozv['id'] . '" LIMIT 1');
header('Location: lab_enter.php');
}
}
}
} elseif (isset($_GET['startzv'])) {
if (!isset($zv['id'])) {
$re = 'Вы должны сначала подать заявку!';
} elseif ($zv['uid1'] != $user['id']) {
$re = 'Вы должны являться лидером группы!';
} else {
if ($zv['type'] == 0) {
$level = 5;
} elseif ($zv['type'] == 1) {
$level = 8;
} elseif ($zv['type'] == 2) {
$level = 10;
}
if($user->room == 1051) { $k = floor(2.5 * $level);
$aligns = array(2.99); $s = $k * 2 + 3;
mysql_query('DELETE FROM `laba_zv` WHERE `time` < "'.(time()-1*60*60).'"'); $r = 10;
$var = mysql_fetch_array(mysql_query('SELECT `id`, `vals` FROM `actions` WHERE `vals` > "'.time().'" AND `uid` = "'.$user['id'].'" AND `vars` = "go_labirint" LIMIT 1')); $count = 1;
$zv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `uid1` = "'.$user['id'].'" OR `uid2` = "'.$user['id'].'" OR `uid3` = "'.$user['id'].'" OR `uid4` = "'.$user['id'].'" LIMIT 1')); $a = [];
$re = ''; for ($y = 0; $y < $s; $y++) {
if(isset($_GET['exitlaba'])) { for ($x = 0; $x < $s; $x++) {
if(isset($zv['id'])) { $a[$y][$x] = 1;
$re = 'Подали заявку и убегаем? Не хорошо!'; }
} else { }
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '2601', `online`.`room` = '2601' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$user['id']}'"); for ($x = 0; $x < $s; $x++) {
header('Location: city.php'); $a[0][$x] = 0;
} $a[$s - 1][$x] = 0;
} elseif(isset($_GET['pz1'])) { $a[$x][0] = 0;
if(isset($zv['id'])) { $a[$x][$s - 1] = 0;
$re = 'Вы уже подали заявку...'; }
} else { $x = $y = ($k - 1) >> 1;
if($user['level'] < 4) { $a[$y * 2 + 2][$x * 2 + 2] = 0;
$re = 'Персонажам до 4-го уровня запрещается посещать лабиринт!'; while (1) {
} elseif(isset($var['id'])) { do {
$tm = timeOut($var['vals']-time()); $d = rand(0, 3);
$re = 'Следующий поход через: '.$tm; for ($i = 0; $i < 4; $i++) {
} else { if ($d == 0 && $a[$y * 2 + 2][$x * 2 + 4]) {
$_POST['type_gors'] = (int)$_POST['type_gors']; $a[$y * 2 + 2][$x++ * 2 + 3] = 0;
if($_POST['type_gors'] == 0 && $user['level'] > 6) { $a[$y * 2 + 2][$x * 2 + 2] = 0;
$re = 'Лабиринт для новичков доступен для 4-6 уровней!'; $i = 5;
} elseif($_POST['type_gors'] == 1 && $user['level'] < 7) { $count++;
$re = 'Лабиринт для опытных доступен с 7 уровня!'; break;
} elseif($_POST['type_gors'] == 2 && ($user['level'] < 9 || $user['rep_laba'] < 20000)) { } elseif ($d == 1 && $a[$y * 2][$x * 2 + 2]) {
$re = 'Легендарный Лабиринт доступен с 9 уровня!<br />Так-же требуется 20000 репутации Лабиринтов! У Вас : '.$user['rep_laba'].' репутации Лабиринтов.'; $a[$y-- * 2 + 1][$x * 2 + 2] = 0;
} else { $a[$y * 2 + 2][$x * 2 + 2] = 0;
mysql_query('INSERT INTO `laba_zv` (`uid1`, `time`, `com`, `pass`, `type`, `level`) VALUES ("'.$user['id'].'", "'.time().'", "'.mysql_real_escape_string(htmlspecialchars($_POST['text'])).'", "'.mysql_real_escape_string($_POST['text']).'", "'.mysql_real_escape_string($_POST['type_gors']).'", "'.$user['level'].'")'); $i = 5;
header('Location: lab_enter.php'); $count++;
} break;
} } elseif ($d == 2 && $a[$y * 2 + 2][$x * 2]) {
} $a[$y * 2 + 2][$x-- * 2 + 1] = 0;
} elseif(isset($_GET['cancelzv'])) { $a[$y * 2 + 2][$x * 2 + 2] = 0;
if(!isset($zv['id'])) { $i = 5;
$re = 'Вы не участвуете ни в одной из заявок!<br />'; $count++;
} else { break;
$i = 1; $j = 4; $k = 0; $h = 0; } elseif ($d == 3 && $a[$y * 2 + 4][$x * 2 + 2]) {
while($i <= 4) { $a[$y++ * 2 + 3][$x * 2 + 2] = 0;
if($k == 0 && $zv['uid'.$i] != $user['id']) { $a[$y * 2 + 2][$x * 2 + 2] = 0;
$k = $zv['uid'.$i]; $i = 5;
$h = $i; $count++;
} break;
$i++; }
} $d = ($d + 1) % 4;
$i = 1; }
while($i <= 4) { } while ($i != 4);
if($zv['uid'.$i] == $user['id']) { if ($count >= $k * $k) {
if($i > 1) { break;
$zv['uid'.$i] = 0; }
} else { $x = rand(0, $k - 1);
$zv['uid'.$i] = $k; $y = rand(0, $k - 1);
$zv['uid'.$h] = 0; while ($a[$y * 2 + 2][$x * 2 + 2] || !$a[$y * 2 + 2][$x * 2 + 4] && !$a[$y * 2][$x * 2 + 2] && !$a[$y * 2 + 2][$x * 2] && !$a[$y * 2 + 4][$x * 2 + 2]) {
} if (++$x >= $k) {
} $x = 0;
if($zv['uid'.$i] == 0) { if (++$y >= $k) {
$j--; $y = 0;
} }
$i++; }
} }
if($j < 1) { }
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); $rnds = [rand(1, 3), rand(1, 3)];
} else { $srg = [];
mysql_query('UPDATE `laba_zv` SET `uid1` = "'.$zv['uid1'].'", `uid2` = "'.$zv['uid2'].'", `uid3` = "'.$zv['uid3'].'", `uid4` = "'.$zv['uid4'].'" WHERE `id` = "'.$zv['id'].'" lIMIT 1'); $objects = [];
} if ($rnds[0] == 1) {
$re = 'Заявка успешно отменена!<br />'; $a[2][1] = 0;
unset($zv); $a[2][2] = 0;
} $srg = [2, 1];
} elseif(isset($_GET['priemzv'])) { $objects[2][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
if(isset($zv['id'])) { } elseif ($rnds[0] == 2) {
$re = 'Вы уже состоите в одной из заявок!'; $a[$k][1] = 0;
} else { $a[$k][2] = 0;
$tozv = mysql_fetch_array(mysql_query('SELECT * FROM `laba_zv` WHERE `id` = "'.mysql_real_escape_string($_GET['priemzv']).'" LIMIT 1')); $srg = [$k, 1];
if(!isset($tozv['id'])) { $objects[$k][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
$re = 'Заявка не найдена!'; } elseif ($rnds[0] == 3) {
} elseif(isset($var['id'])) { $a[$k * 2][1] = 0;
$tm = timeOut($var['vals']-time()); $a[$k * 2][2] = 0;
$re = 'Следующий поход через: '.$tm; $srg = [$k * 2, 1];
} else { $objects[$k * 2][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
if($tozv['uid1'] > 0 && $tozv['uid2'] > 0 && $tozv['uid3'] > 0 && $tozv['uid4'] > 0) { }
$re = 'В заявке нет свободных мест!';
} else {
$i = 1; $j = 0;
while($i <= 4) {
if($tozv['uid'.$i] == 0 && $j == 0) {
$j = $i;
}
$i++;
}
mysql_query('UPDATE `laba_zv` SET `uid'.$j.'` = "'.$user['id'].'" WHERE `id` = "'.$tozv['id'].'" LIMIT 1');
header('Location: lab_enter.php');
}
}
}
} elseif(isset($_GET['startzv'])) {
if(!isset($zv['id'])) {
$re = 'Вы должны сначала подать заявку!';
} elseif($zv['uid1'] != $user['id']) {
$re = 'Вы должны являться лидером группы!';
} else {
if($zv['type'] == 0) {
$level = 5;
} elseif($zv['type'] == 1) {
$level = 8;
} elseif($zv['type'] == 2) {
$level = 10;
}
$k = floor(2.5*$level); $s = $k*2+3; $r = 10; $count = 1; if ($rnds[1] == 1) {
$a = array(); $a[2][$k * 2 + 1] = 0;
for($y = 0; $y < $s; $y++) { $a[2][$k * 2] = 0;
for($x = 0; $x < $s; $x++) { $objects[2][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
$a[$y][$x] = 1; } elseif ($rnds[1] == 2) {
} $a[$k][$k * 2 + 1] = 0;
} $a[$k][$k * 2] = 0;
for($x = 0; $x < $s; $x++) { $objects[$k][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
$a[0][$x] = 0; $a[$s-1][$x] = 0; } elseif ($rnds[1] == 3) {
$a[$x][0] = 0; $a[$x][$s-1] = 0; $a[$k * 2][$k * 2 + 1] = 0;
} $a[$k * 2][$k * 2] = 0;
$x = $y = ($k-1)>>1; $a[$y*2+2][$x*2+2] = 0; $objects[$k * 2][$k * 2 + 1] = '<div title="Выход из подземелье" class="ddpExit"></div>';
while(1) { }
do {
$d = rand(0, 3);
for($i = 0; $i < 4; $i++) {
if($d == 0 && $a[$y*2+2][$x*2+4]) {
$a[$y*2+2][$x++*2+3] = 0; $a[$y*2+2][$x*2+2] = 0;
$i = 5; $count++; break;
} elseif($d == 1 && $a[$y*2][$x*2+2]) {
$a[$y--*2+1][$x*2+2] = 0; $a[$y*2+2][$x*2+2] = 0;
$i = 5; $count++; break;
} elseif($d == 2 && $a[$y*2+2][$x*2]) {
$a[$y*2+2][$x--*2+1] = 0; $a[$y*2+2][$x*2+2] = 0;
$i = 5; $count++; break;
} elseif($d == 3 && $a[$y*2+4][$x*2+2]) {
$a[$y++*2+3][$x*2+2] = 0; $a[$y*2+2][$x*2+2] = 0;
$i = 5; $count++; break;
}
$d = ($d+1)%4;
}
} while($i != 4);
if($count >= $k*$k) {
break;
}
$x = rand(0, $k-1); $y = rand(0, $k-1);
while($a[$y*2+2][$x*2+2] || !$a[$y*2+2][$x*2+4] && !$a[$y*2][$x*2+2] && !$a[$y*2+2][$x*2] && !$a[$y*2+4][$x*2+2]) {
if(++$x >= $k) {
$x = 0;
if(++$y >= $k) {
$y = 0;
}
}
}
}
$rnds = array(rand(1, 3), rand(1, 3));
$srg = array();
$objects = array();
if($rnds[0] == 1) {
$a[2][1] = 0; $a[2][2] = 0;
$srg = array(2, 1); $objects[2][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
} elseif($rnds[0] == 2) {
$a[$k][1] = 0; $a[$k][2] = 0;
$srg = array($k, 1); $objects[$k][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
} elseif($rnds[0] == 3) {
$a[$k*2][1] = 0; $a[$k*2][2] = 0;
$srg = array($k*2, 1); $objects[$k*2][1] = '<div title="Вход в подземелье" class="ddpStart"></div>';
}
if($rnds[1] == 1) { $map = [];
$a[2][$k*2+1] = 0; $a[2][$k*2] = 0; $i = 1;
$objects[2][$k*2+1] = '<div title="Выход из подземелье" class="ddpExit"></div>'; while ($i < count($a) - 1) {
} elseif($rnds[1] == 2) { $j = 1;
$a[$k][$k*2+1] = 0; $a[$k][$k*2] = 0; while ($j < count($a[$i]) - 1) {
$objects[$k][$k*2+1] = '<div title="Выход из подземелье" class="ddpExit"></div>'; if ($a[$i][$j] == 0 && $i > 1 && $j > 1 && $i <= $k * 2 && $j <= $k * 2) {
} elseif($rnds[1] == 3) { $map[] = [$i, $j];
$a[$k*2][$k*2+1] = 0; $a[$k*2][$k*2] = 0; }
$objects[$k*2][$k*2+1] = '<div title="Выход из подземелье" class="ddpExit"></div>'; $j++;
} }
$i++;
}
$proc1 = round(1.7 * $level); //Сколько % занимают сундуки
$proc2 = round(2.5 * $level); //Сколько % занимают монстры
$proc3 = round(1.35 * $level); //Сколько % занимают хилки
$proc4 = round(0.5 * $level); //Сколько % занимают ловушки
$proc5 = round(0.1 * $level); //Сколько % занимают пандоры
$proc6 = round(0.2 * $level); // Сколько занимает Антидот
$map = array(); $proc1 = round($proc1 / 2);
$i = 1; $proc1 = round(count($map) / 100 * $proc1);
while($i < count($a) - 1) { $proc2 = round($proc2 / 2);
$j = 1; $proc2 = round(count($map) / 100 * $proc2);
while($j < count($a[$i]) - 1) { $proc3 = round($proc3 / 2);
if($a[$i][$j] == 0 && $i > 1 && $j > 1 && $i <= $k*2 && $j <= $k*2) { $proc3 = round(count($map) / 100 * $proc3);
$map[] = array($i, $j); $proc4 = round($proc4 / 2);
} $proc4 = round(count($map) / 100 * $proc4);
$j++; $proc5 = round($proc5 / 2);
} $proc5 = round(count($map) / 100 * $proc5);
$i++; $proc6 = round($proc6 / 2);
} $proc6 = round(count($map) / 100 * $proc6);
$proc1 = round(1.7*$level); //Сколько % занимают сундуки
$proc2 = round(2.5*$level); //Сколько % занимают монстры
$proc3 = round(1.35*$level); //Сколько % занимают хилки
$proc4 = round(0.5*$level); //Сколько % занимают ловушки
$proc5 = round(0.1*$level); //Сколько % занимают пандоры
$proc6 = round(0.2*$level); // Сколько занимает Антидот
$proc1 = round($proc1/2); $usi = 0;
$proc1 = round(count($map)/100*$proc1); mysql_query('INSERT INTO `laba_now` (`time`, `uid`, `users`, `map_id`, `end`, `type`) VALUES ("' . time() . '", "' . $user['id'] . '", "-1", "0", "0", "' . $zv['type'] . '")');
$proc2 = round($proc2/2); $ding = mysql_insert_id();
$proc2 = round(count($map)/100*$proc2); $i = 1;
$proc3 = round($proc3/2); while ($i <= 4) {
$proc3 = round(count($map)/100*$proc3); if ($zv['uid' . $i] > 0) {
$proc4 = round($proc4/2); $plu = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "' . $zv['uid' . $i] . '" LIMIT 1'));
$proc4 = round(count($map)/100*$proc4); if (isset($plu['id'])) {
$proc5 = round($proc5/2); mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1052', `online`.`room` = '1052', `users`.`x` = '" . $srg[0] . "', `users`.`y` = '" . $srg[1] . "', `users`.`xf` = '" . $srg[0] . "', `users`.`yr` = '" . $srg[1] . "', `users`.`laba` = '" . $ding . "' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $plu['id'] . "'");
$proc5 = round(count($map)/100*$proc5); $usi++;
$proc6 = round($proc6/2); }
$proc6 = round(count($map)/100*$proc6); }
$i++;
}
mysql_query('UPDATE `laba_now` SET `users` = "' . $usi . '" WHERE `id` = "' . $ding . '" LIMIT 1');
mysql_query('INSERT INTO `laba_map` (`id`, `data`, `update`) VALUES ("' . $ding . '", "' . json_encode($a) . '", "' . time() . '")');
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
$usi = 0; $i = 1;
mysql_query('INSERT INTO `laba_now` (`time`, `uid`, `users`, `map_id`, `end`, `type`) VALUES ("'.time().'", "'.$user['id'].'", "-1", "0", "0", "'.$zv['type'].'")'); while ($i <= 6) {
$ding = mysql_insert_id(); if (${'proc' . $i} > 0) {
$i = 1; $j = 0;
while($i <= 4) { while ($j < ${'proc' . $i}) {
if($zv['uid'.$i] > 0) { $cord = $map[rand(0, count($map) - 1)];
$plu = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `id` = "'.$zv['uid'.$i].'" LIMIT 1')); $obj = '';
if(isset($plu['id'])) { if ($i == 1) {
mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1052', `online`.`room` = '1052', `users`.`x` = '".$srg[0]."', `users`.`y` = '".$srg[1]."', `users`.`xf` = '".$srg[0]."', `users`.`yr` = '".$srg[1]."', `users`.`laba` = '".$ding."' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$plu['id']."'"); $obj = 'ddp1s';
$usi++; } elseif ($i == 2) {
} $obj = 'ddp1m';
} } elseif ($i == 3) {
$i++; $obj = 'ddp1h';
} } elseif ($i == 4) {
mysql_query('UPDATE `laba_now` SET `users` = "'.$usi.'" WHERE `id` = "'.$ding.'" LIMIT 1'); $obj = 'ddp1l';
mysql_query('INSERT INTO `laba_map` (`id`, `data`, `update`) VALUES ("'.$ding.'", "'.json_encode($a).'", "'.time().'")'); } elseif ($i == 5) {
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "'.$zv['id'].'" LIMIT 1'); $obj = 'ddp1p';
} elseif ($i == 6) {
$i = 1; $obj = 'ddp1a';
while($i <= 6) { }
if(${'proc'.$i} > 0) { mysql_query('INSERT INTO `laba_obj` (`lib`, `x`, `y`, `type`, `img`, `name`, `time`, `use`) VALUES ("' . $ding . '", "' . $cord[0] . '", "' . $cord[1] . '", "' . $i . '", "' . $obj . '", "{standart}", "' . time() . '", "0")');
$j = 0; $j++;
while($j < ${'proc'.$i}) { }
$cord = $map[rand(0, count($map)-1)]; }
$obj = ''; $i++;
if($i == 1) { }
$obj = 'ddp1s'; mysql_query('DELETE FROM `laba_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
} elseif($i == 2) { header('Location: labirint.php');
$obj = 'ddp1m'; }
} elseif($i == 3) {
$obj = 'ddp1h';
} elseif($i == 4) {
$obj = 'ddp1l';
} elseif($i == 5) {
$obj = 'ddp1p';
} elseif($i == 6) {
$obj = 'ddp1a';
}
mysql_query('INSERT INTO `laba_obj` (`lib`, `x`, `y`, `type`, `img`, `name`, `time`, `use`) VALUES ("'.$ding.'", "'.$cord[0].'", "'.$cord[1].'", "'.$i.'", "'.$obj.'", "{standart}", "'.time().'", "0")');
$j++;
}
}
$i++;
}
mysql_query('DELETE FROM `laba_zv` WHERE `id` = "'.$zv['id'].'" LIMIT 1');
header('Location: labirint.php');
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<style type="text/css">
body { margin-left: 5px; margin-top: 5px; margin-right: 5px; margin-bottom: 5px; }
.ddp0 { display: inline-block; width: 15px; height: 15px; background-image: url("/combats-1/i/laba/bg/o.gif"); }
.ddp1 { display: inline-block; width: 15px; height: 15px; background-image: url("/combats-1/i/laba/bg/m.gif"); }
.ddpStart { display: inline-block; width: 15px; height: 15px; background-image: url("/combats-1/i/laba/bg/os.gif"); }
.ddpExit { display: inline-block; width: 15px; height: 15px; background-image: url("/combats-1/i/laba/bg/of.gif"); }
.ddp1s {
display:inline-block;
width:15px;
height:15px;
background-image:url("/combats-1/i/laba/bg/s.gif");
}
.ddp1m {
display:inline-block;
width:15px;
height:15px;
background-image:url("/combats-1/i/laba/bg/r.gif");
}
.ddp1h {
display:inline-block;
width:15px;
height:15px;
background-image:url("/combats-1/i/laba/bg/h.gif");
}
.ddp1l {
display:inline-block;
width:15px;
height:15px;
background-image:url("/combats-1/i/laba/bg/b.gif");
}
.ddp1p {
display:inline-block;
width:15px;
height:15px;
background-image:url("/combats-1/i/laba/bg/p.gif");
}
</style>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<META Http-Equiv=Cache-Control Content="no-cache, max-age=0, must-revalidate, no-store">
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</head>
<body bgcolor=#e2e0e0 >
<div style="float: right;">
<input type="button" onclick="location.href='lab_enter.php';" value="Обновить" /> &nbsp; <input type="button" onclick="location.href='?exitlaba=1';" value="Покинуть вход" /></div>
<div style="padding-left: 0;" align="center">
<h3>Вход в Лабиринты</h3>
</div>
<?
if(isset($_GET['del_com'])) {
if(in_array($user['align'], $aligns)) {
mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "'.(int)$_GET['del_com'].'" LIMIT 1');
$re = 'Комментарий удалён';
} else {
$re = 'Вы не можете удалять комментарии.';
}
}
if($user['level'] >= 4) {
if(isset($_GET['quest'])) {
$q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "'.$user['id'].'" AND `cancel` = "0" AND `finish` = "0" LIMIT 1'));
if(!isset($q2['id'])) {
$q3 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "'.$user['id'].'" AND (`cancel` > "'.time().'" OR `finish` > "'.time().'") LIMIT 1'));
if(isset($q3['id'])) {
if($q3['cancel'] > time()) { $tm = timeOut($q3['cancel']-time()); } else { $tm = timeOut($q3['finish']-time()); }
$re = 'Нельзя брать задания так часто, разрешенный лимит: Один раз в 12 часов.<br /> Следующее задание можно взять через : '.$tm;
} else {
$rand = array();
$sp = mysql_query('SELECT `id`, `name` FROM `qst` WHERE `level` = "'.$user['level'].'"');
while($pl = mysql_fetch_array($sp)) {
$rand[] = $pl;
}
$rand = $rand[rand(0, count($rand)-1)];
if($rand['id'] > 0) {
$re = 'Вы успешно взяли задание &quot;'.$rand['name'].'&quot;!<br />';
mysql_query('INSERT INTO `qst_user` (`uid`, `time`, `qid`) VALUES ("'.$user['id'].'", "'.time().'", "'.$rand['id'].'")');
} else {
$re = 'Неудалось взять задание, нет подходящих заданий у Хранителя Лабиринта<br />';
}
}
} else {
$re = 'У вас уже есть задание.';
}
}
$q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "'.$user['id'].'" AND `cancel` = "0" AND `finish` = "0" LIMIT 1'));
$q1 = mysql_fetch_array(mysql_query('SELECT * FROM `qst` WHERE `id` = "'.$q2['qid'].'" LIMIT 1'));
if(isset($q2['id']) && isset($_GET['cancelqst'])) {
mysql_query('UPDATE `qst_user` SET `cancel` = "'.(time()+6*3600).'" WHERE `id` = "'.$q2['id'].'" LIMIT 1');
unset($q1, $q2);
$re = 'Вы успешно отказались от задания...<br />';
}
if(isset($q1['id'])) {
$re .= '<br /><b>Задание : </b> '.$q1['name'].' ['.$q2['val'].'/'.$q1['obj_val'].']<br /><a href="?cancelqst=1">&bull; Отказаться (Следующее можно будет взять через 12 часов)</a><br />';
if($q2['val'] >= $q1['obj_val']) {
if(isset($_GET['finishqst'])) {
$re = 'Вы успешно завершили задание и получили: ';
if($q1['cr'] > 0) {
$re .= ' '.$q1['cr'].' кр. ';
}
if($q1['rep'] > 0) {
$re .= ' '.$q1['rep'].' репутации. ';
}
$re .= '<br />';
$user['money'] += $q1['cr']; $user['doblest'] += $q1['rep']; $user['rep_laba'] += $q1['rep'];
mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'", `doblest` = "'.$user['doblest'].'", `rep_laba` = "'.$user['rep_laba'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
mysql_query('UPDATE `qst_user` SET `finish` = "'.(time()+60*60*12).'" WHERE `id` = "'.$q2['id'].'" AND `uid` = "'.$user['id'].'" LIMIT 1');
unset($q1, $q2);
}
$re .= ' <a href="?finishqst=1">&bull; Завершить задание и получить награду!</a>';
}
} else {
?>
<input onclick="location.href='lab_enter.php?quest=1'" type="submit" name="quest" value='Взять квестовое задание' style="background-color:#A9AFC0" />
<? }
} ?>
<?
$sp = mysql_query('SELECT * FROM `laba_zv` ORDER BY `id` DESC');
$typez = array(0 => 'Для новичков', 1 => 'Для опытных', 2 => 'Для легендарных');
while($pl = mysql_fetch_array($sp)) {
$userszv = '';
$i = 1;
while($i <= 4) {
if($pl['uid'.$i] > 0) {
$plu = mysql_fetch_array(mysql_query('SELECT `id`, `align`, `login`, `level` FROM `users` WHERE `id` = "'.$pl['uid'.$i].'" LIMIT 1'));
if(isset($plu['id'])) {
$userszv .= ', <img src="i/align_'.$plu['align'].'.gif"><b>'.$plu['login'].'</b> ['.$plu['level'].']';
}
}
$i++;
}
$userszv = ltrim($userszv, ', ');
if($pl['com'] != '') {
if(in_array($user['align'], $aligns)) {
$del = ' <a href=\'lab_enter.php?del_com='.$pl['id'].'\'>Удалить комментарий</a>';
} else {
$del = '';
} }
$userszv .= ' (Комментарий: '.$pl['com'].''.$del.')'; Template::header('Вход в Лабиринты');
} ?>
if(!isset($zv['id'])) { <div style="float: right;">
$userszv .= ' <input onclick="location.href=\'?priemzv='.$pl['id'].'\'" type="button" value="Принять">'; <input type="button" onclick="location.href='lab_enter.php';" value="Обновить">
} <input type="button" onclick="location.href='?exitlaba=1';" value="Покинуть вход">
echo '<div><span class=date>'.date('H:i', $pl['time']).'</span> Тип : <b>'.$typez[$pl['type']].'</b> | '.$userszv.'</div>'; </div>
} <div style="padding-left: 0;" align="center">
?> <h3>Вход в Лабиринты</h3>
<hr> </div>
<? if(!isset($zv['id'])) { ?> <?
<table width="350" border="0" cellspacing="0" cellpadding="0"> if (isset($_GET['del_com'])) {
<tr> if ($user->admin) {
<td valign="top"> mysql_query('UPDATE `laba_zv` SET `com` = "" WHERE `id` = "' . (int)$_GET['del_com'] . '" LIMIT 1');
<form id="from" autocomplete="off" name="from" action="lab_enter.php?pz1=<? echo mt_rand(1000000, 99999999); ?>" method="post"> $re = 'Комментарий удалён';
<fieldset style='padding-left: 5; width=50%'> } else {
<legend><b> Группа </b> </legend> $re = 'Вы не можете удалять комментарии.';
Тип похода: }
<select name="type_gors" style="margin-left:7px;" id="type_gors"> }
<option value="0">Новичок</option>
<option value="1">Опытный</option> if ($user['level'] >= 4) {
<option value="2">Легендарный</option> if (isset($_GET['quest'])) {
</select> $q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1'));
<br /> if (!isset($q2['id'])) {
Комментарий $q3 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND (`cancel` > "' . time() . '" OR `finish` > "' . time() . '") LIMIT 1'));
<input type="text" name="text" maxlength="40" size="40" /> if (isset($q3['id'])) {
<br /> if ($q3['cancel'] > time()) {
<input type="submit" name="add" value="Создать группу" /> $tm = timeOut($q3['cancel'] - time());
&nbsp;<br /> } else {
</fieldset> $tm = timeOut($q3['finish'] - time());
</form> }
</td> $re = 'Нельзя брать задания так часто, разрешенный лимит: Один раз в 12 часов.<br /> Следующее задание можно взять через : ' . $tm;
</tr> } else {
</table> $rand = [];
<? }else{ ?> $sp = mysql_query('SELECT `id`, `name` FROM `qst` WHERE `level` = "' . $user['level'] . '"');
<? if( $zv['uid1'] == $user['id'] ) { ?><input type="button" onclick="location.href='lab_enter.php?startzv=1';" value="Начать поход" /> &nbsp; <? } ?><input type="button" onclick="location.href='lab_enter.php?cancelzv=1';" value="Отозвать заявку" /> while ($pl = mysql_fetch_array($sp)) {
<? } ?> $rand[] = $pl;
<? if( $re != '' ) { echo '<br /><font color=red>'.$re.'</font>'; } ?> }
</body> $rand = $rand[rand(0, count($rand) - 1)];
</html> if ($rand['id'] > 0) {
<? } ?> $re = 'Вы успешно взяли задание &quot;' . $rand['name'] . '&quot;!<br />';
mysql_query('INSERT INTO `qst_user` (`uid`, `time`, `qid`) VALUES ("' . $user['id'] . '", "' . time() . '", "' . $rand['id'] . '")');
} else {
$re = 'Неудалось взять задание, нет подходящих заданий у Хранителя Лабиринта<br />';
}
}
} else {
$re = 'У вас уже есть задание.';
}
}
$q2 = mysql_fetch_array(mysql_query('SELECT * FROM `qst_user` WHERE `uid` = "' . $user['id'] . '" AND `cancel` = "0" AND `finish` = "0" LIMIT 1'));
$q1 = mysql_fetch_array(mysql_query('SELECT * FROM `qst` WHERE `id` = "' . $q2['qid'] . '" LIMIT 1'));
if (isset($q2['id']) && isset($_GET['cancelqst'])) {
mysql_query('UPDATE `qst_user` SET `cancel` = "' . (time() + 6 * 3600) . '" WHERE `id` = "' . $q2['id'] . '" LIMIT 1');
unset($q1, $q2);
$re = 'Вы успешно отказались от задания...<br />';
}
if (isset($q1['id'])) {
$re .= '<br /><b>Задание : </b> ' . $q1['name'] . ' [' . $q2['val'] . '/' . $q1['obj_val'] . ']<br /><a href="?cancelqst=1">&bull; Отказаться (Следующее можно будет взять через 12 часов)</a><br />';
if ($q2['val'] >= $q1['obj_val']) {
if (isset($_GET['finishqst'])) {
$re = 'Вы успешно завершили задание и получили: ';
if ($q1['cr'] > 0) {
$re .= ' ' . $q1['cr'] . ' кр. ';
}
if ($q1['rep'] > 0) {
$re .= ' ' . $q1['rep'] . ' репутации. ';
}
$re .= '<br />';
$user['money'] += $q1['cr'];
$user['doblest'] += $q1['rep'];
$user['rep_laba'] += $q1['rep'];
mysql_query('UPDATE `users` SET `money` = "' . $user['money'] . '", `doblest` = "' . $user['doblest'] . '", `rep_laba` = "' . $user['rep_laba'] . '" WHERE `id` = "' . $user['id'] . '" LIMIT 1');
mysql_query('UPDATE `qst_user` SET `finish` = "' . (time() + 60 * 60 * 12) . '" WHERE `id` = "' . $q2['id'] . '" AND `uid` = "' . $user['id'] . '" LIMIT 1');
unset($q1, $q2);
}
$re .= ' <a href="?finishqst=1">&bull; Завершить задание и получить награду!</a>';
}
} else {
?>
<input onclick="location.href='lab_enter.php?quest=1'" type="submit" name="quest"
value='Взять квестовое задание' style="background-color:#A9AFC0"/>
<? }
} ?>
<?
$sp = mysql_query('SELECT * FROM `laba_zv` ORDER BY `id` DESC');
$typez = [0 => 'Для новичков', 1 => 'Для опытных', 2 => 'Для легендарных'];
while ($pl = mysql_fetch_array($sp)) {
$userszv = '';
$i = 1;
while ($i <= 4) {
if ($pl['uid' . $i] > 0) {
$plu = mysql_fetch_array(mysql_query('SELECT `id`, `align`, `login`, `level` FROM `users` WHERE `id` = "' . $pl['uid' . $i] . '" LIMIT 1'));
if (isset($plu['id'])) {
$userszv .= ', <img src="i/align_' . $plu['align'] . '.gif"><b>' . $plu['login'] . '</b> [' . $plu['level'] . ']';
}
}
$i++;
}
$userszv = ltrim($userszv, ', ');
if ($pl['com'] != '') {
if ($user->admin) {
$del = ' <a href=\'lab_enter.php?del_com=' . $pl['id'] . '\'>Удалить комментарий</a>';
} else {
$del = '';
}
$userszv .= ' (Комментарий: ' . $pl['com'] . '' . $del . ')';
}
if (!isset($zv['id'])) {
$userszv .= ' <input onclick="location.href=\'?priemzv=' . $pl['id'] . '\'" type="button" value="Принять">';
}
echo '<div><span class=date>' . date('H:i', $pl['time']) . '</span> Тип : <b>' . $typez[$pl['type']] . '</b> | ' . $userszv . '</div>';
}
?>
<hr>
<? if (!isset($zv['id'])) { ?>
<table width="350" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<form id="from" autocomplete="off" name="from"
action="lab_enter.php?pz1=<? echo mt_rand(1000000, 99999999); ?>" method="post">
<fieldset style='padding-left: 5; width=50%'>
<legend><b> Группа </b></legend>
Тип похода:
<select name="type_gors" style="margin-left:7px;" id="type_gors">
<option value="0">Новичок</option>
<option value="1">Опытный</option>
<option value="2">Легендарный</option>
</select>
<br/>
Комментарий
<input type="text" name="text" maxlength="40" size="40"/>
<br/>
<input type="submit" name="add" value="Создать группу"/>
&nbsp;<br/>
</fieldset>
</form>
</td>
</tr>
</table>
<? } else { ?>
<? if ($zv['uid1'] == $user['id']) { ?>
<input type="button" onclick="location.href='lab_enter.php?startzv=1';" value="Начать поход">
<? } ?>
<input type="button" onclick="location.href='lab_enter.php?cancelzv=1';" value="Отозвать заявку">
<? } ?>
<? if ($re != '') {
echo '<br /><font color=red>' . $re . '</font>';
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +1,60 @@
<?php <?php
session_start();
session_start(); if (empty($_SESSION['uid'])) {
if (empty($_SESSION['uid'])) { header("Location: index.php");
header("Location: index.php"); exit;
exit;
} }
include "functions.php"; include "functions.php";
if ($user->room != 53) { header("Location: main.php"); exit; } if ($user->room != 53) {
if ($user->battle) { header('location: fbattle.php'); exit; } header("Location: main.php");
exit;
}
if ($user->battle) {
header('location: fbattle.php');
exit;
}
Template::header('Библиотека Просвещения');
?> ?>
<HTML><HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4>
<TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left> <TABLE border=0 width=600 cellspacing="0" cellpadding="0" align=left>
<tr><td><h3>Библиотека Просвещения</td></tr> <tr>
<td><h3>Библиотека Просвещения</td>
</tr>
<?php <?php
if($_GET['lib_room']=='hall' || !$_GET['lib_room']) if ($_GET['lib_room'] == 'hall' || !$_GET['lib_room']) {
{ echo '<tr><td>Вы стоите в холле Библиотеки. В застоявшемся воздухе висит многовековая пыль, плавно витающая между полками и сундуками с книгами.
echo('<tr><td>Вы стоите в холле Библиотеки. В застоявшемся воздухе висит многовековая пыль, плавно витающая между полками и сундуками с книгами. Потолки залов теряются в темноте, которую разгоняют лишь факелы на стенах.</td></tr>';
Потолки залов теряются в темноте, которую разгоняют лишь факелы на стенах.</td></tr>'); echo '<tr><td><br/>К Вам подходит один из Смотрителей. Он определенно стар, лицо скрыто под плащем, но его движения - быстрые и точные. </td></tr>';
echo('<tr><td><br/>К Вам подходит один из Смотрителей. Он определенно стар, лицо скрыто под плащем, но его движения - быстрые и точные. </td></tr>'); echo '<tr><td><br/><em>Смотритель</em>: <strong>"Какие услуги тебе понадобились?"</strong><hr/> </td></tr>';
echo('<tr><td><br/><em>Смотритель</em>: <strong>"Какие услуги тебе понадобились?"</strong><hr/> </td></tr>');
echo '<tr><td><br/><FORM action="library.php" method=GET> echo '<tr><td><br/><FORM action="library.php" method=GET>
<INPUT TYPE="hidden" name="lib_room" value="archive"> <INPUT TYPE="hidden" name="lib_room" value="archive">
<INPUT TYPE="submit" value="Архив"> <INPUT TYPE="submit" value="Архив">
<br/>Здесь ученые мужи трудятся над рашифровкой древних книг и свитков. Если Вам нужна информация про какие-либо книги или свитки, <br/>Здесь ученые мужи трудятся над рашифровкой древних книг и свитков. Если Вам нужна информация про какие-либо книги или свитки,
здесь Вам обязательно помогут. здесь Вам обязательно помогут.
</FORM></td></tr>'; </FORM></td></tr>';
echo '<tr><td><br/><FORM action="library.php" method=GET> echo '<tr><td><br/><FORM action="library.php" method=GET>
<INPUT TYPE="hidden" name="lib_room" value="magic_craft"> <INPUT TYPE="hidden" name="lib_room" value="magic_craft">
<INPUT TYPE="submit" value="Мастерская"> <INPUT TYPE="submit" value="Мастерская">
<br/>Оснащенная по последнему слову магии и техники лаборатория для опытов. Тут Вы можете создавать магические предметы.</FORM> <br/>Оснащенная по последнему слову магии и техники лаборатория для опытов. Тут Вы можете создавать магические предметы.</FORM>
</td></tr>'; </td></tr>';
echo('<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="kz"></FORM></td></tr>'); echo '<tr><td><FORM action="city.php" method=GET><INPUT TYPE="submit" value="Вернуться в Город" name="kz"></FORM></td></tr>';
//echo '<tr><td><FORM action="library.php" method=GET><INPUT TYPE="submit" value="Опознать вещи" name="ident_book"></FORM></td></tr>'; } elseif ($_GET['lib_room'] == 'archive') {
//echo '<tr><td><FORM action="library.php" method=GET><INPUT TYPE="submit" value="Купить свитки" name="ident_book"></FORM></td></tr>';
}
elseif($_GET['lib_room']=='archive')
{
//код опознавания страниц //код опознавания страниц
if($_POST['ident_pages']) if ($_POST['ident_pages']) {
{
//выбираем неопределенные страницы //выбираем неопределенные страницы
$pages=array(); $pages = [];
$pages_res=mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; "); $pages_res = mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; ");
while($page_res=mysql_fetch_array($pages_res)) while ($page_res = mysql_fetch_array($pages_res)) {
$pages[]=$page_res['id']; $pages[] = $page_res['id'];
$names=array(); }
$cred=0; $names = [];
foreach($pages as $p) $cred = 0;
{ foreach ($pages as $p) {
if(mt_rand(1,2)==1) if (mt_rand(1, 2) == 1) {
{ $page_num = 868 + mt_rand(0, 14);
$page_num=868+mt_rand(0,14);
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$page_num}' LIMIT 1;")); $dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$page_num}' LIMIT 1;"));
mysql_query("INSERT INTO `inventory` mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, (`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
@ -74,354 +63,359 @@ elseif($_GET['lib_room']=='archive')
) )
VALUES VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;"); ) ;");
$names[]=$dress['name']; $names[] = $dress['name'];
} else {
$cred += 1;
} }
else
$cred+=1;
mysql_query("DELETE FROM `inventory` WHERE `id` = '{$p}' LIMIT 1;"); mysql_query("DELETE FROM `inventory` WHERE `id` = '{$p}' LIMIT 1;");
} }
} }
//текст //текст
echo('<tr><td>Перед Вами длинный зал, заполненный людьми в серых робах. Некоторые внимательно изучают всевозможные вещи и книги, другие echo '<tr><td>Перед Вами длинный зал, заполненный людьми в серых робах. Некоторые внимательно изучают всевозможные вещи и книги, другие
в небольших группах что-то оживленно обсуждают. В углу помещения стоит каменная плита с неизвестными Вам символами.</td></tr>'); в небольших группах что-то оживленно обсуждают. В углу помещения стоит каменная плита с неизвестными Вам символами.</td></tr>';
if($_POST['ident_pages']) echo('<tr><td><br/>За столом слева от входа сгорбился Архивариус. Он не обращает на Вас никакого внимания.</td></tr>'); if ($_POST['ident_pages']) {
else echo('<tr><td><br/>За столом слева от входа сгорбился Архивариус. Он медленно поднимает голову и смотрим Вам прямо в глаза.</td></tr> echo '<tr><td><br/>За столом слева от входа сгорбился Архивариус. Он не обращает на Вас никакого внимания.</td></tr>';
<tr><td><br/><em>Архивариус</em>: <strong>"Предметы не определяем. Чеки не принимаем. С вопросами - к помощникам."</strong><hr/></td></tr>'); } else {
echo '<tr><td><br/>За столом слева от входа сгорбился Архивариус. Он медленно поднимает голову и смотрим Вам прямо в глаза.</td></tr>
<tr><td><br/><em>Архивариус</em>: <strong>"Предметы не определяем. Чеки не принимаем. С вопросами - к помощникам."</strong><hr/></td></tr>';
}
//выбираем неопределенные страницы //выбираем неопределенные страницы
$pages=array(); $pages = [];
$pages_res=mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; "); $pages_res = mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; ");
while($page_res=mysql_fetch_array($pages_res)) while ($page_res = mysql_fetch_array($pages_res)) {
$pages[]=$page_res['id']; $pages[] = $page_res['id'];
}
//обмен страниц //обмен страниц
if($pages) if ($pages) {
echo('<tr><td>Здесь Вам помогут опознать найденные Вами страницы echo '<tr><td>Здесь Вам помогут опознать найденные Вами страницы}
<FORM action="'.$_SERVER['REQUEST_URI'].'" method=POST>(<strong>'.count($pages).'</strong>) шт. - <INPUT TYPE="submit" value="Опознать" name="ident_pages"> <FORM action="' . $_SERVER['REQUEST_URI'] . '" method=POST>(<strong>' . count($pages) . '</strong>) шт. - <INPUT TYPE="submit" value="Опознать" name="ident_pages">
</FORM></td></tr>'); </FORM></td></tr>';
else echo('<tr><td>У Вас нету страниц, нуждающихся в идентификации.</td></tr>'); else {
//money echo '<tr><td>У Вас нету страниц, нуждающихся в идентификации.</td></tr>';
if($cred)
{
mysql_query("UPDATE `users` SET `money`=money+{$cred} where `id`='{$user['id']}';");
echo('<tr><td><br/>Вы отдали ненужные страницы в Архив <strong>(+'.$cred.')кр.</strong></td></tr>');
}
//ident
if($names) foreach($names as $n)
{
echo('<tr><td><br/>Вы получили <strong>'.$n.'</strong></td></tr>');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$user['id']}','\"".$user['login']."\" получил в Библиотеке ".$n." кр. ',1,'".time()."');");
}
//меняем страницы на книгу
if($_POST['get_book'])
{
$pages=array();
$got_all_1=1;
for($pn=868;$pn<=882;$pn++)
{
$pc_r=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; "));
if($pc_r) $pages[]=$pc_r['id'];
else $got_all_1=0;
} }
if($got_all_1) { //money
foreach($pages as $p) if ($cred) {
mysql_query("DELETE FROM `inventory` WHERE `id` = '{$p}' LIMIT 1;"); mysql_query("UPDATE `users` SET `money`=money+{$cred} where `id`='{$user['id']}';");
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '866' LIMIT 1;")); echo '<tr><td><br/>Вы отдали ненужные страницы в Архив <strong>(+' . $cred . ')кр.</strong></td></tr>';
mysql_query("INSERT INTO `inventory` }
//ident
if ($names) {
foreach ($names as $n) {
echo('<tr><td><br/>Вы получили <strong>' . $n . '</strong></td></tr>');
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$user['id']}','\"" . $user['login'] . "\" получил в Библиотеке " . $n . " кр. ',1,'" . time() . "');");
}
}
//меняем страницы на книгу
if ($_POST['get_book']) {
$pages = [];
$got_all_1 = 1;
for ($pn = 868; $pn <= 882; $pn++) {
$pc_r = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; "));
if ($pc_r) {
$pages[] = $pc_r['id'];
} else {
$got_all_1 = 0;
}
}
if ($got_all_1) {
foreach ($pages as $p) {
mysql_query("DELETE FROM `inventory` WHERE `id` = '{$p}' LIMIT 1;");
}
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '866' LIMIT 1;"));
mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, (`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`, `gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,
`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration` `mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration`
) )
VALUES VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;"); ) ;");
addchp ('У Вас есть все необходимые страницы. Сложив их в нужном порядке, Вы получаете <strong>Книгу Комментатора [1]','{[]}'.Nick::id($user['id'])->short().'{[]}'); addchp('У Вас есть все необходимые страницы. Сложив их в нужном порядке, Вы получаете <strong>Книгу Комментатора [1]', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
}
}
//есть страницы
$pagesn=array();
for($pn=868;$pn<=882;$pn++)//книга 1
{
$pc_r=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; "));
if($pc_r) $pagesn[$pn]=1;
else $pagesn[$pn]=0;
}
echo('<tr><td><br/>Найденные страницы:</td></tr>');
echo('<tr><td><strong>Книга Комментатора [1]</strong>:</td></tr>');
echo('<tr><td>');
foreach($pagesn as $p)
{
$c++;
if($p>0) echo ("<b>".$c."</b> ");
else echo("<font color=#777777>".$c."</font> ");
}
$got_all_1=1;
for($pn=868;$pn<=882;$pn++)
{
$pc_r=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; "));
if($pc_r) $pages[]=$pc_r;
else $got_all_1=0;
}
if($got_all_1)
echo('</td></tr><tr><td><FORM action="'.$_SERVER['REQUEST_URI'].'" method=POST><INPUT TYPE="submit" value="Собрать книгу" name="get_book">
</FORM></td></tr>');
else
echo("<tr><td><em>Не хватает страниц</em></td></tr>");
echo('<tr><td><FORM action="library.php" method=POST><INPUT TYPE="submit" value="Вернуться в Холл"></FORM></td></tr>');
}
elseif($_GET['lib_room']='magic_craft')
{
/*books=array();
$pages_res=mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='867' AND `dressed`='0'; ");
while($page_res=mysql_fetch_array($pages_res))*/
$res=array();
$del=array();
$book_1=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='866' LIMIT 1; "));
//делаем крафт
if($_POST['craft_1']) {
$craft_err=0;
//считаем книжку
if(!$book_1) $craft_err=1;
//считаем ингридиенты
$ing=mysql_fetch_array(mysql_query("SELECT `ingred` FROM `recipes` WHERE `id`='{$_POST['magic_id']}' LIMIT 1;"));
$need_1=unserialize($ing['ingred']);
//считаем кол-во ингридиентов
foreach($need_1 as $k=>$n) {
$res_r=mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ");
$i=0;
while($res_id=mysql_fetch_array($res_r))
if($i<$n)
{
if($res_id['id']) $del[]=$res_id['id'];
else
$craft_err=1;
$i++;
} }
}
//ингридиентов хватает }
if(!$craft_err) { //есть страницы
foreach($del as $d) $pagesn = [];
mysql_query("DELETE FROM `inventory` WHERE `id`='{$d}';"); for ($pn = 868; $pn <= 882; $pn++)//книга 1
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$_POST['magic_id']}' LIMIT 1;")); {
mysql_query("INSERT INTO `inventory` $pc_r = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; "));
if ($pc_r) {
$pagesn[$pn] = 1;
} else {
$pagesn[$pn] = 0;
}
}
echo '<tr><td><br/>Найденные страницы:</td></tr>';
echo '<tr><td><strong>Книга Комментатора [1]</strong>:</td></tr>';
echo '<tr><td>';
foreach ($pagesn as $p) {
$c++;
if ($p > 0) {
echo "<b>" . $c . "</b> ";
} else {
echo "<font color=#777777>" . $c . "</font> ";
}
}
$got_all_1 = 1;
for ($pn = 868; $pn <= 882; $pn++) {
$pc_r = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$pn}' LIMIT 1; "));
if ($pc_r) {
$pages[] = $pc_r;
} else {
$got_all_1 = 0;
}
}
if ($got_all_1) {
echo '</td></tr><tr><td><FORM action="' . $_SERVER['REQUEST_URI'] . '" method=POST><INPUT TYPE="submit" value="Собрать книгу" name="get_book">
</FORM></td></tr>';
} else {
echo "<tr><td><em>Не хватает страниц</em></td></tr>";
}
echo '<tr><td><FORM action="library.php" method=POST><INPUT TYPE="submit" value="Вернуться в Холл"></FORM></td></tr>';
} elseif ($_GET['lib_room'] = 'magic_craft') {
$res = [];
$del = [];
$book_1 = mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='866' LIMIT 1; "));
//делаем крафт
if ($_POST['craft_1']) {
$craft_err = 0;
//считаем книжку
if (!$book_1) {
$craft_err = 1;
}
//считаем ингридиенты
$ing = mysql_fetch_array(mysql_query("SELECT `ingred` FROM `recipes` WHERE `id`='{$_POST['magic_id']}' LIMIT 1;"));
$need_1 = unserialize($ing['ingred']);
//считаем кол-во ингридиентов
foreach ($need_1 as $k => $n) {
$res_r = mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; ");
$i = 0;
while ($res_id = mysql_fetch_array($res_r)) {
if ($i < $n) {
if ($res_id['id']) $del[] = $res_id['id'];
else
$craft_err = 1;
$i++;
}
}
}
//ингридиентов хватает
if (!$craft_err) {
foreach ($del as $d) {
mysql_query("DELETE FROM `inventory` WHERE `id`='{$d}';");
}
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `shop` WHERE `id` = '{$_POST['magic_id']}' LIMIT 1;"));
mysql_query("INSERT INTO `inventory`
(`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`, (`prototype`,`owner`,`name`,`type`,`massa`,`cost`,`img`,`maxdur`,`isrep`,
`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`, `gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,
`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration` `mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`duration`
) )
VALUES VALUES
('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}', ('{$dress['id']}','{$user[id]}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}',
'{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0' '{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron3']}','{$dress['bron2']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','" . (($dress['goden']) ? ($dress['goden'] * 24 * 60 * 60 + time()) : "") . "','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','0'
) ;"); ) ;");
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`)
VALUES ('','0','{$user['id']}','\"".$user['login']."\" создал свиток ".$dress['name']." ',1,'".time()."');"); VALUES ('','0','{$user['id']}','\"" . $user['login'] . "\" создал свиток " . $dress['name'] . " ',1,'" . time() . "');");
addchp ('Вы успешно создали свиток <strong>'.$dress['name'].'</strong>!','{[]}'.Nick::id($user['id'])->short().'{[]}'); addchp('Вы успешно создали свиток <strong>' . $dress['name'] . '</strong>!', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
}
} }
} echo '<tr><td>Вы стоите в небольшой комнате, от пола до потолка забтиой банками, пробирками, ингредиентами и прочими полезными вещами.
Здесь Вы можете собрать предметы по имеющимся у Вас рецептам.<br/><br/><IMG align=left alt="Знак зодиака" height=99 src="i/';
//$book1=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='--book 2--'; "));
//$book1=mysql_fetch_array(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='--book 3--'; "));
echo('<tr><td>Вы стоите в небольшой комнате, от пола до потолка забтиой банками, пробирками, ингредиентами и прочими полезными вещами.
Здесь Вы можете собрать предметы по имеющимся у Вас рецептам.<br/><br/><IMG align=left alt="Знак зодиака" height=99 src="i/');
//выводим знак зодиака //выводим знак зодиака
echo star_sign(substr($user['borndate'],3,2), substr($user['borndate'],0,2)); echo star_sign(substr($user['borndate'], 3, 2), substr($user['borndate'], 0, 2));
echo('.gif" width=100>'); echo '.gif" width=100>';
//выводим инфо по стихиям //выводим инфо по стихиям
echo('Ваша стихия:'); echo 'Ваша стихия:';
$el=element(star_sign(substr($user['borndate'],3,2), substr($user['borndate'],0,2))); $el = element(star_sign(substr($user['borndate'], 3, 2), substr($user['borndate'], 0, 2)));
switch($el) switch ($el) {
{ case 'a':
case 'a': echo("<strong><font color=#0198ef><ins>Воздух</ins></font></strong>"); break; echo "<strong><font color=#0198ef><ins>Воздух</ins></font></strong>";
case 'w': echo("<strong><font color=#0d2b99><ins>Вода</ins></font></strong>"); break; break;
case 'f': echo("<strong><font color=#df0d0d><ins>Огонь</ins></font></strong>"); break; case 'w':
case 'e': echo("<strong><font color=#086604><ins>Земля</ins></font></strong>"); break; echo "<strong><font color=#0d2b99><ins>Вода</ins></font></strong>";
} break;
echo("<br/>Эффективность магии:"); case 'f':
foreach(Config::$elem_align as $k=>$ea) echo "<strong><font color=#df0d0d><ins>Огонь</ins></font></strong>";
{ break;
switch($k) case 'e':
{ echo "<strong><font color=#086604><ins>Земля</ins></font></strong>";
case 'a': echo("<br/><font color=#0198ef>Воздух</font>"); break; break;
case 'w': echo("<br/><font color=#0d2b99>Вода</font>"); break;
case 'f': echo("<br/><font color=#df0d0d>Огонь</font>"); break;
case 'e': echo("<br/><font color=#086604>Земля</font>"); break;
}
switch($ea[$el])
{
case '0': echo(" : <font color=gray>".($ea[$el]*100)."%</font>"); break;
case '0.5': echo(" : ".($ea[$el]*100)."%"); break;
case '1': echo(" : <b>".($ea[$el]*100)."%</b>"); break;
}
}
echo('</td></tr>');
if($craft_err) echo("<tr><td><font color=red>Недостаточно ингредиентов!</font></td></tr>");
if($book_1) {
echo('<tr><td><hr/>Рецепты: <strong>Книга Комментатора [1]</strong></td></tr>');
//ОГОНЬ
echo('<tr><td><br/><strong><font color=#df0d0d>Магия Огня</font></strong><br/><br/></td></tr>');
//выбираем всю магию стихии
$all_fire_raw=mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='F';");
while($all_fire=mysql_fetch_array($all_fire_raw))
{
$spell_info=mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_fire['id']}' LIMIT 1;"));
//необходимые ингридиенты
$ing=unserialize($all_fire['ingred']);
foreach($ing as $k=>$n) {
$txt_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;"));
$count_k=mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "));
if($count_k<$n)
{
$ingred.=$txt_k['name']." (<font color=red>".$count_k."/".$n."</font>)<br/>";
$ing_error=1;
}
else
$ingred.=$txt_k['name']." (<b>".$count_k."/".$n."</b>)<br/>";
}
echo('<tr><td><FORM action="'.$_SERVER['REQUEST_URI'].'" method=POST><b><img src="i/magic/'.$spell_info['img'].'">'.
$spell_info['name'].'</b><INPUT TYPE="hidden" name="magic_id" value="'.$all_fire['id'].'"><br/><ins>Ингредиенты</ins>:<br/>'.
$ingred);
unset ($ing);
unset($ingred);
if(!$ing_error) echo('<INPUT TYPE="submit" value="Создать" name="craft_1">'); else echo("<font color=red><i>Недостаточно ингридиентов</i></font>");
echo('</FORM></td></tr>');
}
//ЗЕМЛЯ
echo('<tr><td><br/><strong><font color=#086604>Магия Земли</font></strong><br/><br/></td></tr>');
//выбираем всю магию стихии
$all_earth_raw=mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='E';");
while($all_earth=mysql_fetch_array($all_earth_raw))
{
$spell_info=mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_earth['id']}' LIMIT 1;"));
//необходимые ингридиенты
$ing=unserialize($all_earth['ingred']);
foreach($ing as $k=>$n) {
$txt_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;"));
$count_k=mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "));
if($count_k<$n)
{
$ingred.=$txt_k['name']." (<font color=red>".$count_k."/".$n."</font>)<br/>";
$ing_error=1;
}
else
$ingred.=$txt_k['name']." (<b>".$count_k."/".$n."</b>)<br/>";
}
echo('<tr><td><FORM action="'.$_SERVER['REQUEST_URI'].'" method=POST><b><img src="i/magic/'.$spell_info['img'].'">'.
$spell_info['name'].'</b><INPUT TYPE="hidden" name="magic_id" value="'.$all_earth['id'].'"><br/><ins>Ингредиенты</ins>:<br/>'.
$ingred);
unset ($ing);
unset($ingred);
if(!$ing_error) echo('<INPUT TYPE="submit" value="Создать" name="craft_1">'); else echo("<font color=red><i>Недостаточно ингридиентов</i></font>");
echo('</FORM></td></tr>');
}
//ВОЗДУХ
echo('<tr><td><br/><strong><font color=#0198ef>Магия Воздуха</font></strong><br/><br/></td></tr>');
//выбираем всю магию стихии
$all_air_raw=mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='A';");
while($all_air=mysql_fetch_array($all_air_raw))
{
$spell_info=mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_air['id']}' LIMIT 1;"));
//необходимые ингридиенты
$ing=unserialize($all_air['ingred']);
foreach($ing as $k=>$n) {
$txt_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;"));
$count_k=mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "));
if($count_k<$n)
{
$ingred.=$txt_k['name']." (<font color=red>".$count_k."/".$n."</font>)<br/>";
$ing_error=1;
}
else
$ingred.=$txt_k['name']." (<b>".$count_k."/".$n."</b>)<br/>";
}
echo('<tr><td><FORM action="'.$_SERVER['REQUEST_URI'].'" method=POST><b><img src="i/magic/'.$spell_info['img'].'">'.
$spell_info['name'].'</b><INPUT TYPE="hidden" name="magic_id" value="'.$all_air['id'].'"><br/><ins>Ингредиенты</ins>:<br/>'.
$ingred);
unset ($ing);
unset($ingred);
if(!$ing_error) echo('<INPUT TYPE="submit" value="Создать" name="craft_1">'); else echo("<font color=red><i>Недостаточно ингридиентов</i></font>");
echo('</FORM></td></tr>');
}
//ВОДА
echo('<tr><td><br/><strong><font color=#0d2b99>Магия Воды</font></strong><br/><br/></td></tr>');
//выбираем всю магию стихии
$all_fire_raw=mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='W';");
while($all_fire=mysql_fetch_array($all_fire_raw))
{
$spell_info=mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_fire['id']}' LIMIT 1;"));
//необходимые ингридиенты
$ing=unserialize($all_fire['ingred']);
foreach($ing as $k=>$n) {
$txt_k=mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;"));
$count_k=mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "));
if($count_k<$n)
{
$ingred.=$txt_k['name']." (<font color=red>".$count_k."/".$n."</font>)<br/>";
$ing_error=1;
}
else
$ingred.=$txt_k['name']." (<b>".$count_k."/".$n."</b>)<br/>";
}
echo('<tr><td><FORM action="'.$_SERVER['REQUEST_URI'].'" method=POST><b><img src="i/magic/'.$spell_info['img'].'">'.
$spell_info['name'].'</b><INPUT TYPE="hidden" name="magic_id" value="'.$all_fire['id'].'"><br/><ins>Ингредиенты</ins>:<br/>'.
$ingred);
unset ($ing);
unset($ingred);
if(!$ing_error) echo('<INPUT TYPE="submit" value="Создать" name="craft_1">'); else echo("<font color=red><i>Недостаточно ингридиентов</i></font>");
echo('</FORM></td></tr>');
}
} }
// if($book2) echo "<br/>Эффективность магии:";
// { foreach (Config::$elem_align as $k => $ea) {
// switch ($k) {
// } case 'a':
// if($book3) echo "<br/><font color=#0198ef>Воздух</font>";
// { break;
// case 'w':
// } echo "<br/><font color=#0d2b99>Вода</font>";
break;
case 'f':
echo "<br/><font color=#df0d0d>Огонь</font>";
break;
case 'e':
echo "<br/><font color=#086604>Земля</font>";
break;
}
switch ($ea[$el]) {
case '0':
echo " : <font color=gray>" . ($ea[$el] * 100) . "%</font>";
break;
case '0.5':
echo " : " . ($ea[$el] * 100) . "%";
break;
case '1':
echo " : <b>" . ($ea[$el] * 100) . "%</b>";
break;
}
}
echo '</td></tr>';
if ($craft_err) {
echo "<tr><td><font color=red>Недостаточно ингредиентов!</font></td></tr>";
}
if ($book_1) {
echo '<tr><td><hr/>Рецепты: <strong>Книга Комментатора [1]</strong></td></tr>';
//ОГОНЬ
echo '<tr><td><br/><strong><font color=#df0d0d>Магия Огня</font></strong><br/><br/></td></tr>';
//выбираем всю магию стихии
$all_fire_raw = mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='F';");
while ($all_fire = mysql_fetch_array($all_fire_raw)) {
$spell_info = mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_fire['id']}' LIMIT 1;"));
//необходимые ингридиенты
$ing = unserialize($all_fire['ingred']);
foreach ($ing as $k => $n) {
$txt_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;"));
$count_k = mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "));
if ($count_k < $n) {
$ingred .= $txt_k['name'] . " (<font color=red>" . $count_k . "/" . $n . "</font>)<br/>";
$ing_error = 1;
} else {
$ingred .= $txt_k['name'] . " (<b>" . $count_k . "/" . $n . "</b>)<br/>";
}
}
echo '<tr><td><FORM action="' . $_SERVER['REQUEST_URI'] . '" method=POST><b><img src="i/magic/' . $spell_info['img'] . '">' .
$spell_info['name'] . '</b><INPUT TYPE="hidden" name="magic_id" value="' . $all_fire['id'] . '"><br/><ins>Ингредиенты</ins>:<br/>' .
echo('<tr><td><br/><FORM action="library.php" method=POST><INPUT TYPE="submit" value="Вернуться в Холл"></FORM></td></tr>'); $ingred;
unset ($ing);
} unset($ingred);
if (empty($ing_error)) {
echo '<INPUT TYPE="submit" value="Создать" name="craft_1">';
} else {
echo "<font color=red><i>Недостаточно ингридиентов</i></font>";
}
echo '</FORM></td></tr>';
}
?> //ЗЕМЛЯ
echo '<tr><td><br/><strong><font color=#086604>Магия Земли</font></strong><br/><br/></td></tr>';
//выбираем всю магию стихии
$all_earth_raw = mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='E';");
while ($all_earth = mysql_fetch_array($all_earth_raw)) {
$spell_info = mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_earth['id']}' LIMIT 1;"));
//необходимые ингридиенты
$ing = unserialize($all_earth['ingred']);
foreach ($ing as $k => $n) {
$txt_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;"));
$count_k = mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "));
if ($count_k < $n) {
$ingred .= $txt_k['name'] . " (<font color=red>" . $count_k . "/" . $n . "</font>)<br/>";
$ing_error = 1;
} else {
$ingred .= $txt_k['name'] . " (<b>" . $count_k . "/" . $n . "</b>)<br/>";
}
}
echo '<tr><td><FORM action="' . $_SERVER['REQUEST_URI'] . '" method=POST><b><img src="i/magic/' . $spell_info['img'] . '">' .
$spell_info['name'] . '</b><INPUT TYPE="hidden" name="magic_id" value="' . $all_earth['id'] . '"><br/><ins>Ингредиенты</ins>:<br/>' .
$ingred;
unset ($ing);
unset($ingred);
if (!$ing_error) {
echo '<INPUT TYPE="submit" value="Создать" name="craft_1">';
} else {
echo "<font color=red><i>Недостаточно ингридиентов</i></font>";
}
echo '</FORM></td></tr>';
}
//ВОЗДУХ
echo '<tr><td><br/><strong><font color=#0198ef>Магия Воздуха</font></strong><br/><br/></td></tr>';
//выбираем всю магию стихии
$all_air_raw = mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='A';");
while ($all_air = mysql_fetch_array($all_air_raw)) {
$spell_info = mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_air['id']}' LIMIT 1;"));
//необходимые ингридиенты
$ing = unserialize($all_air['ingred']);
foreach ($ing as $k => $n) {
$txt_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;"));
$count_k = mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "));
if ($count_k < $n) {
$ingred .= $txt_k['name'] . " (<font color=red>" . $count_k . "/" . $n . "</font>)<br/>";
$ing_error = 1;
} else {
$ingred .= $txt_k['name'] . " (<b>" . $count_k . "/" . $n . "</b>)<br/>";
}
}
echo '<tr><td><FORM action="' . $_SERVER['REQUEST_URI'] . '" method=POST><b><img src="i/magic/' . $spell_info['img'] . '">' .
$spell_info['name'] . '</b><INPUT TYPE="hidden" name="magic_id" value="' . $all_air['id'] . '"><br/><ins>Ингредиенты</ins>:<br/>' .
$ingred;
unset ($ing);
unset($ingred);
if (empty($ing_error)) {
echo '<INPUT TYPE="submit" value="Создать" name="craft_1">';
} else {
echo "<font color=red><i>Недостаточно ингридиентов</i></font>";
}
echo '</FORM></td></tr>';
}
//ВОДА
echo '<tr><td><br/><strong><font color=#0d2b99>Магия Воды</font></strong><br/><br/></td></tr>';
//выбираем всю магию стихии
$all_fire_raw = mysql_query("SELECT * FROM `recipes` WHERE `level`='1' AND `elem`='W';");
while ($all_fire = mysql_fetch_array($all_fire_raw)) {
$spell_info = mysql_fetch_array(mysql_query("SELECT `name`,`img` FROM `shop` WHERE `id`='{$all_fire['id']}' LIMIT 1;"));
//необходимые ингридиенты
$ing = unserialize($all_fire['ingred']);
foreach ($ing as $k => $n) {
$txt_k = mysql_fetch_array(mysql_query("SELECT `name` FROM `shop` WHERE `id`='{$k}' LIMIT 1;"));
$count_k = mysql_num_rows(mysql_query("SELECT `id` FROM `inventory` WHERE `owner`='{$user['id']}' AND `prototype`='{$k}'; "));
if ($count_k < $n) {
$ingred .= $txt_k['name'] . " (<font color=red>" . $count_k . "/" . $n . "</font>)<br/>";
$ing_error = 1;
} else {
$ingred .= $txt_k['name'] . " (<b>" . $count_k . "/" . $n . "</b>)<br/>";
}
}
echo '<tr><td><FORM action="' . $_SERVER['REQUEST_URI'] . '" method=POST><b><img src="i/magic/' . $spell_info['img'] . '">' .
$spell_info['name'] . '</b><INPUT TYPE="hidden" name="magic_id" value="' . $all_fire['id'] . '"><br/><ins>Ингредиенты</ins>:<br/>' .
$ingred;
unset ($ing);
unset($ingred);
if (empty($ing_error)) {
echo '<INPUT TYPE="submit" value="Создать" name="craft_1">';
} else {
echo "<font color=red><i>Недостаточно ингридиентов</i></font>";
}
echo '</FORM></td></tr>';
}
}
echo '<tr><td><br/><FORM action="library.php" method=POST><INPUT TYPE="submit" value="Вернуться в Холл"></FORM></td></tr>';
}
?>
</table> </table>
<?php <?php
if($_GET['lib_room']=='hall' || !$_GET['lib_room']) if ($_GET['lib_room'] == 'hall' || !$_GET['lib_room'])
$the_room='library'; $the_room = 'library';
elseif($_GET['lib_room']=='archive') elseif ($_GET['lib_room'] == 'archive')
$the_room='archive'; $the_room = 'archive';
elseif($_GET['lib_room']='magic_craft') elseif ($_GET['lib_room'] = 'magic_craft')
$the_room='magic_craft'; $the_room = 'magic_craft';
echo('<div align=right><img width="260" src="i/library/'.$the_room.'.jpg" /></div>'); echo('<div align=right><img width="260" src="i/library/' . $the_room . '.jpg" /></div>');
?>
</BODY>
</HTML>

257
logs.php
View File

@ -1,140 +1,125 @@
<? <?php
$_GET['page'] = (int)$_GET['page']; $_GET['page'] = $_GET['page'] ?? 0;
$_REQUEST['log'] = (int)$_REQUEST['log']; $_REQUEST['log'] = $_REQUEST['log'] ?? 0;
?>
<HTML>
<HEAD>
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META Http-Equiv=Expires Content=0>
<title>Бойцовский Клуб Возрождение : Лог боя #<?=$_REQUEST['log'];?></title>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=e2e0e0>
<H3>Лог поединка</H3>
<FORM METHOD=GET ACTION="logs.php">
<INPUT TYPE=hidden name=page value="<?=$_GET['page']?>">
<INPUT TYPE=hidden name=log value="<?=$_REQUEST['log']?>">
<?
require_once "functions.php"; require_once "functions.php";
$data = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `id` = '" . $_REQUEST['log'] . "'"));
$data = mysql_fetch_array(mysql_query ("SELECT * FROM `battle` WHERE `id` = '".$_REQUEST['log']."' LIMIT 1")); $log = file("backup/logs/battle" . $_REQUEST['log'] . ".txt");
$log = file("backup/logs/battle".$_REQUEST['log'].".txt"); Template::header('Лог поединка');
if($_GET['stat'] != '1') {
echo "<form method=get><input type=hidden name='log' value='".(int)$_GET['log']."'><input type=hidden name='stat' value='1'><input type=submit value='Статистика боя'></form>";
if ($data['type'] == 10) {
$rr = "<IMG SRC=\"i/fighttype6.gif\" WIDTH=20 HEIGHT=20 ALT=\"Кровавый поединок\"> (поединок в башне смерти)";
} elseif($data['blood'] && ($data['type'] == 5 || $data['type'] == 4)) {
$rr = "<IMG SRC=\"i/fighttype5.gif\" WIDTH=20 HEIGHT=20 ALT=\"кулачный бой\"><IMG SRC=\"i/fighttype6.gif\" WIDTH=20 HEIGHT=20 ALT=\"Кровавый поединок\"> (кровавый кулачный поединок)";
} elseif($data['blood'] && ($data['type'] == 2 || $data['type'] == 3 || $data['type'] == 6)) {
$rr = "<IMG SRC=\"i/fighttype6.gif\" WIDTH=20 HEIGHT=20 ALT=\"Кровавый поединок\"> (кровавый поединок)";
} elseif($data['type'] == 5 || $data['type'] == 4) {
$rr = "<IMG SRC=\"i/fighttype4.gif\" WIDTH=20 HEIGHT=20 ALT=\"кулачный бой\"> (кулачный поединок)";
} elseif($data['type'] == 3 || $data['type'] == 2) {
$rr = "<IMG SRC=\"i/fighttype3.gif\" WIDTH=20 HEIGHT=20 ALT=\"групповой бой\"> (групповой поединок)";
} elseif($data['type'] == 1) {
$rr = "<IMG SRC=\"i/fighttype1.gif\" WIDTH=20 HEIGHT=20 ALT=\"физический бой\"> (физический поединок)";
}
$t1 = explode(";", $data['t1']);
$t2 = explode(";", $data['t2']);
if($data['win'] == 3) {
$battle = unserialize($data['teams']);
foreach($t1 as $k => $v) {
if(in_array($v, array_keys($battle))) {
++$i;
if($i > 1) { $cc = ', '; } else { $cc = ''; }
$ffs .= $cc.Nick::id($v)->battleShort('B1');
}
}
$i = 0;
$ffs .= ' <i>против</i> ';
foreach ($t2 as $k => $v) {
if(in_array($v, array_keys($battle))) {
++$i;
if($i > 1) { $cc = ', '; } else { $cc = ''; }
$ffs .= $cc.Nick::id($v)->battleShort('B1');
}
}
$i = 0;
}
$countall = count($t1)+count($t2);
if($countall > 70) {
echo "<h3>Эпическая битва!</h3>";
} elseif($countall > 50) {
echo "<h3>Эпохальная битва!</h3>";
} elseif($countall > 30) {
echo "<h3>Великая битва!</h3>";
}
echo "<form method=\"GET\" action=\"logs.php\"><input type=\"hidden\" name=\"page\" value=\"".$_GET['page']."\" /><input type=\"hidden\" name=\"log\" value=\"".$_REQUEST['log']."\" /><input type=\"submit\" name=\"analiz2\" value=\"Обновить\" /> </form>Тип боя: ";
echo $rr;
?> ?>
&nbsp; <H3>Лог поединка</H3>
Страницы: <FORM>
<? <INPUT TYPE=hidden name=page value="<?= $_GET['page'] ?>">
$log = explode("<BR>", $log[0]); <INPUT TYPE=hidden name=log value="<?= $_REQUEST['log'] ?>">
$all = count($log)-1; <?php
$pgs = $all/50; if ($_GET['stat'] != '1') {
for ($i=0;$i<=$pgs;++$i) { echo "<form><input type=hidden name='log' value='" . (int)$_GET['log'] . "'><input type=hidden name='stat' value='1'><input type=submit value='Статистика боя'></form>";
if ($_GET['page']==$i) {
echo ' <a href="?log=',$_GET['log'],'&page=',$i,'"><font color=#8f0000>',($i+1),'</font></a> ';
}
else {
echo ' <a href="?log=',$_GET['log'],'&page=',$i,'">',($i+1),'</a> ';
}
}
//print_r($log);
?><HR><?
$start = 50*$_GET['page'];
if(50*$_GET['page']+50 <= $all) {
$stop = 50*$_GET['page']+50;
} else {
$stop = 50*$_GET['page']+($all-50*$_GET['page'])-1;
}
//echo $stop;
for($i=$start;$i<=$stop;$i++) {
echo $log[$i]."<BR>";
}
?>
<HR>
<?
echo "<center>".$ffs."</center><HR>";
?>
<FORM METHOD=GET ACTION="logs.php">
<INPUT TYPE=hidden name=page value="<?=$_GET['page']?>" />
<INPUT TYPE=hidden name=log value="<?=$_REQUEST['log']?>" />
<INPUT TYPE=submit name=analiz2 value="Обновить"> if ($data['type'] == 10) {
</form> $rr = "<IMG SRC=\"i/fighttype6.gif\" WIDTH=20 HEIGHT=20 ALT=\"Кровавый поединок\"> (поединок в башне смерти)";
&nbsp; } elseif ($data['blood'] && ($data['type'] == 5 || $data['type'] == 4)) {
Страницы: $rr = "<IMG SRC=\"i/fighttype5.gif\" WIDTH=20 HEIGHT=20 ALT=\"кулачный бой\"><IMG SRC=\"i/fighttype6.gif\" WIDTH=20 HEIGHT=20 ALT=\"Кровавый поединок\"> (кровавый кулачный поединок)";
<? } elseif ($data['blood'] && ($data['type'] == 2 || $data['type'] == 3 || $data['type'] == 6)) {
for ($i=0;$i<=$pgs;++$i) { $rr = "<IMG SRC=\"i/fighttype6.gif\" WIDTH=20 HEIGHT=20 ALT=\"Кровавый поединок\"> (кровавый поединок)";
if ($_GET['page']==$i) { } elseif ($data['type'] == 5 || $data['type'] == 4) {
echo ' <a href="?log=',$_GET['log'],'&page=',$i,'"><font color=#8f0000>',($i+1),'</font></a> '; $rr = "<IMG SRC=\"i/fighttype4.gif\" WIDTH=20 HEIGHT=20 ALT=\"кулачный бой\"> (кулачный поединок)";
} } elseif ($data['type'] == 3 || $data['type'] == 2) {
else { $rr = "<IMG SRC=\"i/fighttype3.gif\" WIDTH=20 HEIGHT=20 ALT=\"групповой бой\"> (групповой поединок)";
echo ' <a href="?log=',$_GET['log'],'&page=',$i,'">',($i+1),'</a> '; } elseif ($data['type'] == 1) {
} $rr = "<IMG SRC=\"i/fighttype1.gif\" WIDTH=20 HEIGHT=20 ALT=\"физический бой\"> (физический поединок)";
} }
echo "<br><br><form method=get><input type=hidden name='log' value='".(int)$_GET['log']."'><input type=hidden name='stat' value='1'><input type=submit value='Статистика боя'></form>";
}
else { echo "<form method=get><input type=hidden name='log' value='".(int)$_GET['log']."'><input type=submit value='Лог боя'></form>";
echo "Статистика временно недоступна ...<br />";
#include('stat_battle.php');
echo "<br><form method=get><input type=hidden name='log' value='".(int)$_GET['log']."'><input type=submit value='Лог боя'></form>";
}
?>
</FORM> $t1 = explode(";", $data['t1']);
</BODY> $t2 = explode(";", $data['t2']);
</HTML>
if ($data['win'] == 3) {
$battle = unserialize($data['teams']);
foreach ($t1 as $k => $v) {
if (in_array($v, array_keys($battle))) {
++$i;
if ($i > 1) {
$cc = ', ';
} else {
$cc = '';
}
$ffs .= $cc . Nick::id($v)->battleShort('B1');
}
}
$i = 0;
$ffs .= ' <i>против</i> ';
foreach ($t2 as $k => $v) {
if (in_array($v, array_keys($battle))) {
++$i;
if ($i > 1) {
$cc = ', ';
} else {
$cc = '';
}
$ffs .= $cc . Nick::id($v)->battleShort('B1');
}
}
$i = 0;
}
$countall = count($t1) + count($t2);
if ($countall > 70) {
echo "<h3>Эпическая битва!</h3>";
} elseif ($countall > 50) {
echo "<h3>Эпохальная битва!</h3>";
} elseif ($countall > 30) {
echo "<h3>Великая битва!</h3>";
}
echo "<form method=\"GET\" action=\"logs.php\"><input type=\"hidden\" name=\"page\" value=\"" . $_GET['page'] . "\" /><input type=\"hidden\" name=\"log\" value=\"" . $_REQUEST['log'] . "\" /><input type=\"submit\" name=\"analiz2\" value=\"Обновить\" /> </form>Тип боя: ";
echo $rr;
echo 'Страницы:';
$log = explode("<BR>", $log[0]);
$all = count($log) - 1;
$pgs = $all / 50;
for ($i = 0; $i <= $pgs; ++$i) {
if ($_GET['page'] == $i) {
echo ' <a href="?log=', $_GET['log'], '&page=', $i, '"><font color=#8f0000>', ($i + 1), '</font></a> ';
} else {
echo ' <a href="?log=', $_GET['log'], '&page=', $i, '">', ($i + 1), '</a> ';
}
}
echo '<hr>';
$start = 50 * $_GET['page'];
if (50 * $_GET['page'] + 50 <= $all) {
$stop = 50 * $_GET['page'] + 50;
} else {
$stop = 50 * $_GET['page'] + ($all - 50 * $_GET['page']) - 1;
}
for ($i = $start; $i <= $stop; $i++) {
echo $log[$i] . "<BR>";
}
echo '<hr>';
echo "<center>" . $ffs . "</center><HR>";
?>
<FORM>
<INPUT TYPE=hidden name=page value="<?= $_GET['page'] ?>"/>
<INPUT TYPE=hidden name=log value="<?= $_REQUEST['log'] ?>"/>
<INPUT TYPE=submit name=analiz2 value="Обновить">
</form>
&nbsp;
Страницы:
<?php
for ($i = 0; $i <= $pgs; ++$i) {
if ($_GET['page'] == $i) {
echo ' <a href="?log=', $_GET['log'], '&page=', $i, '"><font color=#8f0000>', ($i + 1), '</font></a> ';
} else {
echo ' <a href="?log=', $_GET['log'], '&page=', $i, '">', ($i + 1), '</a> ';
}
}
echo "<br><br><form method=get><input type=hidden name='log' value='" . (int)$_GET['log'] . "'><input type=hidden name='stat' value='1'><input type=submit value='Статистика боя'></form>";
} else {
echo "<form method=get><input type=hidden name='log' value='" . (int)$_GET['log'] . "'><input type=submit value='Лог боя'></form>";
echo "Статистика временно недоступна ...<br />";
echo "<br><form method=get><input type=hidden name='log' value='" . (int)$_GET['log'] . "'><input type=submit value='Лог боя'></form>";
}
?>
</FORM>

View File

@ -365,16 +365,8 @@ if ($mfs && $ids) {
} }
} }
if ($setShadow) { if ($setShadow) {
Template::header('Образ персонажа');
?> ?>
<!doctype html>
<html lang="ru">
<head>
<link rel=stylesheet href="css/main.css">
<link rel=stylesheet href="css/btn.css">
<meta charset="utf-8">
<title></title>
</head>
<body>
<div style="text-align: right;"> <div style="text-align: right;">
<input type=button value="Вернуться" onClick="location.href='main.php?edit=<?= mt_rand() ?>';" class="button"> <input type=button value="Вернуться" onClick="location.href='main.php?edit=<?= mt_rand() ?>';" class="button">
</div> </div>
@ -403,8 +395,6 @@ if ($setShadow) {
<td><a href="?edit=1&obraz=f9"><img alt="f09" src="i/shadow/f9.gif"></a> <td><a href="?edit=1&obraz=f9"><img alt="f09" src="i/shadow/f9.gif"></a>
<td><a href="?edit=1&obraz=f10"><img alt="f10" src="i/shadow/f10.gif"></a> <td><a href="?edit=1&obraz=f10"><img alt="f10" src="i/shadow/f10.gif"></a>
</table> </table>
</body>
</html>
<?php <?php
exit(); exit();
} }
@ -455,43 +445,35 @@ if ($edit) {
undressall($_SESSION['uid']); undressall($_SESSION['uid']);
} }
} }
Template::header('Игра');
?> ?>
<!doctype html> <link rel="stylesheet" href="css/tooltip.css">
<HTML lang="ru"> <script src="js/tooltip.js"></script>
<HEAD> <script src="js/funcs.js"></script>
<meta charset="utf-8"> <script>
<link rel="stylesheet" href="css/main.css"> $(function () {
<link rel="stylesheet" href="css/tooltip.css"> $(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500});
<link rel="stylesheet" href="css/btn.css"> });
<script src="js/tooltip.js"></script>
<script src="js/funcs.js"></script>
<script>
$(function () {
$(".tooltip").tipTip({maxWidth: "auto", edgeOffset: 0, fadeIn: 300, fadeOut: 500});
});
let Hint3Name = ''; let Hint3Name = '';
function okno(title, script, name, errk) { function okno(title, script, name, errk) {
let errkom = ''; let errkom = '';
let com = ''; let com = '';
if (errk === 1) { if (errk === 1) {
errkom = 'Нельзя использовать символы: /\:*?"<>|+%<br>'; errkom = 'Нельзя использовать символы: /\:*?"<>|+%<br>';
}
document.getElementById("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="6"><td colspan=2><span class="error">' +
errkom + '</span>введите название предмета</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '" value="' + com + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
document.getElementById("hint3").style.visibility = "visible";
document.getElementById("hint3").style.left = '100';
document.getElementById("hint3").style.top = '100';
document.getElementById(name).focus();
Hint3Name = name;
} }
</script> document.getElementById("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
<title>Окно игры</title> '<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="6"><td colspan=2><span class="error">' +
</HEAD> errkom + '</span>введите название предмета</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '" value="' + com + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
<body> document.getElementById("hint3").style.visibility = "visible";
document.getElementById("hint3").style.left = '100';
document.getElementById("hint3").style.top = '100';
document.getElementById(name).focus();
Hint3Name = name;
}
</script>
<div id=hint3 class=ahint></div> <div id=hint3 class=ahint></div>
<div id="hint4" style="position: absolute;"></div> <div id="hint4" style="position: absolute;"></div>
<div id="chpassbank" style="display:none; position:absolute; top:50px; left:250px;"></div> <div id="chpassbank" style="display:none; position:absolute; top:50px; left:250px;"></div>
@ -568,7 +550,8 @@ if ($edit) {
<button class="button" onclick="window.location.href='module_quest.php';">Активные задания <button class="button" onclick="window.location.href='module_quest.php';">Активные задания
</button> </button>
<?php if ($user->room === 20): ?> <?php if ($user->room === 20): ?>
<button class="button icon move" onclick="parent.frames[´main´].location.href='main.php?goto=arena';">Войти <button class="button icon move"
onclick="parent.frames[´main´].location.href='main.php?goto=arena';">Войти
внутрь внутрь
</button> </button>
<?php else: ?> <?php else: ?>
@ -601,6 +584,4 @@ if ($edit) {
</div> </div>
</td> </td>
</tr> </tr>
</table> </table>
</body>
</html>

View File

@ -6,7 +6,7 @@ if (empty($_SESSION['uid'])) {
} }
require_once 'functions.php'; require_once 'functions.php';
include('classes/quests_class.php'); require_once 'classes/quests_class.php';
$qEndNow = $_GET['end_qst_now'] ?? null; $qEndNow = $_GET['end_qst_now'] ?? null;
$qEnd = $_GET['end_qst'] ?? null; $qEnd = $_GET['end_qst'] ?? null;
@ -23,70 +23,9 @@ $qsee = '';
$qx = 0; $qx = 0;
$error = ''; $error = '';
Template::header('module_quest');
?> ?>
<!DOCTYPE html> <link rel="stylesheet" href="css/hostel.css"/>
<html lang="ru">
<head>
<title></title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/hostel.css"/>
<style>
div.ctContainerA, div.ctContainerB {
position: relative;
margin-bottom: 5px;
padding: 5px;
box-shadow: 3px 3px 5px 0 #323232;
}
div.ctContainerA {
border: 2px groove threedface;
}
div.ctTitle {
margin-bottom: 3px;
border-bottom: 2px groove threedface;
font-weight: bold;
color: #bf0000;
}
div.ctContent {
overflow: hidden;
position: relative;
width: 100%;
}
div.quest_target_item div.ctTitle a.action-start {
float: right;
}
div.quest_target_item[forever='1'] div.ctContent .available {
color: #800;
}
div.quest_target_item[forever='0'][available='0'] div.ctContent .available {
color: blue;
}
div.quest_target_item div.ctContent .available {
font-size: small;
}
div.quest_target_item div.ctContent img.icon {
width: 60px;
height: 60px;
float: left;
margin: 2px;
}
div.qriContainer {
position: relative;
display: inline;
font-size: 80%;
}
</style>
</head>
<body>
<?php <?php
$sp = db::c()->query('SELECT `vars` FROM `actions` WHERE `vars` LIKE "?S" AND `vals` = "?s" AND `uid` = ?i LIMIT 100', "%start_quest%", "go", $user->id); $sp = db::c()->query('SELECT `vars` FROM `actions` WHERE `vars` LIKE "?S" AND `vals` = "?s" AND `uid` = ?i LIMIT 100', "%start_quest%", "go", $user->id);
while ($pl = $sp->fetch_assoc()) { while ($pl = $sp->fetch_assoc()) {
@ -111,10 +50,10 @@ if ($q->error) {
<input type="button" class="btns button-route" value="Вернуться" onclick="location.href='main.php';"/> <input type="button" class="btns button-route" value="Вернуться" onclick="location.href='main.php';"/>
<input type="button" class="btns button-route" value="Обновить" onclick="location.href='module_quest.php';"/> <input type="button" class="btns button-route" value="Обновить" onclick="location.href='module_quest.php';"/>
</div> </div>
<?php if ($error) {err($error);} ?> <?php if ($error) {
err($error);
} ?>
<div class="quest_target_container" style="padding-top: 15px;"> <div class="quest_target_container" style="padding-top: 15px;">
<?= $qsee ?> <?= $qsee ?>
</div> </div>
</div> </div>
</body>
</html>

View File

@ -33,7 +33,7 @@
</script> </script>
<? <?php
print'<table width="100%" border="0">'; print'<table width="100%" border="0">';
print'<tr align=left valign=top border="0"> print'<tr align=left valign=top border="0">
<td> <td>

View File

@ -5,9 +5,8 @@ if (empty($_SESSION['uid'])) {
exit; exit;
} }
include "config.php"; require_once "functions.php";
include "functions.php"; require_once "startpodzemel.php";
include "startpodzemel.php";
if ($user->battle) { if ($user->battle) {
header('location: fbattle.php'); header('location: fbattle.php');
exit; exit;
@ -17,87 +16,22 @@ $fd = mysql_fetch_array($df);
$cd = mysql_query("select `n18` from `podzem3` where `glava`='" . $fd['glava'] . "' and `name`='Канализация 1 этаж'"); $cd = mysql_query("select `n18` from `podzem3` where `glava`='" . $fd['glava'] . "' and `name`='Канализация 1 этаж'");
$vb = mysql_fetch_array($cd); $vb = mysql_fetch_array($cd);
if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 этаж' and $vb['n18'] == '8') { if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 этаж' and $vb['n18'] == '8') {
Template::header('Подземелье Луки');
?> ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel=stylesheet type="text/css" href="css/main.css">
<title>Подземка - Лука</title>
<style>
BODY {
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
margin: 0 0 0 0;
scrollbar-face-color: #e3ac67;
scrollbar-highlight-color: #e0c3a0;
scrollbar-shadow-color: #b78d58;
scrollbar-3dlight-color: #b78d58;
scrollbar-arrow-color: #b78d58;
scrollbar-track-color: #e0c3a0;
scrollbar-darkshadow-color: #b78d58;
}
.menu {
z-index: 100;
background-color: #E4F2DF;
border-style: solid;
border-width: 2px;
border-color: #77c3fc
position: absolute;
left: 0;
top: 0;
visibility: hidden;
cursor: hand;
}
a.menuItem {
border: 0 solid #000000;
background-color: #484848;
color: #000000;
display: block;
font-family: Verdana, Arial;
font-size: 8pt;
font-weight: bold;
padding: 2px 12px 2px 8px;
text-decoration: none;
}
a.menuItem:hover {
background-color: #d4cbaa;
color: #000000;
}
</style>
</head>
<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 bgcolor="#e2e0e0"
onload="top.setHP(<?= $user['hp'] ?>,<?= $user['maxhp'] ?>)">
<div id=hint3 class=ahint></div> <div id=hint3 class=ahint></div>
<TABLE width=100% cellspacing=0 cellpadding=0 border=0> <TABLE width=100% cellspacing=0 cellpadding=0 border=0>
<TR> <TR>
<TD valign=top> <TD valign=top>
<div style="width: 250px; text-align: center;">
<TABLE width=250 cellspacing=0 cellpadding=0> <?php
<TR> $userInfo = new User($_SESSION['uid']);
<TD valign=top width=250 nowrap> $userInfo->showUserDoll();
<CENTER> ?>
<?php </div>
$userInfo = new User($_SESSION['uid']);
$userInfo->showUserDoll();
?>
</CENTER>
</TD>
</TR>
</TABLE>
</TD> </TD>
<TD> <TD>
<i> <i>
<? <?php
$gag = mysql_query("SELECT * FROM qwest WHERE login='" . $user['login'] . "'"); $gag = mysql_query("SELECT * FROM qwest WHERE login='" . $user['login'] . "'");
while ($qw = mysql_fetch_array($gag)) { while ($qw = mysql_fetch_array($gag)) {
$name_qwest = $qw["name_items"]; $name_qwest = $qw["name_items"];
@ -115,7 +49,6 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
$ok_qwest = "1"; $ok_qwest = "1";
} }
if (!$_GET['d']) { if (!$_GET['d']) {
print"Запах... ОНИ! Мою хороошую, мою чистую канализацию испортилиии..."; print"Запах... ОНИ! Мою хороошую, мою чистую канализацию испортилиии...";
} }
@ -127,41 +60,32 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
} }
if ($qwest_status != 'ok') { if ($qwest_status != 'ok') {
if ($ok_qwest == '1') { if ($ok_qwest == '1' && $_GET['d'] == '1.2') {
if ($_GET['d'] == '1.2') { print"Ооо... Лука рад... Лука очень благодарен тебе... Лука даст тебе подарок... Лука даст тебе одно из двух... Лука даст Гайку силы или Гайку мудрости... выбирай...";
print"Ооо... Лука рад... Лука очень благодарен тебе... Лука даст тебе подарок... Лука даст тебе одно из двух... Лука даст Гайку силы или Гайку мудрости... выбирай...";
}
} }
if ($ok_qwest == '1') { if ($ok_qwest == '1' && $_GET['d'] == '1.3') {
if ($_GET['d'] == '1.3') { $sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','15','8','10','10','','3','','','','60','50','30','','','g_sila.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')";
$sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','15','8','10','10','','3','','','','60','50','30','','','g_sila.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')"; $res = mysql_query($sql);
$res = mysql_query($sql); mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'");
mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'"); mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'");
mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'"); if (!$res) {
if (!$res) { echo mysql_error();
echo mysql_error();
}
print"<font style='font-size:11px; color:red;'>Вы получили 'Гайку силы'.</font><br><br>
Лука говарит спасибо...";
} }
print"<span style='font-size:11px; color:red;'>Вы получили 'Гайку силы'.</span><br><br> Лука говарит спасибо...";
} }
if ($ok_qwest == '1') { if ($ok_qwest == '1' && $_GET['d'] == '1.4') {
if ($_GET['d'] == '1.4') { $sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','5','4','4','10','15','','','','3','80','','50','50','','g_mudr.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')";
$sql = "INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','5','4','4','10','15','','','','3','80','','50','50','','g_mudr.gif','" . $user['id'] . "','5','5','5','5','2','2','1','41','1')"; $res = mysql_query($sql);
$res = mysql_query($sql); mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'");
mysql_query("DELETE FROM `inventory` WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Ключиик'"); mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'");
mysql_query("UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`='" . $user['login'] . "'"); if (!$res) {
if (!$res) { echo mysql_error();
echo mysql_error();
}
print"<font style='font-size:11px; color:red;'>Вы получили 'Гайку мудрости'.</font><br><br>
Лука говарит спасибо...";
} }
print"<span style='font-size:11px; color:red;'>Вы получили 'Гайку мудрости'.</span><br><br>Лука говарит спасибо...";
} }
} }
if (($_GET['d'] == '2') && ($user['level'] >= 4) && ($user['level'] < 7)) { if (($_GET['d'] == '2') && ($user['level'] >= 4) && ($user['level'] < 7)) {
print"Цена-аа? У Луки много жетонов. Лука не жаадный. Лука берет 3 Гайки и отдает жетон. Лука дает жетон за целый болт. Лука дает ТРИ жетона за найденный вентиль.<br> Лука дает жетоны серебрянные, если Гайки и Вентили Чистые, а Болт Длинный! Лука дает золотые жетоны, если Гайки с Резьбой, Вентиль Рабочий, а Болт Нужный!"; print"Цена-аа? У Луки много жетонов. Лука не жаадный. Лука берет 3 Гайки и отдает жетон. Лука дает жетон за целый болт. Лука дает ТРИ жетона за найденный вентиль.<br> Лука дает жетоны серебрянные, если Гайки и Вентили Чистые, а Болт Длинный! Лука дает золотые жетоны, если Гайки с Резьбой, Вентиль Рабочий, а Болт Нужный!";
} }
@ -365,8 +289,6 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
} else { } else {
$ze_m = $ostalos * 0.1; $ze_m = $ostalos * 0.1;
mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos', `massa`='$ze_m' WHERE `id`='$alls_id'"); mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos', `massa`='$ze_m' WHERE `id`='$alls_id'");
// mysql_query("DELETE FROM `inventory` WHERE `name`='Гайка' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$alls_id'");// x_mis ставим 0
} }
if (($user['level'] >= 4) && ($user['level'] < 7)) { if (($user['level'] >= 4) && ($user['level'] < 7)) {
if ($total_mass_v <= 0) { if ($total_mass_v <= 0) {
@ -546,8 +468,6 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
} else { } else {
$ze_v = $ostalos_v * 0.2; $ze_v = $ostalos_v * 0.2;
mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos_v',`massa`='$ze_v' WHERE `id`='$vls_id'"); mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos_v',`massa`='$ze_v' WHERE `id`='$vls_id'");
// mysql_query("DELETE FROM `inventory` WHERE `name`='Вентиль' and `x_mis`='0' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$vls_id'");// x_mis ставим 0
} }
if (($user['level'] >= 4) && ($user['level'] < 7)) { if (($user['level'] >= 4) && ($user['level'] < 7)) {
if ($total_mass_b <= 0) { if ($total_mass_b <= 0) {
@ -726,11 +646,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
} else { } else {
$ze_b = $ostalos_b * 0.1; $ze_b = $ostalos_b * 0.1;
mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos_b',`massa`='$ze_b' WHERE `id`='$bls_id'"); mysql_query("UPDATE `inventory` SET `maxdur`='$ostalos_b',`massa`='$ze_b' WHERE `id`='$bls_id'");
// mysql_query("DELETE FROM `inventory` WHERE `name`='Болт' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$bls_id'");// x_mis ставим 0
} }
if ($ziton != '0') {//1 if (!empty($ziton) {
$g = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'")); $g = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'"));
$koll = $g["maxdur"]; $koll = $g["maxdur"];
$mas = $ziton * 0.1; $mas = $ziton * 0.1;
@ -738,12 +656,11 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
mysql_query("UPDATE `inventory` SET maxdur=maxdur+$ziton, massa=massa+$mas,`present`='Лука' WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Жетон'"); mysql_query("UPDATE `inventory` SET maxdur=maxdur+$ziton, massa=massa+$mas,`present`='Лука' WHERE owner='" . $user['id'] . "' and `type`='200' and `name`='Жетон'");
} else { } else {
$mas = $ziton * 0.1; $mas = $ziton * 0.1;
$fo = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa,present) VALUES('Жетон','0','$ziton','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')"); $fo = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa,present) VALUES('Жетон','0','$ziton','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')");
} }
}//1 }
if ($ziton_v != '0') {//1 if (!empty($ziton_v)) {
$gv = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'")); $gv = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'"));
$kollv = $gv["maxdur"]; $kollv = $gv["maxdur"];
$mas = $ziton_v * 0.1; $mas = $ziton_v * 0.1;
@ -753,9 +670,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
$mas = $ziton_v * 0.1; $mas = $ziton_v * 0.1;
$fov = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0','$ziton_v','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')"); $fov = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0','$ziton_v','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')");
} }
}//1 }
if ($ziton_b != '0') {//1 if (!empty($ziton_b)) {
$gb = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'")); $gb = mysql_fetch_array(mysql_query("SELECT `maxdur` FROM `inventory` WHERE `owner`='" . $user['id'] . "' and `type`='200' and `name`='Жетон'"));
$kollb = $gb["maxdur"]; $kollb = $gb["maxdur"];
$mas = $ziton_b * 0.1; $mas = $ziton_b * 0.1;
@ -765,9 +682,9 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
$mas = $ziton_b * 0.1; $mas = $ziton_b * 0.1;
$fob = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0','$ziton_b','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')"); $fob = mysql_query("INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0','$ziton_b','ziton.gif','" . $user['id'] . "','200','0','$mas', 'Лука')");
} }
}//1 }
if ($ziton <= 0 and $ziton_v <= 0 and $ziton_b <= 0) { if (empty($ziton) && empty($ziton_v) && empty($ziton_b)) {
print" ИХ больше у тебя нету... Неси еще, Луке нужно больше ИХ! "; print" ИХ больше у тебя нету... Неси еще, Луке нужно больше ИХ! ";
} }
if ($ziton > 0) { if ($ziton > 0) {
@ -794,75 +711,40 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
if ($_GET['d'] == '7') { if ($_GET['d'] == '7') {
if ($qwest != '1') { if ($qwest != '1') {
$T1 = mysql_query("INSERT INTO qwest (user_id,login,name_qwest,name_items,id_items,dlja,zadanie,kw,status) VALUES('" . $user['id'] . "','" . $user['login'] . "','kluchiik','Ключиик','','Лука','Найти ключиик','0','no')"); $T1 = mysql_query("INSERT INTO qwest (user_id,login,name_qwest,name_items,id_items,dlja,zadanie,kw,status) VALUES('" . $user['id'] . "','" . $user['login'] . "','kluchiik','Ключиик','','Лука','Найти ключиик','0','no')");
print"<font style='font-size:11px; color:red;'>Вы приняли задание.(Найти 'ключиик').</font><br><br> print"<span style='font-size:11px; color:red;'>Вы приняли задание.(Найти 'ключиик').</span><br><br>
Хорошо... Лука будет ждать..."; Хорошо... Лука будет ждать...";
} else { } else {
print"<font style='font-size:11px; color:red;'>Вы уже приняли задание.(Найти 'ключиик').</font><br><br> print"<span style='font-size:11px; color:red;'>Вы уже приняли задание.(Найти 'ключиик').</span><br><br>
Ну что? Лука ждёт..."; Ну что? Лука ждёт...";
} }
} }
} }
?> ?>
</i> </i><BR><BR>
<?php
<BR><BR>
<?
//Вопросы) //Вопросы)
if (!isset($_GET['d'])) { if (!isset($_GET['d'])) {
print"&bull;<A href='?act=luka&d=1'> Запах?? Ты вообще о чем? </A><BR>"; print"&bull;<A href='?act=luka&d=1'> Запах?? Ты вообще о чем? </A><BR>";
}
if (!isset($_GET['d'])) {
print"&bull;<A href='?act=luka&d=1.1'> Я тут гайки-вентили нашел, тебе они случайно не нужны? </A><BR>"; print"&bull;<A href='?act=luka&d=1.1'> Я тут гайки-вентили нашел, тебе они случайно не нужны? </A><BR>";
} if ($qwest_status != 'ok' && $ok_qwest == '1') {
if ($qwest_status != 'ok') { print"&bull;<A href='?act=luka&d=1.2'> Вот твой ключиик! </A><BR>";
if ($ok_qwest == '1') {
if (!isset($_GET['d'])) {
print"&bull;<A href='?act=luka&d=1.2'> Вот твой ключиик! </A><BR>";
}
} }
}
if (!isset($_GET['d'])) {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
} }
if ($_GET['d'] == '1') { if ($_GET['d'] == '1') {
print"&bull;<A href='?act=luka'> Понятно. Но я хотел поговорить о другом. </A><BR>"; print"&bull;<A href='?act=luka'> Понятно. Но я хотел поговорить о другом. </A><BR>";
}
if ($_GET['d'] == '1') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
} }
if ($_GET['d'] == '1.1') { if ($_GET['d'] == '1.1') {
print"&bull;<A href='?act=luka&d=2'> Я хочу знать, сколько жетонов ты мне дашь. </A><BR>"; print"&bull;<A href='?act=luka&d=2'> Я хочу знать, сколько жетонов ты мне дашь. </A><BR>";
}
if ($_GET['d'] == '1.1') {
print"&bull;<A href='?act=luka&d=3'> Я хочу поменять ИХ на жетоны. </A><BR>"; print"&bull;<A href='?act=luka&d=3'> Я хочу поменять ИХ на жетоны. </A><BR>";
}
if ($_GET['d'] == '1.1') {
print"&bull;<A href='?act=luka'> С гайками все ясно. Вернемся назад. </A><BR>"; print"&bull;<A href='?act=luka'> С гайками все ясно. Вернемся назад. </A><BR>";
}
if ($_GET['d'] == '1.1') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
} }
if ($ok_qwest == '1' && $_GET['d'] == '1.2') {
if ($ok_qwest == '1') { print"&bull;<A href='?act=luka&d=1.3'> Выбераю Гайку силы.</A><BR>";
if ($_GET['d'] == '1.2') { print"&bull;<A href='?act=luka&d=1.4'> Выбераю Гайку мудрости.</A><BR>";
print"&bull;<A href='?act=luka&d=1.3'> Выбераю Гайку силы.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду..</A><BR>";
}
}
if ($ok_qwest == '1') {
if ($_GET['d'] == '1.2') {
print"&bull;<A href='?act=luka&d=1.4'> Выбераю Гайку мудрости.</A><BR>";
}
}
if ($ok_qwest == '1') {
if ($_GET['d'] == '1.2') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду..</A><BR>";
}
} }
if ($_GET['d'] == '1.3') { if ($_GET['d'] == '1.3') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
@ -870,61 +752,39 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
if ($_GET['d'] == '1.4') { if ($_GET['d'] == '1.4') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
} }
if ($_GET['d'] == '2') { if ($_GET['d'] == '2') {
print"&bull;<A href='?act=luka&d=3'> Я хочу поменять ИХ на жетоны. </A><BR>"; print"&bull;<A href='?act=luka&d=3'> Я хочу поменять ИХ на жетоны. </A><BR>";
}
if ($_GET['d'] == '2') {
print"&bull;<A href='?act=luka'> Спасибо, за прайс-лист. </A><BR>"; print"&bull;<A href='?act=luka'> Спасибо, за прайс-лист. </A><BR>";
}
if ($_GET['d'] == '2') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
} }
if ($_GET['d'] == '3') { if ($_GET['d'] == '3') {
print"&bull;<A href='?act=luka&d=4'> Я хотел еще спросить... </A><BR>"; print"&bull;<A href='?act=luka&d=4'> Я хотел еще спросить... </A><BR>";
}
if ($_GET['d'] == '3') {
print"&bull;<A href='main.php?act=none'> Хорошо, пойду еще принесу.</A><BR>"; print"&bull;<A href='main.php?act=none'> Хорошо, пойду еще принесу.</A><BR>";
} }
if ($_GET['d'] == '4') { if ($_GET['d'] == '4') {
print"&bull;<A href='?act=luka&d=1.1'> Что ты там говорил про гайки-вентили? </A><BR>"; print"&bull;<A href='?act=luka&d=1.1'> Что ты там говорил про гайки-вентили? </A><BR>";
}
if ($_GET['d'] == '4') {
print"&bull;<A href='?act=luka&d=5'> Расскажи мне о себе. </A><BR>"; print"&bull;<A href='?act=luka&d=5'> Расскажи мне о себе. </A><BR>";
}
if ($_GET['d'] == '4') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
} }
if ($_GET['d'] == '5') { if ($_GET['d'] == '5') {
print"&bull;<A href='?act=luka&d=1.1'> Что ты там говорил про гайки-вентили? </A><BR>"; print"&bull;<A href='?act=luka&d=1.1'> Что ты там говорил про гайки-вентили? </A><BR>";
} }
if ($qwest != '1') { if ($qwest != '1' && $_GET['d'] == '5') {
if ($_GET['d'] == '5') { print"&bull;<A href='?act=luka&d=6'> Может помочь чем? </A><BR>";
print"&bull;<A href='?act=luka&d=6'> Может помочь чем? </A><BR>";
}
} }
if ($_GET['d'] == '5') { if ($_GET['d'] == '5') {
print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR>";
} }
if ($_GET['d'] == '6') { if ($_GET['d'] == '6') {
print"&bull;<A href='?act=luka&d=7'> Я помогу тебе... принесу я ключиик... жди! </A><BR>"; print"&bull;<A href='?act=luka&d=7'> Я помогу тебе... принесу я ключиик... жди! </A><BR>";
}
if ($_GET['d'] == '6') {
print"&bull;<A href='main.php?act=none'> Да ну тя сам разберайся.</A><BR>"; print"&bull;<A href='main.php?act=none'> Да ну тя сам разберайся.</A><BR>";
} }
if ($_GET['d'] == '7') { if ($_GET['d'] == '7') {
print"&bull;<A href='main.php?act=none'> Я, пойду.(конец диалога).</A><BR>"; print"&bull;<A href='main.php?act=none'> Я, пойду.(конец диалога).</A><BR>";
} }
print"</i>";
print"</i><BR><BR>";
?> ?>
<BR><BR>
</TD> </TD>
<TD> <TD>
<?php <?php
@ -941,8 +801,5 @@ if ($fd['location'] == '28' and $fd['name'] == 'Канализация 1 эта
<DIV ID="oMenu" style="position:absolute; border:1px solid #666; background-color:#CCC; display:none; "></DIV> <DIV ID="oMenu" style="position:absolute; border:1px solid #666; background-color:#CCC; display:none; "></DIV>
<TEXTAREA ID=holdtext STYLE="display:none;"></TEXTAREA> <TEXTAREA ID=holdtext STYLE="display:none;"></TEXTAREA>
</body>
</html>
<? <?
} }
?>

View File

@ -77,15 +77,9 @@ if ($_SESSION['receiverName']) {
} }
} }
} }
Template::header('Почта');
?> ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<script src="js/main.js"></script> <script src="js/main.js"></script>
</head>
<body>
<div style="float: right"> <div style="float: right">
<button onclick="hrefToFrame('city.php?cp')">Вернуться</button> <button onclick="hrefToFrame('city.php?cp')">Вернуться</button>
</div> </div>
@ -143,5 +137,3 @@ if ($_SESSION['receiverName']) {
<input name='receiverName' placeholder="Логин получателя"> <input type=submit value='Применить'> <input name='receiverName' placeholder="Логин получателя"> <input type=submit value='Применить'>
</form> </form>
<?php endif ?> <?php endif ?>
</BODY>
</HTML>

View File

@ -18,7 +18,7 @@ if ($_SESSION['uid'] != 2) header("Location: index.php");
require_once 'config.php'; require_once 'config.php';
$user = new User($_SESSION['uid']); $user = new User($_SESSION['uid']);
$status = '';
$dirname = "i/presents/"; $dirname = "i/presents/";
$images = glob($dirname . "*.png"); $images = glob($dirname . "*.png");
@ -48,11 +48,9 @@ if (!empty($_POST['sendAction'])) {
if ($_POST['sender'] == 1) { if ($_POST['sender'] == 1) {
$sender = "Анонимный подарок"; $sender = "Анонимный подарок";
} } elseif ($_POST['sender'] == 2 && $user->clan) {
elseif ($_POST['sender'] == 2 && $user->clan) {
$sender = "Подарок от клана {$user->clan}"; $sender = "Подарок от клана {$user->clan}";
} } else {
else {
$sender = "Подарок от {$user->login}"; $sender = "Подарок от {$user->login}";
} }
@ -64,34 +62,27 @@ if (!empty($_POST['sendAction'])) {
db::c()->query('INSERT INTO `telegraph` (receiver, text) VALUES (?i,"?s")', $receiver['id'], $telegraphText); db::c()->query('INSERT INTO `telegraph` (receiver, text) VALUES (?i,"?s")', $receiver['id'], $telegraphText);
$status = "Подарок удачно доставлен к {$_POST['receiver']}! Вы потратили <b>{$cost}</b> кр."; $status = "Подарок удачно доставлен к {$_POST['receiver']}! Вы потратили <b>{$cost}</b> кр.";
} }
Template::header('Дарильня');
?> ?>
<!DOCTYPE html> <script src="js/main.js"></script>
<html lang="ru"> <style>
<head> label.present > input { /* HIDE RADIO */
<meta charset="utf-8"> visibility: hidden; /* Makes input not-clickable */
<link href="css/main.css" rel="stylesheet"/> position: absolute; /* Remove input from document flow */
<script src="js/main.js"></script> }
<style>
label.present > input { /* HIDE RADIO */
visibility: hidden; /* Makes input not-clickable */
position: absolute; /* Remove input from document flow */
}
label.present > input + img { /* IMAGE STYLES */ label.present > input + img { /* IMAGE STYLES */
cursor: pointer; cursor: pointer;
border: 1px solid transparent; border: 1px solid transparent;
} }
label.present > input:checked + img { /* (RADIO CHECKED) IMAGE STYLES */ label.present > input:checked + img { /* (RADIO CHECKED) IMAGE STYLES */
border: 1px solid darkred; border: 1px solid darkred;
background: lightcoral; background: lightcoral;
} }
</style> </style>
<title></title> <h1>Дарильня</h1>
</head> <div class="private"><?= $status ?></div>
<body>
<h1>Магазин подарков</h1>
<div class="private"><?php if (!empty($status)) echo $status; ?></div>
Вы можете сделать подарок любому персонажу. Ваш подарок будет Вы можете сделать подарок любому персонажу. Ваш подарок будет
отображаться в информации о персонаже.<br><br> отображаться в информации о персонаже.<br><br>
<div> <div>
@ -119,6 +110,4 @@ if (!empty($_POST['sendAction'])) {
<br> <br>
<input type="submit" value="Подарить"> <input type="submit" value="Подарить">
</form> </form>
</div> </div>
</body>
</html>

View File

@ -5,7 +5,7 @@ if (empty($_SESSION['uid'])) {
} }
require_once 'functions.php'; require_once 'functions.php';
include('classes/quests_class.php'); include('classes/quests_class.php');
$status = '';
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING')); $get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
if ($get == 'exit') { if ($get == 'exit') {
@ -54,22 +54,17 @@ function info_quest($id)
if (!empty($q->error)) { if (!empty($q->error)) {
$status = $q->error; $status = $q->error;
} }
Template::header('Памятник');
?> ?>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/main.css"/>
</head>
<body>
<div style="float: right;"> <div style="float: right;">
<?php if (($user['level'] < 5 OR $user['admin'] == 1) AND $user['hp'] < $user['maxhp']): ?> <?php if (($user->level < 5 || $user->admin) && $user->health < $user->maxHealth): ?>
<button onclick="location.href='?hps'">Восстановить здоровье</button> <button onclick="location.href='?hps'">Восстановить здоровье</button>
<? endif ?> <? endif ?>
<button onclick="location.href='?'">Обновить</button> <button onclick="location.href='?'">Обновить</button>
<button onclick="location.href='?exit'">Вернуться</button> <button onclick="location.href='?exit'">Вернуться</button>
</div> </div>
<h1>Памятник</h1> <h1>Памятник</h1>
<div><?php if (!empty($status)) err($status); ?></div> <div><?= $status ?></div>
<div> <div>
На памятнике выгравированы опасные задания, за выполнение которых можно получить достойную На памятнике выгравированы опасные задания, за выполнение которых можно получить достойную
награду! Для каждого задания отводится определенный промежуток времени, если задание не сдано вовремя, то награду! Для каждого задания отводится определенный промежуток времени, если задание не сдано вовремя, то
@ -77,6 +72,4 @@ if (!empty($q->error)) {
</div> </div>
<div style="text-align: center;"> <div style="text-align: center;">
<?= $questList ?> <?= $questList ?>
</div> </div>
</body>
</html>

View File

@ -32,15 +32,8 @@ if ($hreject) {
} }
} }
} }
Template::header('Регистрация персонажа');
?> ?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<title>Регистрация персонажа</title>
</head>
<body>
<a href="/"> на главную</a> <a href="/"> на главную</a>
<?php if (!empty($error)): ?> <?php if (!empty($error)): ?>
<h1><?php echo $error; ?></h1> <h1><?php echo $error; ?></h1>
@ -56,6 +49,4 @@ if ($hreject) {
<input required id="law2" name="law2" type=checkbox> <label for="law2">Я согласен на <a href='#'>любые условия</a>, давайте играть!</label><br> <input required id="law2" name="law2" type=checkbox> <label for="law2">Я согласен на <a href='#'>любые условия</a>, давайте играть!</label><br>
<input type=submit value=Зарегистрироваться> <input type=submit value=Зарегистрироваться>
</form> </form>
<?php endif; ?> <?php endif; ?>
</body>
</html>

View File

@ -25,6 +25,7 @@ function mail_send($to, $from_user, $from_email, $subject = '(No subject)', $mes
return mail($to, $subject, $message, $headers); return mail($to, $subject, $message, $headers);
} }
if ($login) { if ($login) {
$loginCheck = db::c()->query('SELECT email FROM users WHERE login = "?s"', $login)->fetch_assoc(); $loginCheck = db::c()->query('SELECT email FROM users WHERE login = "?s"', $login)->fetch_assoc();
if ($loginCheck) { if ($loginCheck) {
@ -55,8 +56,7 @@ if ($login) {
if ($changePassword) { if ($changePassword) {
if (db::c()->query('SELECT 1 FROM users_recovery WHERE `hash` = "?s" AND `date` < "?s"', $changePassword, date('Y-m-d'))->getNumRows()) { if (db::c()->query('SELECT 1 FROM users_recovery WHERE `hash` = "?s" AND `date` < "?s"', $changePassword, date('Y-m-d'))->getNumRows()) {
$allowChange = true; $allowChange = true;
} } else {
else {
$statusMessage = ERROR_OLD_HASH; $statusMessage = ERROR_OLD_HASH;
} }
} }
@ -72,16 +72,9 @@ if ($newPassword && $hashCheck) {
$statusMessage = ERROR_WRONG_HASH; $statusMessage = ERROR_WRONG_HASH;
} }
} }
Template::header('Восстановление пароля');
?> ?>
<!DOCTYPE html> <a href="/"> на главную</a>
<html lang="ru_RU">
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<title>Восстановление пароля</title>
</head>
<body>
<a href="/"> на главную</a>
<?php if (!empty($statusMessage)): ?> <?php if (!empty($statusMessage)): ?>
<h3><?php echo $statusMessage; ?></h3> <h3><?php echo $statusMessage; ?></h3>
<?php endif; ?> <?php endif; ?>
@ -101,6 +94,4 @@ if ($newPassword && $hashCheck) {
<input required name="loginid" placeholder="Имя персонажа" value="<?= $login ?>"><br> <input required name="loginid" placeholder="Имя персонажа" value="<?= $login ?>"><br>
<input type=submit> <input type=submit>
</form> </form>
<?php endif; ?> <?php endif;
</body>
</html>

View File

@ -74,17 +74,10 @@ if ($goto == 'remont') {
if ($goto == 'gravirovka') { if ($goto == 'gravirovka') {
$gravirovka_query = db::c()->query('SELECT `id`,`name`,`img`,`text` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 3 AND `name` NOT LIKE "?S" AND `setsale` = 0 OR `text` <> "?s" AND `owner` = ?i AND `dressed` = 0 AND `setsale` = 0 ORDER by `update` DESC', $_SESSION['uid'], '%Букет%', '', $_SESSION['uid']); $gravirovka_query = db::c()->query('SELECT `id`,`name`,`img`,`text` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 3 AND `name` NOT LIKE "?S" AND `setsale` = 0 OR `text` <> "?s" AND `owner` = ?i AND `dressed` = 0 AND `setsale` = 0 ORDER by `update` DESC', $_SESSION['uid'], '%Букет%', '', $_SESSION['uid']);
} }
Template::header('Кузня');
?> ?>
<!doctype html>
<HTML lang="ru">
<HEAD>
<title></title>
<meta charset="utf-8">
<link rel=stylesheet href="css/main.css">
<link href="css/secondary.css" rel="stylesheet"/> <link href="css/secondary.css" rel="stylesheet"/>
<script src="js/main.js"></script> <script src="js/main.js"></script>
</HEAD>
<body>
<h1>Ремонтная мастерская</h1> <h1>Ремонтная мастерская</h1>
<a href=# onclick=hrefToFrame('city.php?cp')> ← выйти из мастерской</a><br> <a href=# onclick=hrefToFrame('city.php?cp')> ← выйти из мастерской</a><br>
<div class="appblock appblock-main"> <div class="appblock appblock-main">
@ -205,6 +198,4 @@ if ($goto == 'podgon') {
} }
} }
?> ?>
</TABLE> </TABLE>
</body>
</html>

View File

@ -91,7 +91,7 @@ switch ($shopCategoryTypeNumber) {
break; break;
} }
if (false == $saleItems) { if (!$saleItems) {
$shopItems = db::c()->query('SELECT `shop`.*, $shopItems = db::c()->query('SELECT `shop`.*,
`magic`.`name` AS `magic_name`, `magic`.`name` AS `magic_name`,
`magic`.`chanse` AS `magic_chanse`, `magic`.`chanse` AS `magic_chanse`,
@ -130,7 +130,7 @@ ORDER BY `update` DESC', null, $_SESSION['uid']);
} }
$sellItemId = filter_input(INPUT_GET, 'sell'); $sellItemId = $_GET['sell'] ?? 0;
if ($sellItemId) { if ($sellItemId) {
$dress = db::c()->query('SELECT `id`, `name`, `cost`, `koll` FROM `inventory` WHERE `dressed` = 0 AND `artefact` = 0 AND `id` = ?i AND `owner` = ?i', $sellItemId, $user['id'])->fetch_assoc(); $dress = db::c()->query('SELECT `id`, `name`, `cost`, `koll` FROM `inventory` WHERE `dressed` = 0 AND `artefact` = 0 AND `id` = ?i AND `owner` = ?i', $sellItemId, $user['id'])->fetch_assoc();
@ -142,9 +142,14 @@ if ($sellItemId) {
$allcost = mt_rand(0, $dress['cost'] / 2); $allcost = mt_rand(0, $dress['cost'] / 2);
db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $dress['id']); db::c()->query('DELETE FROM `inventory` WHERE `id` = ?i', $dress['id']);
//todo подключить банковский класс
db::c()->query('UPDATE `users` SET `money` = `money` + ?i WHERE `id` = ?i', $allcost, $_SESSION['uid']); db::c()->query('UPDATE `users` SET `money` = `money` + ?i WHERE `id` = ?i', $allcost, $_SESSION['uid']);
if ($allcost == 0) $status = "После длительных и изнурительных торгов вы плюнули на всё и просто подарили ваш «{$dress['name']}» торговцу."; if ($allcost == 0) {
else $status = "Вы продали «{$dress['name']}» $kols за " . $allcost . " кр."; $status = "После длительных и изнурительных торгов вы плюнули на всё и просто подарили ваш «{$dress['name']}» торговцу.";
} else {
$status = "Вы продали «{$dress['name']}» $kols за " . $allcost . " кр.";
}
$deloText = "{$user['login']} продал товар «{$dress['name']}» {$kols}id:({$dress['id']}) в магазине за {$allcost} кр."; $deloText = "{$user['login']} продал товар «{$dress['name']}» {$kols}id:({$dress['id']}) в магазине за {$allcost} кр.";
addToDelo($deloText); addToDelo($deloText);
// Для обновления данных о деньгах на странице // Для обновления данных о деньгах на странице
@ -155,8 +160,10 @@ if (!empty($_GET['buy'])) {
$dress = db::c()->query('SELECT * FROM `shop` WHERE `id`=?i', $_GET['buy'])->fetch_assoc(); $dress = db::c()->query('SELECT * FROM `shop` WHERE `id`=?i', $_GET['buy'])->fetch_assoc();
$itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $_SESSION['uid'])->fetch_assoc(); $itemWeight = db::c()->query('SELECT sum(`massa`) AS `m` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $_SESSION['uid'])->fetch_assoc();
if (($dress['massa'] + $itemWeight['m']) > (get_meshok())) $status = 'Недостаточно места в рюкзаке.'; if (($dress['massa'] + $itemWeight['m']) > (get_meshok())) {
elseif ($user['money'] >= $dress['cost'] AND ($dress['count'] > 0 OR $dress['count'] == -1)) { $status = 'Недостаточно места в рюкзаке.';
}
elseif ($user['money'] >= $dress['cost'] && ($dress['count'] > 0 || $dress['count'] == -1)) {
$newItem = [ $newItem = [
'prototype' => $dress['id'], 'prototype' => $dress['id'],
'owner' => $user['id'], 'owner' => $user['id'],
@ -227,7 +234,9 @@ if (!empty($_GET['buy'])) {
db::c()->query('INSERT INTO `inventory` SET ?A[?i,?i,"?s",?i,?i,?i,"?s",?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i]', $newItem); db::c()->query('INSERT INTO `inventory` SET ?A[?i,?i,"?s",?i,?i,?i,"?s",?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i,?i]', $newItem);
$inventoryItemId = db::c()->getLastInsertId(); $inventoryItemId = db::c()->getLastInsertId();
if ($dress['count'] != -1) db::c()->query('UPDATE `shop` SET `count` = `count` - 1 WHERE `id` = ?i', $_GET['buy']); if ($dress['count'] != -1) {
db::c()->query('UPDATE `shop` SET `count` = `count` - 1 WHERE `id` = ?i', $_GET['buy']);
}
$status = "Вы купили «{$dress['name']}» за {$dress['cost']} кр."; $status = "Вы купили «{$dress['name']}» за {$dress['cost']} кр.";
db::c()->query('UPDATE `users` set `money` = `money` - ?i WHERE `id` = ?i', $dress['cost'], $_SESSION['uid']); db::c()->query('UPDATE `users` set `money` = `money` - ?i WHERE `id` = ?i', $dress['cost'], $_SESSION['uid']);
$deloText = "{$user['login']} купил товар «{$dress['name']}» id:({$inventoryItemId}) в магазине за {$dress['cost']} кр."; $deloText = "{$user['login']} купил товар «{$dress['name']}» id:({$inventoryItemId}) в магазине за {$dress['cost']} кр.";
@ -239,15 +248,9 @@ if (!empty($_GET['buy'])) {
$status = "Недостаточно денег или нет вещей в наличии."; $status = "Недостаточно денег или нет вещей в наличии.";
} }
} }
Template::header('Магазин');
?> ?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="css/main.css" rel="stylesheet"/>
<script src="js/main.js"></script> <script src="js/main.js"></script>
</head>
<body>
<h1>Государственный магазин</h1> <h1>Государственный магазин</h1>
<a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a> <a href=# onclick=hrefToFrame('city.php?cp')> ← выйти на Центральную площадь</a>
<div><?php if (!empty($status)) err($status); ?></div> <div><?php if (!empty($status)) err($status); ?></div>
@ -317,6 +320,4 @@ if (!empty($_GET['buy'])) {
<div id="hint3" class="ahint"></div> <div id="hint3" class="ahint"></div>
</TD> </TD>
</TR> </TR>
</TABLE> </TABLE>
</BODY>
</HTML>

View File

@ -1,366 +0,0 @@
<?php
$log = file("backup/battle_stat/battle" . $_REQUEST['log'] . ".txt");
$unique = [];
$hits = [];
foreach ($log as $k) {
$r = explode("|", $k);
if (!$r[2]) {
$r[2] = 665;
}
$hits[][$r[0]]['hits'] = $r[1];
if (!in_array($r[0], $unique)) {
$unique[] = $r[0];
}
}
?>
<html>
<head>
<link rel="stylesheet" href="css/main.css"/>
<meta charset=utf-8">
<style>
.b3 {
font-weight: bold;
color: #269088;
}
.b4 {
font-weight: bold;
color: #A0AF20;
}
.b5 {
font-weight: bold;
color: #0F79D3;
}
.b6 {
font-weight: bold;
color: #D85E23;
}
.b7 {
font-weight: bold;
color: #5C832F;
}
.b8 {
font-weight: bold;
color: #842B61;
}
.b9 {
font-weight: bold;
color: navy;
}
</style>
</head>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=e2e0e0>
<h3>Статистика боя</h3>
Тип боя:
Продолжительность боя: мин.
<FORM METHOD=GET ACTION="logs.php">
<INPUT TYPE=hidden name=analiz value="1293752125.55927">
<INPUT TYPE=submit name=log2 value="Лог боя">
</FORM>
<H4>Последовательность ударов</H4>
<TABLE border=1 cellspacing=0 cellpadding=4>
<TR>
<TD align=center>Логин</TD>
<TD>Удар в</TD>
<TD>Последовательность ударов</TD>
</TR>
<?php
$an = "<font color=\"#e2e2e2\">";
$an2 = "</font>";
asort($unique);
foreach ($unique as $u) {
echo "
<TR>
<TD align=left>" . $u . "</TD>
<TD align=right><code>голову<br>грудь<br>живот<br>пояс<br>ноги</code></TD>
<TD>";
$c = count($hits);
$excl = [2, 3, 4, 5];
for ($i = 0; $i <= $c; $i++) {
if (!$hits[$i][$u]['hits']) {
$i++;
}
if ($hits[$i][$u]['hits'] == 1) {
echo "<b>X</b>";
} elseif ($hits[$i][$u]['hits'] == 665) {
echo "<font color=\"green\"><b>X</b></font>";
} elseif (in_array($hits[$i][$u]['hits'], $excl)) {
echo "$an<b>X</b>$an2";
}
}
echo "<br>";
$excl = [1, 3, 4, 5, 665];
for ($i = 0; $i < $c; $i++) {
if (!$hits[$i][$u]['hits']) {
$i++;
}
if ($hits[$i][$u]['hits'] == 2) {
echo "<b>X</b>";
} elseif (in_array($hits[$i][$u]['hits'], $excl)) {
echo "$an<b>X</b>$an2";
}
}
echo "<br>";
$excl = [1, 2, 4, 5, 665];
for ($i = 0; $i < $c; $i++) {
if (!$hits[$i][$u]['hits']) {
$i++;
}
if ($hits[$i][$u]['hits'] == 3) {
echo "<b>X</b>";
} elseif (in_array($hits[$i][$u]['hits'], $excl)) {
echo "$an<b>X</b>$an2";
}
}
echo "<br>";
$excl = [1, 3, 2, 5, 665];
for ($i = 0; $i < $c; $i++) {
if (!$hits[$i][$u]['hits']) {
$i++;
}
if ($hits[$i][$u]['hits'] == 4) {
echo "<b>X</b>";
} elseif (in_array($hits[$i][$u]['hits'], $excl)) {
echo "$an<b>X</b>$an2";
}
}
echo "<br>";
$excl = [1, 3, 4, 2, 665];
for ($i = 0; $i < $c; $i++) {
if (!$hits[$i][$u]['hits']) {
$i++;
}
if ($hits[$i][$u]['hits'] == 5) {
echo "<b>X</b>";
} elseif (in_array($hits[$i][$u]['hits'], $excl)) {
echo "$an<b>X</b>$an2";
}
}
echo "<br>";
echo "
</TD>
</TR>
";
}
?>
</TABLE>
(<b>X</b>&nbsp;-&nbsp;удачный&nbsp;удар, <font color=red><B>X</B></font>&nbsp;-&nbsp;критический&nbsp;удар, <font
color=red><B><code>&Xi;</code></B></font>&nbsp;-&nbsp;крит + инвалидность, <font color=006600><B>X</B></font>&nbsp;-&nbsp;доп.&nbsp;магический&nbsp;удар,<BR>
&nbsp;<B>&bull;</B>&nbsp;-&nbsp;противник&nbsp;блокировал&nbsp;удар, <font color=AAAAAA><B>&bull;</B></font>&nbsp;-&nbsp;увернулся,
<font color=AAAAEE><B>&bull;</B></font>&nbsp;-&nbsp;парировал, <font color=777777><B>&bull;</B></font>&nbsp;-&nbsp;отбил
удар щитом)
<H4>Последовательность блоков</H4>
<TABLE border=1 cellspacing=0 cellpadding=4>
<TR>
<TD align=center>Логин</TD>
<TD>Блок</TD>
<TD>Последовательность блоков</TD>
</TR>
<?
$unique = [];
$hits = [];
foreach ($log as $k) {
$r = explode("|", $k);
if (!$r[2]) {
$r[2] = 665;
}
$defs = explode(",", $r[2]);
foreach ($defs as $k => $dd) {
$hits[][$r[0]]['defs'][$k] = $dd;
}
if (!in_array($r[0], $unique)) {
$unique[] = $r[0];
}
}
$an = "<font color=\"#e2e2e2\">";
$an2 = "</font>";
asort($unique);
foreach ($unique as $u) {
echo "<TR><TD align=left>" . $u . "</TD><TD align=right><code>голова<br>грудь<br>живот<br>пояс<br>ноги</code></TD><TD>";
$c = count($hits) - 1;
$excl = ["00", "01", "10", "11"];
for ($i = 0; $i <= $c; $i++) {
if (!in_array($hits[$i][$u]['defs'][0], $excl)) {
$i++;
}
if ($hits[$i][$u]['defs'][0] == "11") {
echo "<b>X</b>";
} elseif ($hits[$i][$u]['defs'][0] == "10") {
echo "<b>•</b>";
} else {
echo "$an<b>X</b>$an2";
}//}
}
echo "<br>";
for ($i = 0; $i <= $c; $i++) {
if (!in_array($hits[$i][$u]['defs'][1], $excl)) {
$i++;
}
if ($hits[$i][$u]['defs'][1] == "11") {
echo "<b>X</b>";
} elseif ($hits[$i][$u]['defs'][1] == "10") {
echo "<b>•</b>";
} else {
echo "$an<b>X</b>$an2";
}//}
}
echo "<br>";
for ($i = 0; $i <= $c; $i++) {
if (!in_array($hits[$i][$u]['defs'][2], $excl)) {
$i++;
}
if ($hits[$i][$u]['defs'][2] == "11") {
echo "<b>X</b>";
} elseif ($hits[$i][$u]['defs'][2] == "10") {
echo "<b>•</b>";
} else {
echo "$an<b>X</b>$an2";
}//}
}
echo "<br>";
for ($i = 0; $i <= $c; $i++) {
if (!in_array($hits[$i][$u]['defs'][3], $excl)) {
$i++;
}
if ($hits[$i][$u]['defs'][3] == "11") {
echo "<b>X</b>";
} elseif ($hits[$i][$u]['defs'][3] == "10") {
echo "<b>•</b>";
} else {
echo "$an<b>X</b>$an2";
}//}
}
echo "<br>";
for ($i = 0; $i <= $c; $i++) {
if (!in_array($hits[$i][$u]['defs'][4], $excl)) {
$i++;
}
if ($hits[$i][$u]['defs'][4] == "11") {
echo "<b>X</b>";
} elseif ($hits[$i][$u]['defs'][4] == "10") {
echo "<b>•</b>";
} else {
echo "$an<b>X</b>$an2";
}//}
}
echo "</TD></TR>";
}
?>
</TABLE>
(<b>X</b>&nbsp;-&nbsp;удачный блок, <b><FONT COLOR=red>X</FONT></b>&nbsp;-&nbsp;пробили блок критом, <B>&bull;</B>&nbsp;-&nbsp;пропустил
удар,
<font color=#AAAAAA><B>&bull;</B></font>&nbsp;-&nbsp;увернулся
<font color=#AAAAEE><B>&bull;</B></font>&nbsp;-&nbsp;парировал
<font color=#777777><B>&bull;</B></font>&nbsp;-&nbsp;отбил щитом)
<?php
$summary = file("backup/stat/battle" . $_REQUEST['log'] . ".txt");
$hit[] = [];
$where_hit[] = [];
$team1_users[] = [];
$team2_users[] = [];
$sum_hp1 = [];
$sum_hp2 = [];
//$data['t1']
//$data['t2']
echo "<br/><br/><br/>";
foreach ($summary as $k) {
//echo $k.'<br/>';
$r = explode("|", $k);
if ($r[5] == 'udar') {
$hit[$r[0]] += $r[6];
}
if ($r[0] == 'user_team1') {
$team1_users[$r[1]] = $r[2];
}
if ($r[0] == 'user_team2') {
$team2_users[$r[1]] = $r[2];
}
if ($r[1] == 'B1' or $r[1] == 'B2') {
$where_hit[$r[0]][$r[4]] += 1;
}
}
?>
<H4>Суммарно</H4>
<TABLE border=1 cellspacing=0 cellpadding=4>
<TR>
<TD align=center>Логин</TD>
<TD>Удары</TD>
<TD>Блоки</TD>
<TD>Попадания</TD>
<TD>Защита</TD>
<TD>Урон</TD>
<TD>Потери</TD>
<TD>Вылечено</TD>
</TR>
<?php
if (strpos($data['t1'], ';')) {
$team1 = explode(";", $data['t1']);
} else {
$team1[0] = $data['t1'];
}
for ($i = 0; $i < count($team1); $i++) {
$sData = substr($team1_users[$team1[$i]], -12);
preg_match('/\[(.*?)\//', $sData, $rgMatches1);
$sum_hp1[1] += substr($rgMatches1[0], 1, strlen($rgMatches1[0]) - 1);
preg_match('/\/(.*?)\]/', $sData, $rgMatches2);
$sum_hp1[2] += substr($rgMatches2[0], 1, strlen($rgMatches2[0]) - 1);
echo "<TR><TD align=right>" . $team1_users[$team1[$i]] . "</TD><TD>" . (!empty($where_hit[$team1[$i]][1]) ? $where_hit[$team1[$i]][1] : 0) . "/" . (!empty($where_hit[$team1[$i]][2]) ? $where_hit[$team1[$i]][2] : 0) . "/" . (!empty($where_hit[$team1[$i]][3]) ? $where_hit[$team1[$i]][3] : 0) . "/" . (!empty($where_hit[$team1[$i]][4]) ? $where_hit[$team1[$i]][4] : 0) . "/" . (!empty($where_hit[$team1[$i]][5]) ? $where_hit[$team1[$i]][5] : 0) . "</TD><TD>0/0/0/0/0</TD><TD align=center>0(<font color=red>0</font>)0</TD><TD align=center>0/0/0</TD><TD align=center>0/<font color=red>0</font></TD><TD align=center>0</TD><TD align=center>0</TD></tr>";
}
echo "<TR><TD align=right><span class=B1>Всего[" . $sum_hp1[1] . "/" . $sum_hp1[2] . "]<span></TD><TD></TD><TD></TD><TD align=center>0</TD><TD align=center>0</TD><TD align=center>0</TD><TD align=center>0</TD><TD align=center>0</TD></tr>";
if (strpos($data['t2'], ';')) {
$team2 = explode(";", $data['t2']);
} else {
$team2[0] = $data['t2'];
}
for ($i = 0; $i < count($team2); $i++) {
$sData = substr($team2_users[$team2[$i]], -12);
preg_match('/\[(.*?)\//', $sData, $rgMatches1);
$sum_hp2[1] += substr($rgMatches1[0], 1, strlen($rgMatches1[0]) - 1);
preg_match('/\/(.*?)\]/', $sData, $rgMatches2);
$sum_hp2[2] += substr($rgMatches2[0], 1, strlen($rgMatches2[0]) - 1);
echo "<TR><TD align=right>" . $team2_users[$team2[$i]] . "</TD><TD>" . (!empty($where_hit[$team2[$i]][1]) ? $where_hit[$team2[$i]][1] : 0) . "/" . (!empty($where_hit[$team2[$i]][2]) ? $where_hit[$team2[$i]][2] : 0) . "/" . (!empty($where_hit[$team2[$i]][3]) ? $where_hit[$team2[$i]][3] : 0) . "/" . (!empty($where_hit[$team2[$i]][4]) ? $where_hit[$team2[$i]][4] : 0) . "/" . (!empty($where_hit[$team2[$i]][5]) ? $where_hit[$team2[$i]][5] : 0) . "</TD><TD>0/0/0/0/0</TD><TD align=center>0(<font color=red>0</font>)0</TD><TD align=center>0/0/0</TD><TD align=center>0/<font color=red>0</font></TD><TD align=center>0</TD><TD align=center>0</TD></tr>";
}
echo "<TR><TD align=right><span class=B2>Всего[" . $sum_hp2[1] . "/" . $sum_hp2[2] . "]</span></TD><TD></TD><TD></TD><TD align=center>0</TD><TD align=center>0</TD><TD align=center>0</TD><TD align=center>0</TD><TD align=center>0</TD></tr>";
?>
</TABLE>
Логин - имя персонажа и уровень жизни: [сейчас/всего]<BR>
Удары - статистика ударов по областям: голова/грудь/живот/пояс/ноги<BR>
Блоки - статистика блоков по областям: голова/грудь/живот/пояс/ноги<BR>
Попадания - удачных попаданий <FONT COLOR=red>(из них критов)</FONT> / всего ударов<BR>
Защита - ударов заблокировано / уворотов / пропущено ударов<BR>
Урон - выбито HP из противников / из них <FONT COLOR=red>критами</FONT><BR>
Потери - получено повреждений <BR>
Вылечено - восстановлено HP<BR>
</BODY>
</HTML>

View File

@ -1,7 +1,4 @@
<!DOCTYPE html> <?= Template::header('top_menu', 1) ?>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/btn.css">
<style> <style>
* { * {
margin: 0; margin: 0;

View File

@ -12,19 +12,16 @@ if ($user->battle) {
exit; exit;
} }
$Tournament = new Tournament(); $Tournament = new Tournament();
Template::header('Турниры');
?> ?>
<HTML> <META HTTP-EQUIV="REFRESH" CONTENT="10">
<HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-type>
</head>
<body style="background-image:url('/i/tournament/tournament2.jpg');background-repeat:no-repeat;background-position:center top;">
<div style='color:#8F0000; font-weight:bold; font-size:16px; text-align:center; float:left;'>Турнирная</div> <div style='color:#8F0000; font-weight:bold; font-size:16px; text-align:center; float:left;'>Турнирная</div>
<div style="float: right; padding-right: 6px;"> <div style="float: right; padding-right: 6px;">
<input type="button" onclick="window.location='main.php?setch=1'" value="Вернуться"> <input type="button" onclick="window.location='main.php?setch=1'" value="Вернуться">
</div> </div>
<br> <br>
<?php <?php
if (count($_POST) > 0) { if (!empty($_POST)) {
if ($_POST['newtournament']) { if ($_POST['newtournament']) {
$Tournament->CreateTournament("Еженедельные турниры"); $Tournament->CreateTournament("Еженедельные турниры");
} }
@ -42,12 +39,6 @@ if (count($_POST) > 0) {
} }
} }
//$Tournir->CreateHTML(7);
//echo $dateTime=mktime(20, 20, 0, 03, 31, 2010);
//$Tournir->PrepearTournir();
$dateD = mysql_fetch_row(mysql_query("select datetime from turnament where old=0 limit 1")); $dateD = mysql_fetch_row(mysql_query("select datetime from turnament where old=0 limit 1"));
if (mktime() >= ($dateD[0] + 10)) { if (mktime() >= ($dateD[0] + 10)) {
@ -61,21 +52,10 @@ if (mktime() >= ($dateD[0] + 10)) {
$Tournament->ShowTournirFinaliats(); $Tournament->ShowTournirFinaliats();
?> ?>
<form method="post"> <form method="post">
<?php <?php if ($user->admin) { ?>
if ($user['align'] == 2.99) { <div>
?> <input type="submit" name="newtournament" value="Добавить новый турнир">
<table> <input type="submit" name="preptournament" value="Приготовить турнир и запустить">
<tr> </div>
<td>Добавление нового турнира</td> <?php } ?>
<td><input type="submit" name="newtournament" value="Добавить"></td> </form>
<td>Приготовить турнир и запустить</td>
<td><input type="submit" name="preptournament" value="Добавить"></td>
</tr>
</table>
<?php
}
?>
</form>
<META HTTP-EQUIV="REFRESH" CONTENT="10">
</body>
</html>

View File

@ -98,16 +98,8 @@ if ($_GET['st'] == 'startmegaturnirnow') {
} }
$tr = $bania->get_turnir(); $tr = $bania->get_turnir();
$bania->get_fond(); $bania->get_fond();
Template::header('Башня смерти')
?> ?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<meta content="text/html; charset=utf-8" http-equiv="Content-type"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="PRAGMA" content="NO-CACHE"/>
<meta http-equiv="Expires" content="0"/>
</head>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e2e0e0>
<table border=0 width=100% cellspacing="0" cellpadding="0"> <table border=0 width=100% cellspacing="0" cellpadding="0">
<td align=right> <td align=right>
<form action="city.php" method="GET"> <form action="city.php" method="GET">
@ -203,7 +195,4 @@ $bania->get_fond();
class="date"><? echo floor(($data['endtime'] - $data['start_time']) / 60 / 60); ?> class="date"><? echo floor(($data['endtime'] - $data['start_time']) / 60 / 60); ?>
ч. <? echo floor(($data['endtime'] - $data['start_time']) / 60 - floor(($data['endtime'] - $data['start_time']) / 60 / 60) * 60); ?> ч. <? echo floor(($data['endtime'] - $data['start_time']) / 60 - floor(($data['endtime'] - $data['start_time']) / 60 / 60) * 60); ?>
мин.</font>, приз : <b><? echo $data['coin']; ?> кр.</b> <a href="/towerlog.php?id=<? echo $data['id']; ?>" мин.</font>, приз : <b><? echo $data['coin']; ?> кр.</b> <a href="/towerlog.php?id=<? echo $data['id']; ?>"
target="_blank">История турнира »»</a><br/> target="_blank">История турнира »»</a><br/>
</body>
</html>

View File

@ -279,55 +279,37 @@ if ($user['hp'] <= 0) {
header('Location: tower.php'); header('Location: tower.php');
exit; exit;
} }
Template::header('towerin');
?> ?>
<HTML> <script>
<HEAD> let Hint3Name = '';
<link rel=stylesheet type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv=Content-type>
<META Http-Equiv=Cache-Control Content=no-cache>
<meta http-equiv=PRAGMA content=NO-CACHE>
<META HTTP-EQUIV=Expires CONTENT=0>
<META HTTP-EQUIV=imagetoolbar CONTENT=no>
<style>
.H3 {
color: #8f0000;
font-family: Arial;
font-size: 12pt;
font-weight: bold;
}
</style>
<script>
let Hint3Name = '';
function findlogin(title, script, name) { function findlogin(title, script, name) {
document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' + document.all("hint3").innerHTML = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>' + title + '</td><td width=20 align=right valign=top style="cursor: pointer" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>' +
'<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="<? echo @$user['id']; ?>"><td colspan=2>' + '<form action="' + script + '" method=POST><table width=100% cellspacing=0 cellpadding=2 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=sd4 value="<? echo @$user['id']; ?>"><td colspan=2>' +
'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>'; 'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right><INPUT TYPE=text NAME="' + name + '"></TD><TD width=50%><INPUT TYPE="submit" value=" »» "></TD></TR></TABLE></FORM></td></tr></table>';
document.all("hint3").style.visibility = "visible"; document.all("hint3").style.visibility = "visible";
document.all("hint3").style.left = 100; document.all("hint3").style.left = 100;
document.all("hint3").style.top = 100; document.all("hint3").style.top = 100;
document.all(name).focus(); document.all(name).focus();
Hint3Name = name; Hint3Name = name;
} }
function returned2(s) { function returned2(s) {
if (top.oldlocation != '') { if (top.oldlocation != '') {
top.frames['main'].navigate(top.oldlocation + '?' + s + 'tmp=' + Math.random()); top.frames['main'].navigate(top.oldlocation + '?' + s + 'tmp=' + Math.random());
top.oldlocation = ''; top.oldlocation = '';
} else { } else {
top.frames['main'].navigate('main.php?' + s + 'tmp=' + Math.random()); top.frames['main'].navigate('main.php?' + s + 'tmp=' + Math.random());
} }
} }
function closehint3() { function closehint3() {
document.all("hint3").style.visibility = "hidden"; document.all("hint3").style.visibility = "hidden";
Hint3Name = ''; Hint3Name = '';
} }
</script> </script>
</head> <div id=hint4 class=ahint></div>
<body leftmargin=2 topmargin=2 marginwidth=2 marginheight=2 bgcolor=e2e0e0
onload="top.setHP(<?= $user['hp'] ?>,<?= $user['maxhp'] ?>,1); ">
<div id=hint4 class=ahint></div>
<TABLE width=100% cellspacing=0 cellpadding=0> <TABLE width=100% cellspacing=0 cellpadding=0>
<TR> <TR>
@ -337,453 +319,454 @@ if ($user['hp'] <= 0) {
onclick="findlogin('Напасть на','towerin.php','attack')"> onclick="findlogin('Напасть на','towerin.php','attack')">
</TD> </TD>
<TR> <TR>
<TD valign=top> <TD valign=top>
<FONT COLOR=red></FONT> <FONT COLOR=red></FONT>
<? <?
$its = mysql_query("SELECT * FROM `deztow_items` WHERE `room` = '" . $user->room . "';"); $its = mysql_query("SELECT * FROM `deztow_items` WHERE `room` = '" . $user->room . "';");
if (mysql_num_rows($its) > 0) { if (mysql_num_rows($its) > 0) {
echo '<H4>В комнате разбросаны вещи:</H4>'; echo '<H4>В комнате разбросаны вещи:</H4>';
}
while ($it = mysql_fetch_array($its)) {
echo ' <A HREF="towerin.php?give=', $it['id'], '"><IMG SRC="i/sh/', $it['img'], '" ALT="Подобрать предмет \'', $it['name'], '\'"></A>';
}
?>
</TD>
<TD colspan=3 valign=top align=right nowrap>
<link href="css/design4.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function fastshow2(content) {
const el = document.getElementById("mmoves");
const o = window.event.srcElement;
if (content == '') {
el.innerHTML = '';
} }
if (content != '' && el.style.visibility != "visible") { while ($it = mysql_fetch_array($its)) {
el.innerHTML = '<small>' + content + '</small>'; echo ' <A HREF="towerin.php?give=', $it['id'], '"><IMG SRC="i/sh/', $it['img'], '" ALT="Подобрать предмет \'', $it['name'], '\'"></A>';
} }
let x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft - el.offsetWidth + 5; ?>
let y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop + 20; </TD>
<TD colspan=3 valign=top align=right nowrap>
<link href="css/design4.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function fastshow2(content) {
const el = document.getElementById("mmoves");
const o = window.event.srcElement;
if (x + el.offsetWidth + 3 > document.body.clientWidth + document.body.scrollLeft) { if (content == '') {
x = (document.body.clientWidth + document.body.scrollLeft - el.offsetWidth - 5); el.innerHTML = '';
if (x < 0) { }
x = 0 if (content != '' && el.style.visibility != "visible") {
el.innerHTML = '<small>' + content + '</small>';
}
let x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft - el.offsetWidth + 5;
let y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop + 20;
if (x + el.offsetWidth + 3 > document.body.clientWidth + document.body.scrollLeft) {
x = (document.body.clientWidth + document.body.scrollLeft - el.offsetWidth - 5);
if (x < 0) {
x = 0
}
}
if (y + el.offsetHeight + 3 > document.body.clientHeight + document.body.scrollTop) {
y = (document.body.clientHeight + document.body.scrollTop - el.offsetHeight - 3);
if (y < 0) {
y = 0
}
}
if (x < 0) {
x = 0;
}
if (y < 0) {
y = 0;
}
el.style.left = x + "px";
el.style.top = y + "px";
if (el.style.visibility != "visible") {
el.style.visibility = "visible";
}
} }
} function hideshow() {
document.getElementById("mmoves").style.visibility = 'hidden';
if (y + el.offsetHeight + 3 > document.body.clientHeight + document.body.scrollTop) {
y = (document.body.clientHeight + document.body.scrollTop - el.offsetHeight - 3);
if (y < 0) {
y = 0
} }
} let solo_store;
if (x < 0) { function solo(n, name) {
x = 0; if (check_access() == true) {
} window.location.href = '?path=' + n + '&rnd=' + Math.random();
if (y < 0) { } else if (name && n) {
y = 0; solo_store = n;
} const add_text = (document.getElementById('add_text') || document.createElement('div'));
el.style.left = x + "px"; add_text.id = 'add_text';
el.style.top = y + "px"; add_text.innerHTML = 'Вы перейдете в: <strong>' + name + '</strong> (<a href="#" onclick="return clear_solo();">отмена</a>)';
if (el.style.visibility != "visible") { document.getElementById('ione').parentNode.parentNode.nextSibling.firstChild.appendChild(add_text);
el.style.visibility = "visible"; ch_counter_color('red');
} }
} return false;
}
function hideshow() { function clear_solo() {
document.getElementById("mmoves").style.visibility = 'hidden'; document.getElementById('add_text').removeNode(true);
} solo_store = false;
ch_counter_color('#00CC00');
return false;
}
let solo_store; let from_map = false;
function solo(n, name) { function imover(im) {
if (check_access() == true) { im.filters.Glow.Enabled = true;
window.location.href = '?path=' + n + '&rnd=' + Math.random(); if (from_map == false && im.id.match(/mo_(\d)/) && document.getElementById('b' + im.id)) {
} else if (name && n) { from_map = true;
solo_store = n; document.getElementById('b' + im.id).runtimeStyle.color = '#666666';
const add_text = (document.getElementById('add_text') || document.createElement('div')); from_map = false;
add_text.id = 'add_text'; }
add_text.innerHTML = 'Вы перейдете в: <strong>' + name + '</strong> (<a href="#" onclick="return clear_solo();">отмена</a>)'; }
document.getElementById('ione').parentNode.parentNode.nextSibling.firstChild.appendChild(add_text);
ch_counter_color('red');
}
return false;
}
function clear_solo() { function imout(im) {
document.getElementById('add_text').removeNode(true); im.filters.Glow.Enabled = false;
solo_store = false; if (from_map == false && im.id.match(/mo_(\d)/) && document.getElementById('b' + im.id)) {
ch_counter_color('#00CC00'); from_map = true;
return false; document.getElementById('b' + im.id).runtimeStyle.color = document.getElementById('b' + im.id).style.color;
} from_map = false;
}
}
let from_map = false; function bimover(im) {
if (from_map == false && document.getElementById(im.id.substr(1)) {
from_map = true;
imover(document.getElementById(im.id.substr(1)));
from_map = false;
}
}
function imover(im) { function bimout(im) {
im.filters.Glow.Enabled = true; if (from_map == false && document.getElementById(im.id.substr(1))) {
if (from_map == false && im.id.match(/mo_(\d)/) && document.getElementById('b' + im.id)) { from_map = true;
from_map = true; imout(document.getElementById(im.id.substr(1)));
document.getElementById('b' + im.id).runtimeStyle.color = '#666666'; from_map = false;
from_map = false; }
} }
}
function imout(im) { function bsolo(im) {
im.filters.Glow.Enabled = false; if (document.getElementById(im.id.substr(1))) {
if (from_map == false && im.id.match(/mo_(\d)/) && document.getElementById('b' + im.id)) { document.getElementById(im.id.substr(1)).click();
from_map = true; }
document.getElementById('b' + im.id).runtimeStyle.color = document.getElementById('b' + im.id).style.color; return false;
from_map = false; }
}
}
function bimover(im) { function Down() {
if (from_map == false && document.getElementById(im.id.substr(1)) { top.CtrlPress = window.event.ctrlKey;
from_map = true; }
imover(document.getElementById(im.id.substr(1)));
from_map = false;
}
}
function bimout(im) { document.onmousedown = Down;
if (from_map == false && document.getElementById(im.id.substr(1))) { </script>
from_map = true; <style type="text/css">
imout(document.getElementById(im.id.substr(1))); img.aFilter {
from_map = false; filter: Glow(color=, Strength=, Enabled=0);
} cursor: pointer;
} }
function bsolo(im) { hr {
if (document.getElementById(im.id.substr(1))) { height: 1px;
document.getElementById(im.id.substr(1)).click(); }
} </style>
return false;
}
function Down() { <table border="0" cellpadding="0" cellspacing="0">
top.CtrlPress = window.event.ctrlKey; <tr align="right" valign="top">
} <td>
<table cellpadding="0" cellspacing="0" border="0" width="1">
document.onmousedown = Down; <tr>
</script> <td>
<style type="text/css"> <div style="position:relative; cursor: pointer;" id="ione"><img
img.aFilter { src="i/tower/<?= (500 + $user->room) ?>.jpg" alt="" border="1"/>
filter: Glow(color=, Strength=, Enabled=0); </div>
cursor: pointer; </td>
} </tr>
<tr>
hr { <td align="right">
height: 1px; <div align="right" id="btransfers">
} <table cellpadding="0" cellspacing="0" border="0" id="bmoveto">
</style>
<table border="0" cellpadding="0" cellspacing="0">
<tr align="right" valign="top">
<td>
<table cellpadding="0" cellspacing="0" border="0" width="1">
<tr>
<td>
<div style="position:relative; cursor: pointer;" id="ione"><img
src="i/tower/<?= (500 + $user->room) ?>.jpg" alt="" border="1"/>
</div>
</td>
</tr>
<tr>
<td align="right">
<div align="right" id="btransfers">
<table cellpadding="0" cellspacing="0" border="0" id="bmoveto">
<tr>
<td bgcolor="#D3D3D3">
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</td>
<td>
<table width="80" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="80" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" align="center"><img src="i/move/navigatin_46.gif" width="80"
height="4"/></td>
</tr>
<tr>
<td colspan="3" align="center">
<table width="80" border="0" cellspacing="0" cellpadding="0">
<tr> <tr>
<td><img src="i/move/navigatin_48.gif" width="9" height="8"/></td> <td bgcolor="#D3D3D3">
<td width="100%" bgcolor="#000000">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap="nowrap" align="center">
<div align="center"
style="font-size:4px;padding:0;border:solid black 0; text-align:center"
id="prcont"></div>
<script language="javascript" type="text/javascript">
let s = "";
for (i = 1; i <= 32; i++) {
s += '<span id="progress' + i + '">&nbsp;</span>';
if (i < 32) {
s += '&nbsp;'
}
}
document.getElementById('prcont').innerHTML = s;
</script>
</td>
</tr>
</table>
</td>
<td><img src="i/move/navigatin_50.gif" width="7" height="8"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="i/move/navigatin_51.gif" width="31" height="8"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_54.gif" width="9" height="20"/><img
src="i/move/navigatin_55i.gif" width="22" height="20"
border="0"/></td>
</tr>
<tr>
<td>
<a onclick="return check('m7');" <? if ($rooms[$rhar[$user->room][4]]) {
echo 'id="m7"';
} ?> href="?rnd=0.817371946556865&path=4"><img
src="i/move/navigatin_59<? if (!$rooms[$rhar[$user->room][4]]) {
echo 'i';
} ?>.gif" width="21" height="20" border="0"
o<? if (!$rooms[$rhar[$user->room][4]]) {
echo 'i';
} ?>nmousemove="fastshow2('<?= $rooms[$rhar[$user->room][4]] ?>');"
onmouseout="hideshow();"/></a><img
src="i/move/navigatin_60.gif" width="10" height="20"
border="0"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_63.gif" width="11" height="21"/><img
src="i/move/navigatin_64i.gif" width="20" height="21"
border="0"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_68.gif" width="31" height="8"/></td>
</tr>
</table>
</td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<a onclick="return check('m1');" <? if ($rooms[$rhar[$user->room][1]]) {
echo 'id="m1"';
} ?> href="?rnd=0.817371946556865&path=1"><img
src="i/move/navigatin_52<? if (!$rooms[$rhar[$user->room][1]]) {
echo 'i';
} ?>.gif" width="19" height="22" border="0"
<? if (!$rooms[$rhar[$user->room][1]]) {
echo 'i';
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][1]] ?>');"
onmouseout="hideshow();"/></a></td>
</tr>
<tr>
<td><a href="?rnd=0.817371946556865"><img src="i/move/navigatin_58.gif"
width="19" height="33"
border="0" o
nmousemove="fastshow2('<strong>Обновить</strong><br />Переходы:<br />Картинная галерея 1<br />Зал ораторов<br />Картинная галерея 3');"
onmouseout="hideshow();"/></a>
</td> </td>
</tr> </tr>
<tr>
<td>
<a onclick="return check('m5');" <? if ($rooms[$rhar[$user->room][3]]) {
echo 'id="m5"';
} ?> href="?rnd=0.817371946556865&path=3"><img
src="i/move/navigatin_67<? if (!$rooms[$rhar[$user->room][3]]) {
echo 'i';
} ?>.gif" width="19" height="22" border="0"
<? if (!$rooms[$rhar[$user->room][3]]) {
echo 'i';
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][3]] ?>');"
onmouseout="hideshow();"/></a></td>
</tr>
</table> </table>
</td> </div>
<td> </td>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> </tr>
<tr> </table>
<td><img src="i/move/navigatin_53.gif" width="30" height="8"/></td> </td>
</tr> <td>
<tr> <table width="80" border="0" cellspacing="0" cellpadding="0">
<td><img src="i/move/navigatin_56i.gif" width="21" height="20" <tr>
border="0"/><img src="i/move/navigatin_57.gif" width="9" <td>
height="20"/></td> <table width="80" border="0" cellspacing="0" cellpadding="0">
</tr> <tr>
<tr> <td colspan="3" align="center"><img src="i/move/navigatin_46.gif"
<td><img src="i/move/navigatin_61.gif" width="8" height="21"/><a width="80"
onclick="return check('m3');" <? if ($rooms[$rhar[$user->room][2]]) { height="4"/></td>
echo 'id="m3"'; </tr>
} ?> href="?rnd=0.817371946556865&path=2"><img <tr>
src="i/move/navigatin_62<? if (!$rooms[$rhar[$user->room][2]]) { <td colspan="3" align="center">
echo 'i'; <table width="80" border="0" cellspacing="0" cellpadding="0">
} ?>.gif" width="22" height="21" border="0" <tr>
<? if (!$rooms[$rhar[$user->room][2]]) { <td><img src="i/move/navigatin_48.gif" width="9"
echo 'i'; height="8"/></td>
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][2]] ?>');" <td width="100%" bgcolor="#000000">
onmouseout="hideshow();"/></a></td> <table border="0" cellspacing="0" cellpadding="0">
</tr> <tr>
<tr> <td nowrap="nowrap" align="center">
<td><img src="i/move/navigatin_65i.gif" width="21" height="20" <div align="center"
border="0"/><img src="i/move/navigatin_66.gif" width="9" style="font-size:4px;padding:0;border:solid black 0; text-align:center"
height="20"/></td> id="prcont"></div>
</tr> <script language="javascript"
<tr> type="text/javascript">
<td><img src="i/move/navigatin_69.gif" width="30" height="8"/></td> let s = "";
</tr> for (i = 1; i <= 32; i++) {
</table> s += '<span id="progress' + i + '">&nbsp;</span>';
</td> if (i < 32) {
</tr> s += '&nbsp;'
}
}
document.getElementById('prcont').innerHTML = s;
</script>
</td>
</tr>
</table>
</td>
<td><img src="i/move/navigatin_50.gif" width="7"
height="8"/></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="i/move/navigatin_51.gif" width="31"
height="8"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_54.gif" width="9"
height="20"/><img
src="i/move/navigatin_55i.gif" width="22"
height="20"
border="0"/></td>
</tr>
<tr>
<td>
<a onclick="return check('m7');" <? if ($rooms[$rhar[$user->room][4]]) {
echo 'id="m7"';
} ?> href="?rnd=0.817371946556865&path=4"><img
src="i/move/navigatin_59<? if (!$rooms[$rhar[$user->room][4]]) {
echo 'i';
} ?>.gif" width="21" height="20" border="0"
o<? if (!$rooms[$rhar[$user->room][4]]) {
echo 'i';
} ?>nmousemove="fastshow2('<?= $rooms[$rhar[$user->room][4]] ?>');"
onmouseout="hideshow();"/></a><img
src="i/move/navigatin_60.gif" width="10"
height="20"
border="0"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_63.gif" width="11"
height="21"/><img
src="i/move/navigatin_64i.gif" width="20"
height="21"
border="0"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_68.gif" width="31"
height="8"/></td>
</tr>
</table>
</td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<a onclick="return check('m1');" <? if ($rooms[$rhar[$user->room][1]]) {
echo 'id="m1"';
} ?> href="?rnd=0.817371946556865&path=1"><img
src="i/move/navigatin_52<? if (!$rooms[$rhar[$user->room][1]]) {
echo 'i';
} ?>.gif" width="19" height="22" border="0"
<? if (!$rooms[$rhar[$user->room][1]]) {
echo 'i';
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][1]] ?>');"
onmouseout="hideshow();"/></a></td>
</tr>
<tr>
<td><a href="?rnd=0.817371946556865"><img
src="i/move/navigatin_58.gif"
width="19" height="33"
border="0" o
nmousemove="fastshow2('<strong>Обновить</strong><br />Переходы:<br />Картинная галерея 1<br />Зал ораторов<br />Картинная галерея 3');"
onmouseout="hideshow();"/></a>
</td>
</tr>
<tr>
<td>
<a onclick="return check('m5');" <? if ($rooms[$rhar[$user->room][3]]) {
echo 'id="m5"';
} ?> href="?rnd=0.817371946556865&path=3"><img
src="i/move/navigatin_67<? if (!$rooms[$rhar[$user->room][3]]) {
echo 'i';
} ?>.gif" width="19" height="22" border="0"
<? if (!$rooms[$rhar[$user->room][3]]) {
echo 'i';
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][3]] ?>');"
onmouseout="hideshow();"/></a></td>
</tr>
</table>
</td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="i/move/navigatin_53.gif" width="30"
height="8"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_56i.gif" width="21"
height="20"
border="0"/><img src="i/move/navigatin_57.gif"
width="9"
height="20"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_61.gif" width="8"
height="21"/><a
onclick="return check('m3');" <? if ($rooms[$rhar[$user->room][2]]) {
echo 'id="m3"';
} ?> href="?rnd=0.817371946556865&path=2"><img
src="i/move/navigatin_62<? if (!$rooms[$rhar[$user->room][2]]) {
echo 'i';
} ?>.gif" width="22" height="21" border="0"
<? if (!$rooms[$rhar[$user->room][2]]) {
echo 'i';
} ?>onmousemove="fastshow2('<?= $rooms[$rhar[$user->room][2]] ?>');"
onmouseout="hideshow();"/></a></td>
</tr>
<tr>
<td><img src="i/move/navigatin_65i.gif" width="21"
height="20"
border="0"/><img src="i/move/navigatin_66.gif"
width="9"
height="20"/></td>
</tr>
<tr>
<td><img src="i/move/navigatin_69.gif" width="30"
height="8"/></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div id="mmoves"
style="background-color:#FFFFCC; visibility:hidden; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px; white-space: nowrap;"></div>
<script language="javascript" type="text/javascript">
const progressEnd = 32;
let progressColor = '#00CC00';
let mtime = parseInt('<?= $_SESSION['uid'] ?>
if (!mtime || mtime <= 0) {
mtime = 0;
}
const progressInterval = Math.round(mtime * 1000 / progressEnd);
let is_accessible = true;
let progressAt = progressEnd;
let progressTimer;
</table> function progress_clear() {
</td> for (let i = 1; i <= progressEnd; i++) {
</tr> document.getElementById('progress' + i).style.backgroundColor = 'transparent';
</table> }
progressAt = 0;
for (let t = 1; t <= 8; t++) {
if (document.getElementById('m' + t)) {
const tempname = document.getElementById('m' + t).children[0].src;
if (tempname.match(/b\.gif$/)) {
document.getElementById('m' + t).children[0].id = 'backend';
}
let newname;
newname = tempname.replace(/(b)?\.gif$/, 'i . gif');
document.getElementById('m' + t).children[0].src = newname;
}
}
is_accessible = false;
set_moveto(true);
}
<table border="0" cellspacing="0" cellpadding="0"> function progress_update() {
<tr> progressAt++;
<td nowrap="nowrap" id="moveto"> if (progressAt > progressEnd) {
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE"> for (let t = 1; t <= 8; t++) {
if (document.getElementById('m' + t)) {
let tempname = document.getElementById('m' + t).children[0].src;
let newname;
newname = tempname.replace(/i\.gif$/, ' . gif');
if (document.getElementById('m' + t).children[0].id == 'backend') {
tempname = newname.replace(/\.gif$/, 'b . gif');
newname = tempname;
}
document.getElementById('m' + t).children[0].src = newname;
}
}
is_accessible = true;
if (window.solo_store && solo_store) {
solo(solo_store);
}
set_moveto(false);
} else {
document.getElementById('progress' + progressAt).style.backgroundColor = progressColor;
progressTimer = setTimeout('progress_update()', progressInterval);
}
}
</table> function set_moveto(val) {
</td> document.getElementById('moveto').disabled = val;
</tr> if (document.getElementById('bmoveto')) {
</table> document.getElementById('bmoveto').disabled = val;
</td> }
</tr> }
</table>
<div id="mmoves"
style="background-color:#FFFFCC; visibility:hidden; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px; white-space: nowrap;"></div>
<script language="javascript" type="text/javascript">
const progressEnd = 32;
let progressColor = '#00CC00';
let mtime = parseInt('<? echo($_SESSION['
if(!mtime || mtime <= 0) { mtime = 0; }
const progressInterval = Math.round(mtime * 1000 / progressEnd);
let is_accessible = true;
let progressAt = progressEnd;
let progressTimer;
function progress_clear() { function progress_stop() {
for(let i = 1; i <= progressEnd; i++) { clearTimeout(progressTimer);
document.getElementById('progress'+i).style.backgroundColor = 'transparent'; progress_clear();
} }
progressAt = 0;
for(let t = 1; t <= 8; t++) {
if(document.getElementById('m'+t) ) {
const tempname = document.getElementById('m' + t).children[0].src;
if(tempname.match(/b\.gif$/)) {
document.getElementById('m'+t).children[0].id = 'backend';
}
let newname;
newname = tempname.replace(/(b)?\.gif$/, 'i . gif');
document.getElementById('m'+t).children[0].src = newname;
}
}
is_accessible = false;
set_moveto(true);
}
function progress_update() { function check(it) {
progressAt++; return is_accessible;
if(progressAt > progressEnd) { }
for(let t = 1; t <= 8; t++) {
if(document.getElementById('m'+t)) {
let tempname = document.getElementById('m' + t).children[0].src;
let newname;
newname = tempname.replace(/i\.gif$/, ' . gif');
if(document.getElementById('m'+t).children[0].id == 'backend') {
tempname = newname.replace(/\.gif$/, 'b . gif');
newname = tempname;
}
document.getElementById('m'+t).children[0].src = newname;
}
}
is_accessible = true;
if(window.solo_store && solo_store) { solo(solo_store); }
set_moveto(false);
} else {
document.getElementById('progress'+progressAt).style.backgroundColor = progressColor;
progressTimer = setTimeout('progress_update()', progressInterval);
}
}
function set_moveto(val) { function check_access() {
document.getElementById('moveto').disabled = val; return is_accessible;
if(document.getElementById('bmoveto')) { }
document.getElementById('bmoveto').disabled = val;
}
}
function progress_stop() { function ch_counter_color(color) {
clearTimeout(progressTimer); progressColor = color;
progress_clear(); for (let i = 1; i <= progressAt; i++) {
} document.getElementById('progress' + i).style.backgroundColor = progressColor;
}
}
function check(it) { if (mtime > 0) {
return is_accessible; progress_clear();
} progress_update();
} else {
function check_access() { for (var i = 1; i <= progressEnd; i++) {
return is_accessible; document.getElementById('progress' + i).style.backgroundColor = progressColor;
} }
}
function ch_counter_color(color) { </script>
progressColor = color; </TD>
for(let i = 1; i <= progressAt; i++) { </TR>
document.getElementById('progress'+i).style.backgroundColor = progressColor;
}
}
if(mtime > 0) {
progress_clear();
progress_update();
} else {
for(var i = 1; i <= progressEnd; i++) {
document.getElementById('progress'+i).style.backgroundColor = progressColor;
}
}
</script>
</TD>
</TR>
</TABLE> </TABLE>
<br /> <br/>
Всего живых участников на данный момент : <b><? echo "<b>".$kol_pl."</b> + <b>".$ls."</b>"; ?></b>...<br /> Всего живых участников на данный момент : <b><? echo "<b>" . $kol_pl . "</b> + <b>" . $ls . "</b>"; ?></b>...<br/>
<div id="hint3" class="ahint"></div> <div id="hint3" class="ahint"></div>
<script>top.onlineReload(true)</script> <script>top.onlineReload(true)</script>
</body>
</html>

View File

@ -1,15 +1,5 @@
<?php <?php
require_once "config.php"; require_once "config.php";
$tr = mysql_fetch_array(mysql_query("SELECT `id`, `coin`, `log` FROM `deztow_turnir` WHERE `id` = '" . mysql_real_escape_string($_GET['id']) . "' LIMIT 1")); $tr = mysql_fetch_array(mysql_query("SELECT `id`, `coin`, `log` FROM `deztow_turnir` WHERE `id` = '" . mysql_real_escape_string($_GET['id']) . "' LIMIT 1"));
?> Template::header('Башня смерти. Отчет о турнире #'. $tr['id']);
<html> echo sprintf('<h3>Башня смерти. Отчет о турнире.</h3><b>%s</b> кр.<br>%s', $tr['coin'], $tr['log']);
<head>
<link rel="stylesheet" href="css/main.css"/>
<meta charset=utf-8">
<title>Башня смерти. Отчет о турнире #<? echo $tr['id']; ?></title>
</head>
<body style="margin: 5px; background-color: #e2e0e0;">
<h3>Башня смерти. Отчет о турнире.</h3>
Призовой фонд : <b><? echo $tr['coin']; ?> кр.</b><br/><? echo $tr['log']; ?><br/>
</body>
</html>

View File

@ -40,16 +40,9 @@ if($_GET['setdef']){
mysql_query("UPDATE `deztow_charstams` SET `def` = 0 WHERE `owner` = '{$user['id']}' AND `id` != ".(int)$_GET['setdef'].""); mysql_query("UPDATE `deztow_charstams` SET `def` = 0 WHERE `owner` = '{$user['id']}' AND `id` != ".(int)$_GET['setdef']."");
echo "<font color=red><b>Сохранено.</b></font>".mysql_error(); echo "<font color=red><b>Сохранено.</b></font>".mysql_error();
} }
Template::header('towerstamp');
?> ?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<meta content="text/html; charset=utf-8" http-equiv="Content-type" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="PRAGMA" content="NO-CACHE" />
<meta http-equiv="Expires" content="0" />
</head>
<body style="background-color: #e2e0e0;">
<h3>Профили характеристик</h3> <h3>Профили характеристик</h3>
Статы не позволяют сходить в БС? Раскиньте ваши статы так, как вы хотите, и участвуйте в турнире! Выбранный по умолчанию профиль, загрузится сам. Вы можете создавать неограниченное число профилей, и менять их за секунды до турнира! Статы не позволяют сходить в БС? Раскиньте ваши статы так, как вы хотите, и участвуйте в турнире! Выбранный по умолчанию профиль, загрузится сам. Вы можете создавать неограниченное число профилей, и менять их за секунды до турнира!
<br /><br /> <br /><br />
@ -111,6 +104,4 @@ if($_GET['setdef']){
</tr> </tr>
</table> </table>
<input type="button" onclick="check_stats()" value="Сохранить/изменить" /> <input type="button" onclick="check_stats()" value="Сохранить/изменить" />
</form> </form>
</body>
</html>

View File

@ -5,7 +5,6 @@ if (empty($_SESSION['uid'])) {
exit; exit;
} }
require_once "config.php"; require_once "config.php";
$user = new User($_SESSION['uid']); $user = new User($_SESSION['uid']);
@ -19,38 +18,22 @@ if ($user->battle) {
exit; exit;
} }
if ($_GET['id']) { if ($_GET['id'] && $user->admin) {
echo "Пробуем перейти на выбранную замковую улицу..."; echo "Пробуем перейти на выбранную замковую улицу...";
$_SESSION["klan"] = $_GET['klan']; $_SESSION["klan"] = $_GET['klan'];
$a = $_GET['klan']; $a = $_GET['klan'];
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 651, `online`.`room` = 651 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i',$_SESSION['uid']); db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 651, `online`.`room` = 651 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
header("location: city.php"); header("location: city.php");
} else { exit;
?>
<!doctype html>
<html>
<head>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
</head>
<body marginwidth=5 marginheight=5 bgcolor=#d4d4d4>
<a href="/city.php?strah=1"> назад</a>
<h1>Переход к клановым улицам</h1>
На данный момент свои замки имеют такие кланы:
<?php
$query = db::c()->query('SELECT `id`,`short`,`align`,`name` FROM `clans` WHERE `zamok` = 2');
while ($row = $query->fetch_assoc()) {
// $id = $row['id'];
// $s = $row['short'];
// echo "<img src='i/clan/",$s,".gif'> $s";
// echo ' <form action="ul_clans.php" method="GET">';
// echo "<input name='klan' type='hidden' value='$id'>";
// echo '<input type="submit" name="id" value=Перейти к замку1></form><hr>';
$frm = "<img src='i/align_%s.gif'> <img src='i/clan/%s.gif'> %s<br><form action='ul_clans.php' method='GET'></form><input name='klan' type='hidden' value='%s'><input type='submit' value='Вход'>";
echo sprintf($frm,$row['align'],$row['short'],$row['name'],$row['id']);
}
} }
Template::header('Клановый перекрёсток');
?> ?>
</body> <a href="/city.php?strah=1"> назад</a>
</html> <h1>Переход к клановым улицам</h1>
На данный момент свои замки имеют такие кланы:
<?php
$query = db::c()->query('SELECT `id`,`short`,`align`,`name` FROM `clans` WHERE `zamok` = 2');
while ($row = $query->fetch_assoc()) {
$frm = "<img src='i/align_%s.gif'> <img src='i/clan/%s.gif'> %s<br><form><input name='klan' type='hidden' value='%s'><input type='submit' value='Вход'></form>";
echo sprintf($frm, $row['align'], $row['short'], $row['name'], $row['id']);
}

View File

@ -17,26 +17,6 @@ if (!empty($_GET['teleport']) && $user->admin == 1) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']); db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 20,`online`.`room` = 20 WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $_SESSION['uid']);
} }
?>
<!doctype html>
<html lang="ru">
<head>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8">
<title></title>
</head>
<body>
<div style="float: right;">
<?php if ($user->admin == 1): ?>
<button onclick="location.href='?teleport=1'">Телепорт на ЦП</button>
<?php endif; ?>
<input type="button" onClick="location.href='main.php';" value="Вернуться">
</div>
<h2>Особые умения</h2>
<div align=center id=hint3></div>
<?php
# ORDEN PHP # ORDEN PHP
$al = db::c()->query('SELECT `accses`,`name` FROM `aligns` WHERE `align` = ?i', $user->align)->fetch_assoc(); $al = db::c()->query('SELECT `accses`,`name` FROM `aligns` WHERE `align` = ?i', $user->align)->fetch_assoc();
$moj = expa($al['accses']); $moj = expa($al['accses']);
@ -252,246 +232,6 @@ if (in_array($_POST['use'], array_keys($moj))) {
} }
} }
echo "<table><tr><td><br><br>";
foreach ($moj as $k => $v) {
switch ($k) {
case "sleep":
$script_name = "runmagic0";
$magic_name = "Наложить заклятие молчания";
break;
case "sleepf":
$script_name = "runmagicf";
$magic_name = "Наложить заклятие форумного молчания";
break;
case "healing":
$script_name = "runmagic1";
$magic_name = "Лечение";
break;
case "al_neut_power":
$script_name = "RunMagicSelf";
$magic_name = "Сила нейтралитета";
break;
case "ct1":
$script_name = "runmagic1";
$magic_name = "Исцелить легкую травму";
break;
case "ct2":
$script_name = "runmagic1";
$magic_name = "Исцелить среднюю травму";
break;
case "ct3":
$script_name = "runmagic1";
$magic_name = "Исцелить тяжелую травму";
break;
case "sleep_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие молчания";
break;
case "sleepf_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие форумного молчания";
break;
case "haos":
$script_name = "runmagic2";
$magic_name = "Наложить заклятие хаоса";
break;
case "haos_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие хаоса";
break;
case "death":
$script_name = "runmagic1";
$magic_name = "Наложить заклятие смерти";
break;
case "death_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие смерти";
break;
case "obezl":
$script_name = "runmagic2";
$magic_name = "Наложить заклятие обезличивания";
break;
case "obezl_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие обезличивания";
break;
case "pal_off":
$script_name = "runmagic1";
$magic_name = "Лишить звания Паладин";
break;
case "attack":
$script_name = "runmagic1";
$magic_name = "Нападение";
break;
case "attack_t":
$script_name = "runmagic1";
$magic_name = "Нападение на Темного";
break;
case "battack":
$script_name = "runmagic1";
$magic_name = "Кровавое нападение";
break;
case "attackk_close":
$script_name = "runmagic1";
$magic_name = "Кулачное закрытое кровавое нападение";
break;
case "attackk_open":
$script_name = "runmagic1";
$magic_name = "Кулачное закрытое нападение";
break;
case "marry":
$script_name = "runmagic4";
$magic_name = "Зарегистрировать брак";
break;
case "unmarry":
$script_name = "runmagic4";
$magic_name = "Расторгнуть брак";
break;
case "hidden":
$script_name = "runmagic1";
$magic_name = "Заклятие невидимости";
break;
case "teleport":
$script_name = "runmagic";
$magic_name = "Телепортация";
break;
case "check":
$script_name = "runmagic1";
$magic_name = "Поставить проверку";
break;
case "ct_all":
$script_name = "runmagic1";
$magic_name = "Вылечить от травм";
break;
case "pal_buttons":
$script_name = "runmagic1";
$magic_name = "Отметить о прохождении проверки";
break;
case "vampir":
$script_name = "runmagic1";
$magic_name = "Вампиризм (выпить энергию другого игрока)";
break;
case "brat":
$script_name = "runmagic1";
$magic_name = "Помочь темному собрату (вмешаться в поединок)";
break;
case "dneit":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Нейтральное Братство)";
break;
case "dpal":
$script_name = "runmagic";
$magic_name = "Присвоить склонность (Паладин)";
break;
case "ddark":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Темное Братство)";
break;
case "dlight":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Светлое Братство)";
break;
case "un_align":
$script_name = "runmagic1";
$magic_name = "Лишить склонности";
break;
case "note":
$script_name = "runmagic";
$magic_name = "Редактировать личное дело";
break;
case "sys":
$script_name = "runmagic";
$magic_name = "Отправить в чат системное сообщение";
break;
case "scanner":
$script_name = "runmagic";
$magic_name = "Показать лог действий модератора";
break;
case "rep":
$script_name = "runmagic";
$magic_name = "Отчет о переводах";
break;
case "rost":
$script_name = "runmagic";
$magic_name = "Присвоить статус";
break;
case "ldadd":
$script_name = "";
$magic_name = "Записать причину отправки в Хаос";
break;
case "crush":
$script_name = "runmagic1";
$magic_name = "Сокрушение";
break;
case "def":
$script_name = "runmagic1";
$magic_name = "Защита от оружия";
break;
case "bexit":
$script_name = "runmagic1";
$magic_name = "Выйти из боя";
break;
}
if ($script_name) {
$action_ok = 1;
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
if ($user->align == 2) {
if ($k == 'al_neut_power' && $abil[0] < 1) {
$action_ok = 0;
}
if ($k == 'attackk_close' && $abil[1] < 1) {
$action_ok = 0;
}
if ($k == 'attackk_open' && $abil[2] < 1) {
$action_ok = 0;
}
}
if ($user->align == 6) {
if ($k == 'ct1' && $abil[0] < 1) {
$action_ok = 0;
}
if ($k == 'ct2' && $abil[1] < 1) {
$action_ok = 0;
}
if ($k == 'ct3' && $abil[2] < 1) {
$action_ok = 0;
}
}
}
if ($action_ok > 0) {
print "<a onclick=\"javascript:$script_name('$magic_name','$k','target','target1') \" href='#'><img src='i/magic/" . $k . ".gif' title='" . $magic_name . "'></a>&nbsp;";
}
}
if ($user->align == 2) // Нейтралы
{
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
for ($i = 0; $i < 3; $i++) if (!$abil[$i]) $abil[$i] = 0;
echo("<br />Осталось использований:<br />");
echo("<img src='i/magic/al_neut_power.gif' title='Сила нейтралитета'> Сила нейтралитета - " . $abil[0] . "<br />");
echo("<img src='i/magic/attackk_close.gif' title='Кулачное закрытое кровавое нападение'> Кулачное закрытое кровавое нападение - " . $abil[1] . "<br />");
echo("<img src='i/magic/attackk_open.gif' title='Кулачное закрытое нападение'> Кулачное закрытое нападение - " . $abil[2] . "<br />");
}
if ($user->align == 6) // Свет
{
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
for ($i = 0; $i < 3; $i++) if (!$abil[$i]) $abil[$i] = 0;
echo("<br />Осталось использований:<br />");
echo("<img src='i/magic/ct1.gif' title='Исцелить легкую травму'> Исцелить легкую травму - " . $abil[0] . "<br />");
echo("<img src='i/magic/ct2.gif' title='Исцелить среднюю травму'> Исцелить среднюю травму - " . $abil[1] . "<br />");
echo("<img src='i/magic/ct3.gif' title='Исцелить тяжелую травму'> Исцелить тяжелую травму - " . $abil[2] . "<br />");
}
echo "</td></tr></table>";
#RELIKT PHP #RELIKT PHP
function klan_relicts() function klan_relicts()
{ {
@ -802,8 +542,264 @@ if (empty($user->clan)) {
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['uid'])->fetch_assoc(); $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['uid'])->fetch_assoc();
?>
Template::header('user_abilities');
?>
<div style="float: right;">
<?php if ($user->admin == 1): ?>
<button onclick="location.href='?teleport=1'">Телепорт на ЦП</button>
<?php endif; ?>
<input type="button" onClick="location.href='main.php';" value="Вернуться">
</div>
<h2>Особые умения</h2>
<div style="text-align: center;" id=hint3></div>
<div>
<?php
foreach ($moj as $k => $v) {
switch ($k) {
case "sleep":
$script_name = "runmagic0";
$magic_name = "Наложить заклятие молчания";
break;
case "sleepf":
$script_name = "runmagicf";
$magic_name = "Наложить заклятие форумного молчания";
break;
case "healing":
$script_name = "runmagic1";
$magic_name = "Лечение";
break;
case "al_neut_power":
$script_name = "RunMagicSelf";
$magic_name = "Сила нейтралитета";
break;
case "ct1":
$script_name = "runmagic1";
$magic_name = "Исцелить легкую травму";
break;
case "ct2":
$script_name = "runmagic1";
$magic_name = "Исцелить среднюю травму";
break;
case "ct3":
$script_name = "runmagic1";
$magic_name = "Исцелить тяжелую травму";
break;
case "sleep_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие молчания";
break;
case "sleepf_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие форумного молчания";
break;
case "haos":
$script_name = "runmagic2";
$magic_name = "Наложить заклятие хаоса";
break;
case "haos_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие хаоса";
break;
case "death":
$script_name = "runmagic1";
$magic_name = "Наложить заклятие смерти";
break;
case "death_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие смерти";
break;
case "obezl":
$script_name = "runmagic2";
$magic_name = "Наложить заклятие обезличивания";
break;
case "obezl_off":
$script_name = "runmagic1";
$magic_name = "Снять заклятие обезличивания";
break;
case "pal_off":
$script_name = "runmagic1";
$magic_name = "Лишить звания Паладин";
break;
case "attack":
$script_name = "runmagic1";
$magic_name = "Нападение";
break;
case "attack_t":
$script_name = "runmagic1";
$magic_name = "Нападение на Темного";
break;
case "battack":
$script_name = "runmagic1";
$magic_name = "Кровавое нападение";
break;
case "attackk_close":
$script_name = "runmagic1";
$magic_name = "Кулачное закрытое кровавое нападение";
break;
case "attackk_open":
$script_name = "runmagic1";
$magic_name = "Кулачное закрытое нападение";
break;
case "marry":
$script_name = "runmagic4";
$magic_name = "Зарегистрировать брак";
break;
case "unmarry":
$script_name = "runmagic4";
$magic_name = "Расторгнуть брак";
break;
case "hidden":
$script_name = "runmagic1";
$magic_name = "Заклятие невидимости";
break;
case "teleport":
$script_name = "runmagic";
$magic_name = "Телепортация";
break;
case "check":
$script_name = "runmagic1";
$magic_name = "Поставить проверку";
break;
case "ct_all":
$script_name = "runmagic1";
$magic_name = "Вылечить от травм";
break;
case "pal_buttons":
$script_name = "runmagic1";
$magic_name = "Отметить о прохождении проверки";
break;
case "vampir":
$script_name = "runmagic1";
$magic_name = "Вампиризм (выпить энергию другого игрока)";
break;
case "brat":
$script_name = "runmagic1";
$magic_name = "Помочь темному собрату (вмешаться в поединок)";
break;
case "dneit":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Нейтральное Братство)";
break;
case "dpal":
$script_name = "runmagic";
$magic_name = "Присвоить склонность (Паладин)";
break;
case "ddark":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Темное Братство)";
break;
case "dlight":
$script_name = "runmagic1";
$magic_name = "Присвоить склонность (Светлое Братство)";
break;
case "un_align":
$script_name = "runmagic1";
$magic_name = "Лишить склонности";
break;
case "note":
$script_name = "runmagic";
$magic_name = "Редактировать личное дело";
break;
case "sys":
$script_name = "runmagic";
$magic_name = "Отправить в чат системное сообщение";
break;
case "scanner":
$script_name = "runmagic";
$magic_name = "Показать лог действий модератора";
break;
case "rep":
$script_name = "runmagic";
$magic_name = "Отчет о переводах";
break;
case "rost":
$script_name = "runmagic";
$magic_name = "Присвоить статус";
break;
case "ldadd":
$script_name = "";
$magic_name = "Записать причину отправки в Хаос";
break;
case "crush":
$script_name = "runmagic1";
$magic_name = "Сокрушение";
break;
case "def":
$script_name = "runmagic1";
$magic_name = "Защита от оружия";
break;
case "bexit":
$script_name = "runmagic1";
$magic_name = "Выйти из боя";
break;
}
if ($script_name) {
$action_ok = 1;
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
if ($user->align == 2) {
if ($k == 'al_neut_power' && $abil[0] < 1) {
$action_ok = 0;
}
if ($k == 'attackk_close' && $abil[1] < 1) {
$action_ok = 0;
}
if ($k == 'attackk_open' && $abil[2] < 1) {
$action_ok = 0;
}
}
if ($user->align == 6) {
if ($k == 'ct1' && $abil[0] < 1) {
$action_ok = 0;
}
if ($k == 'ct2' && $abil[1] < 1) {
$action_ok = 0;
}
if ($k == 'ct3' && $abil[2] < 1) {
$action_ok = 0;
}
}
}
if ($action_ok > 0) {
print "<a onclick=\"javascript:$script_name('$magic_name','$k','target','target1') \" href='#'><img src='i/magic/" . $k . ".gif' title='" . $magic_name . "'></a>&nbsp;";
}
}
if ($user->align == 2) // Нейтралы
{
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
for ($i = 0; $i < 3; $i++) {
if (!$abil[$i]) {
$abil[$i] = 0;
}
}
echo("<br />Осталось использований:<br />");
echo("<img src='i/magic/al_neut_power.gif' title='Сила нейтралитета'> Сила нейтралитета - " . $abil[0] . "<br />");
echo("<img src='i/magic/attackk_close.gif' title='Кулачное закрытое кровавое нападение'> Кулачное закрытое кровавое нападение - " . $abil[1] . "<br />");
echo("<img src='i/magic/attackk_open.gif' title='Кулачное закрытое нападение'> Кулачное закрытое нападение - " . $abil[2] . "<br />");
}
if ($user->align == 6) // Свет
{
$abil = db::c()->query('SELECT `abil` FROM `users` WHERE `id`= ?i', $_SESSION['uid'])->fetch_assoc();
$abil = unserialize($abil['abil']);
for ($i = 0; $i < 3; $i++) {
if (!$abil[$i]) {
$abil[$i] = 0;
}
}
echo("<br />Осталось использований:<br />");
echo("<img src='i/magic/ct1.gif' title='Исцелить легкую травму'> Исцелить легкую травму - " . $abil[0] . "<br />");
echo("<img src='i/magic/ct2.gif' title='Исцелить среднюю травму'> Исцелить среднюю травму - " . $abil[1] . "<br />");
echo("<img src='i/magic/ct3.gif' title='Исцелить тяжелую травму'> Исцелить тяжелую травму - " . $abil[2] . "<br />");
}
?>
</div>
<h2>Реликты</h2> <h2>Реликты</h2>
<div class="contentContainer"> <div class="contentContainer">
<div> <div>
@ -960,21 +956,21 @@ $bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id` = ?i ', $_SESSION['u
</div> </div>
<div id="inlines"> <div id="inlines">
<?= show_byu(1); ?> <?= show_byu(1); ?>
<?= show_byu(2); ?> <?= show_byu(2); ?>
<?= show_byu(3); ?> <?= show_byu(3); ?>
<?= show_byu(4); ?> <?= show_byu(4); ?>
<?= show_byu(5); ?> <?= show_byu(5); ?>
<?= show_byu(6); ?> <?= show_byu(6); ?>
<?= show_byu(7); ?> <?= show_byu(7); ?>
<?= show_byu(8); ?> <?= show_byu(8); ?>
<?= show_byu(9); ?> <?= show_byu(9); ?>
<?= show_byu(10); ?> <?= show_byu(10); ?>
<?= show_byu(11); ?> <?= show_byu(11); ?>
<?= show_byu(12); ?> <?= show_byu(12); ?>
<?= show_byu(13); ?> <?= show_byu(13); ?>
<?= show_byu(14); ?> <?= show_byu(14); ?>
<?= show_byu(15); ?> <?= show_byu(15); ?>
</div> </div>
<script> <script>

View File

@ -4,8 +4,7 @@ if (empty($_SESSION['uid'])) {
header('Location: /index.php'); header('Location: /index.php');
exit(); exit();
} }
include_once('functions.php'); require_once 'functions.php';
if ($user->battle) { if ($user->battle) {
header('Location: /fbattle.php'); header('Location: /fbattle.php');
exit(); exit();
@ -27,9 +26,6 @@ $hobbie = str_replace("\\r", "", $hobbie);
$hobbie = str_replace("&lt;br&nbsp;/&gt;", "<br />", $hobbie); $hobbie = str_replace("&lt;br&nbsp;/&gt;", "<br />", $hobbie);
if ($name || $color || $hobbie) { if ($name || $color || $hobbie) {
$simbolcount = strlen($hobbie);
switch ($color) { switch ($color) {
case 1: case 1:
$color = 'blue'; $color = 'blue';
@ -42,7 +38,7 @@ if ($name || $color || $hobbie) {
break; break;
} }
if ($simbolcount > INFO_CHAR_LIMIT) { if (strlen($hobbie) > INFO_CHAR_LIMIT) {
err('Максимальная длинна поля Хобби: ' . INFO_CHAR_LIMIT . ' символов!'); err('Максимальная длинна поля Хобби: ' . INFO_CHAR_LIMIT . ' символов!');
} else { } else {
$values = ['realname' => $name, 'color' => $color, 'info' => $hobbie]; $values = ['realname' => $name, 'color' => $color, 'info' => $hobbie];
@ -57,18 +53,11 @@ if ($oldpsw && $newpsw) {
err('Неверный текущий пароль!'); err('Неверный текущий пароль!');
} }
} }
Template::header('Анкета');
?> ?>
<!doctype html>
<html lang="ru">
<head>
<meta charset="utf-8"/>
<link rel="stylesheet" href="css/main.css">
<title>Анкета</title>
</head>
<body>
<a href="main.php"> на главную</a> <a href="main.php"> на главную</a>
<h1>Анкета персонажа <?= $user->login ?></h1> <h1>Анкета персонажа <?= $user->login ?></h1>
<form method="post" action="user_anketa.php"> <form method="post">
<input name="name" placeholder="Реальное имя" value="<?= $user->realname ?>"><br> <input name="name" placeholder="Реальное имя" value="<?= $user->realname ?>"><br>
<select name="color" id="color"> <select name="color" id="color">
<option value="0" selected>Чёрный</option> <option value="0" selected>Чёрный</option>
@ -79,10 +68,8 @@ if ($oldpsw && $newpsw) {
<input name="submit" type="submit"> <input name="submit" type="submit">
</form> </form>
<h1>Безопасность</h1> <h1>Безопасность</h1>
<form method="post" action="user_anketa.php"> <form method="post">
<input placeholder="Старый пароль" name="oldpsw"> <input placeholder="Старый пароль" name="oldpsw">
<input placeholder="Новый пароль" name="newpsw"> <input placeholder="Новый пароль" name="newpsw">
<input type="submit"> <input type="submit">
</form> </form>
</body>
</html>

542
vxod.php
View File

@ -19,79 +19,73 @@ if ($user->room == 403) {
header('Location: canalizaciya.php'); header('Location: canalizaciya.php');
exit; exit;
} }
if ($user->room != 402) {
header('Location: main.php');
exit;
}
if ($user->room == 402) { Template::header('Вход в водосток');
?> ?>
<HTML> <style>
<HEAD> legend {
<link rel=stylesheet href="css/main.css"> padding: 0.2em 0.5em;
<meta charset=utf-8"> color: #A52A2A;
<style> FONT-WEIGHT: bold;
legend { }
padding: 0.2em 0.5em;
color: #A52A2A; body {
FONT-WEIGHT: bold; background-image: url('i/canal.jpg');
background-repeat: no-repeat;
background-position: top right;
}
</style>
<div id=hint4 class=ahint></div>
<TABLE width=100%>
<TR>
<TD valign=top width=100%>
<center><h3>Вход в водосток</h3></center>
<?
$select = mysql_query("SELECT `time` FROM `visit_podzem` WHERE `login`='" . $user['login'] . "' and `time`>'0'");
if ($el = mysql_fetch_array($select)) {
$wait_sec = $el["time"];
$new_t = time();
$left_time = $wait_sec - $new_t;
$left_hour = floor(($left_time / 60) / 60);
$left_min = floor($left_time / 60);
$left_sec = $left_time - $left_min * 60;
$left_min = ($left_min - $left_hour * 60);
if ($wait_sec > $new_t) {
print "<span style='font-size: 11px;'><span style='font-size:12px; color: #009; font-style: italic;'>До следующего входа осталось</span>:
<span style='color:#990000'>$left_hour</span> ч. <span style='color:#990000'>$left_min</span> мин. <span style='color:#990000'>$left_sec</span> сек.</span><br>";
} else {
mysql_query("DELETE FROM visit_podzem WHERE login='" . $user['login'] . "'");
print "<script>location.href='main.php?act=none'</script>";
exit();
}
} else {
$login = $user['login'];
$ya = mysql_query("SELECT `login` FROM `vxodd` WHERE `login` = '$login' LIMIT 1");
$wawe = 0;
if ($daw = mysql_fetch_array($ya)) {
$wawe = 1;
} }
body { $naw = mysql_query("SELECT `login` FROM `vxod` WHERE `login` = '$login' LIMIT 1");
background-image: url('i/canal.jpg'); $nawe = 0;
background-repeat: no-repeat; if ($ser = mysql_fetch_array($naw)) {
background-position: top right; $nawe = 1;
} }
</style>
</HEAD>
<body>
<div id=hint4 class=ahint></div>
<TABLE width=100%>
<TR>
<TD valign=top width=100%>
<center><h3>Вход в водосток</h3></center>
<?
$select = mysql_query("SELECT `time` FROM `visit_podzem` WHERE `login`='" . $user['login'] . "' and `time`>'0'");
if ($el = mysql_fetch_array($select)) {
$wait_sec = $el["time"];
$new_t = time();
$left_time = $wait_sec - $new_t;
$left_hour = floor(($left_time / 60) / 60);
$left_min = floor($left_time / 60);
$left_sec = $left_time - $left_min * 60;
$left_min = ($left_min - $left_hour * 60);
if ($wait_sec > $new_t) { $rt = mysql_query("select id,level from users where login='$login'");
print" <font style='font-size:12px'><i style='color:#009'> До следующего входа осталось</i> $est = mysql_fetch_array($rt);
<font style='font-size:11px; color:#000;'>: </font><font style='color:#990000'>$left_hour</font> $user_id = $est["id"];
<font style='font-size:11px; color:#000;'> ч. </font><font style='color:#990000'>$left_min</font> $user_lvl = $est["level"];
<font style='font-size:11px; color:#000;'> мин. </font>
<font style='color:#990000'>$left_sec</font><font style='font-size:11px; color:#000;'> сек. </font>
</font><br>";
} else {
mysql_query("DELETE FROM visit_podzem WHERE login='" . $user['login'] . "'");
print "<script>location.href='main.php?act=none'</script>";
exit();
}
}else{
$login = $user['login'];
$ya = mysql_query("SELECT `login` FROM `vxodd` WHERE `login` = '$login' LIMIT 1");
$wawe = 0;
if ($daw = mysql_fetch_array($ya)) {
$wawe = 1;
}
$naw = mysql_query("SELECT `login` FROM `vxod` WHERE `login` = '$login' LIMIT 1");
$nawe = 0;
if ($ser = mysql_fetch_array($naw)) {
$nawe = 1;
}
$rt = mysql_query("select id,level from users where login='$login'");
$est = mysql_fetch_array($rt);
$user_id = $est["id"];
$user_lvl = $est["level"];
if ($wawe == 0) { if ($wawe == 0) {
echo "<FORM id='REQUEST'> echo "<FORM id='REQUEST'>
<FIELDSET style='padding-left: 5; width=50%; color:#000000;'> <FIELDSET style='padding-left: 5; width=50%; color:#000000;'>
<LEGEND><B> Группа </B> </LEGEND> <LEGEND><B> Группа </B> </LEGEND>
Комментарий <INPUT style=\"font-size:12px;\" TYPE=text NAME=cmt maxlength=40 size=40><BR> Комментарий <INPUT style=\"font-size:12px;\" TYPE=text NAME=cmt maxlength=40 size=40><BR>
@ -101,235 +95,217 @@ if ($user->room == 402) {
</FIELDSET> </FIELDSET>
</FORM>"; </FORM>";
} else { } else {
print"<FORM id='REQUEST'> print"<FORM id='REQUEST'>
<FIELDSET style='padding-left: 5; width=50%'> <FIELDSET style='padding-left: 5; width=50%'>
<LEGEND><B> Группа </B> </LEGEND>"; <LEGEND><B> Группа </B> </LEGEND>";
if ($nawe == 1) { if ($nawe == 1) {
echo "<INPUT style=\"font-size:12px;\" type='submit' name='start' value='Начать'> &nbsp;"; echo "<INPUT style=\"font-size:12px;\" type='submit' name='start' value='Начать'> &nbsp;";
} }
echo "<INPUT style=\"font-size:12px;\" type='submit' name='del' value='Покинуть группу'> echo "<INPUT style=\"font-size:12px;\" type='submit' name='del' value='Покинуть группу'>
</FIELDSET> </FIELDSET>
</FORM>"; </FORM>";
}
if ($_GET['warning'] == 1) {
print"<font style='color:#CC0000'>&nbsp;Вы покинули группу</font>";
}
if ($_GET['warning'] == 2) {
print"<font style='color:#CC0000'>&nbsp;Увы! Не угадали пароль!</font>";
}
if ($_GET['warning'] == 3) {
print"<font style='color:#CC0000'>&nbsp;Вы подали заявку! Отзавите!</font>";
}
if ($_GET['warning'] == 4) {
print"<font style='color:#CC0000'>&nbsp;Вы уже в группе!</font>";
}
if ($_GET['warning'] == 5) {
print"<font style='color:#CC0000'>&nbsp;Группа уже собранна!</font>";
}
print"<TABLE cellpadding=1 cellspacing=0>";
$i = 0;
$Q = mysql_query("SELECT * FROM vxod");
while ($DATA = mysql_fetch_array($Q)) {
$cr = $DATA["glav_id"];
$z_login[$i] = $DATA["login"];
$date[$i] = $DATA["date"];
$comment[$i] = $DATA["comment"];
$password[$i] = $DATA["pass"];
$mine_z[$i] = 0;
$Q2 = mysql_query("SELECT glav_id FROM vxodd WHERE glav_id='$cr'");
$t1_all[$i] = 0;
while ($DATAS = mysql_fetch_array($Q2)) {
$t1_all[$i]++;
}
$creator[$i] = $DATA["glav_id"];
$i++;
}
for ($n = 0; $n < $i; $n++) {
echo "<FORM id='REQUEST'><TR><TD><font class=date>$date[$n]</font><font style='font-size:12px; color:#000000;'>&nbsp;";
$QUER = mysql_query("SELECT login,lvl FROM vxodd WHERE glav_id='$creator[$n]' ORDER BY id ASC");
while ($DATAS = mysql_fetch_array($QUER)) {
$p1 = $DATAS["login"];
$p_login = $DATAS["login"];
$p_lvl = $DATAS["lvl"];
if ($p1 != "") {
$p1 = "<b>$p1</b> [$p_lvl]<a href='inf.php?login=$p1' target='_blank'><img src='i/inf.gif' border=0></a> ";
if ($t1_all[$n] == 1) {
echo "&nbsp;$p1";
} else {
echo "&nbsp;$p1,";
}
}
}
if (!empty($comment[$n])) {
print"| $comment[$n] </font>";
}
if ($wawe == '0') {
if (!empty($password[$n])) {
echo "<input name='naw_pass' type='hidden' value='$password[$n]'><INPUT type='password' name='pass' size=5> ";
}
echo "<input style=\"font-size:12px;\" name='naw_id' type='hidden' value='$creator[$n]'>
<INPUT style='font-size:12px;' TYPE=submit name=add value='Присоед.'>";
}
echo "</TD></TR></FORM>";
}/////////закрытие
?>
<TR>
<TD>
</TD>
</TR>
<TR height=1>
<TD height=1 bgcolor=#A0A0A0 colspan=2><SPAN></SPAN></TD>
</TR>
</TABLE>
<?
///////////////Подача заявки////////////////////
if ($_GET['open']) {
$der = mysql_query("SELECT glav_id FROM vxodd WHERE login='" . $user['login'] . "'");
if ($deras = mysql_fetch_array($der)) {
print "<script>location.href='?warning=4'</script>";
exit;
}
$time = date("H:i");
$SQL2 = mysql_query("INSERT INTO vxod(date,login,glav_id,comment,pass) VALUES('$time','$login','$user_id','" . $_GET['cmt'] . "','" . $_GET['pass'] . "')");
$SQL2 = mysql_query("INSERT INTO vxodd(login,glav_id,lvl) VALUES('$login','$user_id','$user_lvl')");
if ($SQL2) {
print "<script>location.href='main.php?act=none'</script>";
exit;
} else {
print"Ошибка!!! Сообщите администратору!";
}
}
//////////////Удаление заявки//////////////////////
if ($_GET['del']) {
$e = mysql_query("DELETE FROM vxod WHERE login='$login'");
$es = mysql_query("DELETE FROM vxodd WHERE glav_id='$user_id'");
$ed = mysql_query("DELETE FROM vxodd WHERE login='$login'");
if ($e) {
print "<script>location.href='?warning=1'</script>";
exit;
} else {
print"Ошибка!!! Сообщите администратору!";
}
}
/////////////Присоединится///////////////
if ($_GET['add']) {
$der = mysql_query("SELECT glav_id,id FROM vxodd WHERE login='" . $user['login'] . "'");
if ($deras = mysql_fetch_array($der)) {
print "<script>location.href='?warning=4'</script>";
exit;
}
$den = mysql_query("SELECT id FROM vxodd WHERE glav_id='" . $_GET['naw_id'] . "'");
if (mysql_num_rows($den) >= 4) {
print "<script>location.href='?warning=5'</script>";
exit;
}
if ($_GET['pass'] == $_GET['naw_pass']) {
$rt = mysql_query("select level from users where login='$login'");
$est = mysql_fetch_array($rt);
$s = mysql_query("INSERT INTO vxodd(login,glav_id,lvl) VALUES('$login','" . $_GET['naw_id'] . "','" . $est["level"] . "')");
if ($s) {
print "<script>location.href='?act=none'</script>";
exit;
} else {
print"Ошибка!!! Сообщите администратору!";
} }
} else {
print "<script>location.href='?warning=2'</script>";
exit;
}
}
//////////////////Начинаем////////////////////
if ($_GET['start']) {
$zax = mysql_query("select login from vxodd where glav_id='" . $user['id'] . "'");
while ($nana = mysql_fetch_array($zax)) {
$n_login = $nana["login"];
$rty = mysql_query("select id,level,login from users where login='$n_login'");
$esth = mysql_fetch_array($rty);
$est_id = $esth["id"];
$est_login = $esth["login"];
//Время до следующего визита
$vremya = 3600 * 6 + time();
mysql_query('insert into visit_podzem (login,time) values("' . $n_login . '","' . $vremya . '")');
$vrem = 120 * 60 + time();
mysql_query('insert into labirint(user_id, login, location, vector, glav_id, glava, t, l,key1,key2,key3,el,name,visit_time) values("' . $est_id . '", "' . $est_login . '", "16", "0", "' . $user['id'] . '", "' . $user['login'] . '","226","453","99","96","92","47","Канализация 1 этаж","' . $vrem . '")');
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '403',`online`.`room` = '403' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth["id"] . "' ;");
}
$ferrr = mysql_query("SELECT * FROM podzem3 WHERE glava='default' and name='Канализация 1 этаж'"); if ($_GET['warning'] == 1) {
$retr = mysql_fetch_array($ferrr); print"<span style='color:#CC0000'>&nbsp;Вы покинули группу</span>";
mysql_query('insert into podzem3(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,sunduk1,sunduk2,sunduk3,sunduk4,sunduk5,sunduk6,sunduk7) }
values("' . $login . '","Канализация 1 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["sunduk1"] . '","' . $retr["sunduk2"] . '","' . $retr["sunduk3"] . '","' . $retr["sunduk4"] . '","' . $retr["sunduk5"] . '","' . $retr["sunduk6"] . '","' . $retr["sunduk7"] . '")'); if ($_GET['warning'] == 2) {
print"<span style='color:#CC0000'>&nbsp;Увы! Не угадали пароль!</span>";
}
if ($_GET['warning'] == 3) {
print"<span style='color:#CC0000'>&nbsp;Вы подали заявку! Отзавите!</span>";
}
if ($_GET['warning'] == 4) {
print"<span style='color:#CC0000'>&nbsp;Вы уже в группе!</span>";
}
if ($_GET['warning'] == 5) {
print"<span style='color:#CC0000'>&nbsp;Группа уже собранна!</span>";
}
print"<TABLE cellpadding=1 cellspacing=0>";
$ferrr = mysql_query("SELECT * FROM podzem3 WHERE glava='default' and name='Канализация 2 этаж'"); $i = 0;
$retr = mysql_fetch_array($ferrr); $Q = mysql_query("SELECT * FROM vxod");
mysql_query('insert into podzem3(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,sunduk1,sunduk2,sunduk3,sunduk4,sunduk5,sunduk6,sunduk7) while ($DATA = mysql_fetch_array($Q)) {
values("' . $login . '","Канализация 2 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["sunduk1"] . '","' . $retr["sunduk2"] . '","' . $retr["sunduk3"] . '","' . $retr["sunduk4"] . '","' . $retr["sunduk5"] . '","' . $retr["sunduk6"] . '","' . $retr["sunduk7"] . '")'); $cr = $DATA["glav_id"];
$z_login[$i] = $DATA["login"];
$date[$i] = $DATA["date"];
$comment[$i] = $DATA["comment"];
$password[$i] = $DATA["pass"];
$ferrr = mysql_query("SELECT * FROM podzem4 WHERE glava='default' and name='Канализация 1 этаж'"); $mine_z[$i] = 0;
$retr = mysql_fetch_array($ferrr);
mysql_query('insert into podzem4(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,v1,v2,v3,v4,v5,v6,v7,v8,v9,v11,v12,v13,v14,v15,v16,v17,v18,v19,v21,v22,v23,v24,v25,v26,v27,v28,v29,v31,v32,v33,v34,v35,v36,v37,v38,v39,v41,v42,v43,v44,v45,v46,v47,v48,v49,v51,v52,v53,v54,v55,v56,v57,v58,v59,v61,v62,v63,v64,v65,v66,v67,v68,v69,v71,v72,v73,v74,v75,v76,v77,v78,v79,v81,v82,v83,v84,v85,v86,v87,v88,v89,v91,v92,v93,v94,v95,v96,v97,v98,v99)
values("' . $login . '","Канализация 1 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["v1"] . '","' . $retr["v2"] . '","' . $retr["v3"] . '","' . $retr["v4"] . '","' . $retr["v5"] . '","' . $retr["v6"] . '","' . $retr["v7"] . '","' . $retr["v8"] . '","' . $retr["v9"] . '","' . $retr["v11"] . '","' . $retr["v12"] . '","' . $retr["v13"] . '","' . $retr["v14"] . '","' . $retr["v15"] . '","' . $retr["v16"] . '","' . $retr["v17"] . '","' . $retr["v18"] . '","' . $retr["v19"] . '","' . $retr["v21"] . '","' . $retr["v22"] . '","' . $retr["v23"] . '","' . $retr["v24"] . '","' . $retr["v25"] . '","' . $retr["v26"] . '","' . $retr["v27"] . '","' . $retr["v28"] . '","' . $retr["v29"] . '","' . $retr["v31"] . '","' . $retr["v32"] . '","' . $retr["v33"] . '","' . $retr["v34"] . '","' . $retr["v35"] . '","' . $retr["v36"] . '","' . $retr["v37"] . '","' . $retr["v38"] . '","' . $retr["v39"] . '","' . $retr["v41"] . '","' . $retr["v42"] . '","' . $retr["v43"] . '","' . $retr["v44"] . '","' . $retr["v45"] . '","' . $retr["v46"] . '","' . $retr["v47"] . '","' . $retr["v48"] . '","' . $retr["v49"] . '","' . $retr["v51"] . '","' . $retr["v52"] . '","' . $retr["v53"] . '","' . $retr["v54"] . '","' . $retr["v55"] . '","' . $retr["v56"] . '","' . $retr["v57"] . '","' . $retr["v58"] . '","' . $retr["v59"] . '","' . $retr["v61"] . '","' . $retr["v62"] . '","' . $retr["v63"] . '","' . $retr["v64"] . '","' . $retr["v65"] . '","' . $retr["v66"] . '","' . $retr["v67"] . '","' . $retr["v68"] . '","' . $retr["v69"] . '","' . $retr["v71"] . '","' . $retr["v72"] . '","' . $retr["v73"] . '","' . $retr["v74"] . '","' . $retr["v75"] . '","' . $retr["v76"] . '","' . $retr["v77"] . '","' . $retr["v78"] . '","' . $retr["v79"] . '","' . $retr["v81"] . '","' . $retr["v82"] . '","' . $retr["v83"] . '","' . $retr["v84"] . '","' . $retr["v85"] . '","' . $retr["v86"] . '","' . $retr["v87"] . '","' . $retr["v88"] . '","' . $retr["v89"] . '","' . $retr["v91"] . '","' . $retr["v92"] . '","' . $retr["v93"] . '","' . $retr["v94"] . '","' . $retr["v95"] . '","' . $retr["v96"] . '","' . $retr["v97"] . '","' . $retr["v98"] . '","' . $retr["v99"] . '")');
$ferrr = mysql_query("SELECT * FROM podzem4 WHERE glava='default' and name='Канализация 2 этаж'"); $Q2 = mysql_query("SELECT glav_id FROM vxodd WHERE glav_id='$cr'");
$retr = mysql_fetch_array($ferrr); $t1_all[$i] = 0;
mysql_query('insert into podzem4(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,v1,v2,v3,v4,v5,v6,v7,v8,v9,v11,v12,v13,v14,v15,v16,v17,v18,v19,v21,v22,v23,v24,v25,v26,v27,v28,v29,v31,v32,v33,v34,v35,v36,v37,v38,v39,v41,v42,v43,v44,v45,v46,v47,v48,v49,v51,v52,v53,v54,v55,v56,v57,v58,v59,v61,v62,v63,v64,v65,v66,v67,v68,v69,v71,v72,v73,v74,v75,v76,v77,v78,v79,v81,v82,v83,v84,v85,v86,v87,v88,v89,v91,v92,v93,v94,v95,v96,v97,v98,v99) while ($DATAS = mysql_fetch_array($Q2)) {
values("' . $login . '","Канализация 2 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["v1"] . '","' . $retr["v2"] . '","' . $retr["v3"] . '","' . $retr["v4"] . '","' . $retr["v5"] . '","' . $retr["v6"] . '","' . $retr["v7"] . '","' . $retr["v8"] . '","' . $retr["v9"] . '","' . $retr["v11"] . '","' . $retr["v12"] . '","' . $retr["v13"] . '","' . $retr["v14"] . '","' . $retr["v15"] . '","' . $retr["v16"] . '","' . $retr["v17"] . '","' . $retr["v18"] . '","' . $retr["v19"] . '","' . $retr["v21"] . '","' . $retr["v22"] . '","' . $retr["v23"] . '","' . $retr["v24"] . '","' . $retr["v25"] . '","' . $retr["v26"] . '","' . $retr["v27"] . '","' . $retr["v28"] . '","' . $retr["v29"] . '","' . $retr["v31"] . '","' . $retr["v32"] . '","' . $retr["v33"] . '","' . $retr["v34"] . '","' . $retr["v35"] . '","' . $retr["v36"] . '","' . $retr["v37"] . '","' . $retr["v38"] . '","' . $retr["v39"] . '","' . $retr["v41"] . '","' . $retr["v42"] . '","' . $retr["v43"] . '","' . $retr["v44"] . '","' . $retr["v45"] . '","' . $retr["v46"] . '","' . $retr["v47"] . '","' . $retr["v48"] . '","' . $retr["v49"] . '","' . $retr["v51"] . '","' . $retr["v52"] . '","' . $retr["v53"] . '","' . $retr["v54"] . '","' . $retr["v55"] . '","' . $retr["v56"] . '","' . $retr["v57"] . '","' . $retr["v58"] . '","' . $retr["v59"] . '","' . $retr["v61"] . '","' . $retr["v62"] . '","' . $retr["v63"] . '","' . $retr["v64"] . '","' . $retr["v65"] . '","' . $retr["v66"] . '","' . $retr["v67"] . '","' . $retr["v68"] . '","' . $retr["v69"] . '","' . $retr["v71"] . '","' . $retr["v72"] . '","' . $retr["v73"] . '","' . $retr["v74"] . '","' . $retr["v75"] . '","' . $retr["v76"] . '","' . $retr["v77"] . '","' . $retr["v78"] . '","' . $retr["v79"] . '","' . $retr["v81"] . '","' . $retr["v82"] . '","' . $retr["v83"] . '","' . $retr["v84"] . '","' . $retr["v85"] . '","' . $retr["v86"] . '","' . $retr["v87"] . '","' . $retr["v88"] . '","' . $retr["v89"] . '","' . $retr["v91"] . '","' . $retr["v92"] . '","' . $retr["v93"] . '","' . $retr["v94"] . '","' . $retr["v95"] . '","' . $retr["v96"] . '","' . $retr["v97"] . '","' . $retr["v98"] . '","' . $retr["v99"] . '")'); $t1_all[$i]++;
}
$creator[$i] = $DATA["glav_id"];
$i++;
}
?> for ($n = 0; $n < $i; $n++) {
<script>top.frames['online'].location = 'ch.php?online=' + Math.round(Math.random() * 100000);</script> echo "<FORM id='REQUEST'><TR><TD><span class=date>$date[$n]</span>&nbsp;";
<?
mysql_query("DELETE FROM vxod WHERE login='$login'"); $QUER = mysql_query("SELECT login,lvl FROM vxodd WHERE glav_id='$creator[$n]' ORDER BY id ASC");
mysql_query("DELETE FROM vxodd WHERE glav_id=" . $user['id'] . ""); while ($DATAS = mysql_fetch_array($QUER)) {
mysql_query("DELETE FROM vxodd WHERE login='$login'"); $p1 = $DATAS["login"];
print "<script>location.href='canalizaciya.php'</script>"; $p_login = $DATAS["login"];
$p_lvl = $DATAS["lvl"];
if ($p1 != "") {
$p1 = "<b>$p1</b> [$p_lvl]<a href='inf.php?login=$p1' target='_blank'><img src='i/inf.gif' border=0></a> ";
if ($t1_all[$n] == 1) {
echo "&nbsp;$p1";
} else {
echo "&nbsp;$p1,";
}
}
}
if (!empty($comment[$n])) {
print"| $comment[$n]";
}
if ($wawe == '0') {
if (!empty($password[$n])) {
echo "<input name='naw_pass' type='hidden' value='$password[$n]'><INPUT type='password' name='pass' size=5> ";
}
echo "<input style=\"font-size:12px;\" name='naw_id' type='hidden' value='$creator[$n]'>
<INPUT style='font-size:12px;' TYPE=submit name=add value='Присоед.'>";
}
echo "</TD></TR></FORM>";
}/////////закрытие
?>
<TR>
<TD></TD>
</TR>
<TR height=1>
<TD height=1 bgcolor=#A0A0A0 colspan=2><SPAN></SPAN></TD>
</TR>
</TABLE>
<?php
///////////////Подача заявки////////////////////
if ($_GET['open']) {
$der = mysql_query("SELECT glav_id FROM vxodd WHERE login='" . $user['login'] . "'");
if ($deras = mysql_fetch_array($der)) {
print "<script>location.href='?warning=4'</script>";
exit; exit;
} }
$time = date("H:i");
$SQL2 = mysql_query("INSERT INTO vxod(date,login,glav_id,comment,pass) VALUES('$time','$login','$user_id','" . $_GET['cmt'] . "','" . $_GET['pass'] . "')");
$SQL2 = mysql_query("INSERT INTO vxodd(login,glav_id,lvl) VALUES('$login','$user_id','$user_lvl')");
if ($SQL2) {
print "<script>location.href='main.php?act=none'</script>";
exit;
} else {
print"Ошибка!!! Сообщите администратору!";
} }
?>
<TD nowrap valign=top>
<HTML>
<div id="mmoves"
style="background-color:#FFFFCC; visibility:hidden; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px; white-space: nowrap;"></div>
</HTML>
<BR>
<DIV align=right>
<form action="city.php" method="GET">
<INPUT style="font-size:12px;" type='button'
onClick="let f;if( f=document.getElementById('REQUEST')){f.action+='#e1';f.submit()} else{location='/main.php?act=none'}"
value=Обновить>
<INPUT style="font-size:12px;" type='submit' name='bps' value=Вернуться>
<input value="Подсказка" style="background-color: rgb(169, 175, 192);"
onclick="window.open('help/canalizaciya.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')"
type="button">
</form>
</DIV>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<?php
} }
?> //////////////Удаление заявки//////////////////////
if ($_GET['del']) {
$e = mysql_query("DELETE FROM vxod WHERE login='$login'");
$es = mysql_query("DELETE FROM vxodd WHERE glav_id='$user_id'");
$ed = mysql_query("DELETE FROM vxodd WHERE login='$login'");
if ($e) {
print "<script>location.href='?warning=1'</script>";
exit;
} else {
print"Ошибка!!! Сообщите администратору!";
}
}
/////////////Присоединится///////////////
if ($_GET['add']) {
$der = mysql_query("SELECT glav_id,id FROM vxodd WHERE login='" . $user['login'] . "'");
if ($deras = mysql_fetch_array($der)) {
print "<script>location.href='?warning=4'</script>";
exit;
}
$den = mysql_query("SELECT id FROM vxodd WHERE glav_id='" . $_GET['naw_id'] . "'");
if (mysql_num_rows($den) >= 4) {
print "<script>location.href='?warning=5'</script>";
exit;
}
if ($_GET['pass'] == $_GET['naw_pass']) {
$rt = mysql_query("select level from users where login='$login'");
$est = mysql_fetch_array($rt);
$s = mysql_query("INSERT INTO vxodd(login,glav_id,lvl) VALUES('$login','" . $_GET['naw_id'] . "','" . $est["level"] . "')");
if ($s) {
print "<script>location.href='?act=none'</script>";
exit;
} else {
print"Ошибка!!! Сообщите администратору!";
}
} else {
print "<script>location.href='?warning=2'</script>";
exit;
}
}
//////////////////Начинаем////////////////////
if ($_GET['start']) {
$zax = mysql_query("select login from vxodd where glav_id='" . $user['id'] . "'");
while ($nana = mysql_fetch_array($zax)) {
$n_login = $nana["login"];
$rty = mysql_query("select id,level,login from users where login='$n_login'");
$esth = mysql_fetch_array($rty);
$est_id = $esth["id"];
$est_login = $esth["login"];
//Время до следующего визита
$vremya = 3600 * 6 + time();
mysql_query('insert into visit_podzem (login,time) values("' . $n_login . '","' . $vremya . '")');
$vrem = 120 * 60 + time();
mysql_query('insert into labirint(user_id, login, location, vector, glav_id, glava, t, l,key1,key2,key3,el,name,visit_time) values("' . $est_id . '", "' . $est_login . '", "16", "0", "' . $user['id'] . '", "' . $user['login'] . '","226","453","99","96","92","47","Канализация 1 этаж","' . $vrem . '")');
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '403',`online`.`room` = '403' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '" . $esth["id"] . "' ;");
}
$ferrr = mysql_query("SELECT * FROM podzem3 WHERE glava='default' and name='Канализация 1 этаж'");
$retr = mysql_fetch_array($ferrr);
mysql_query('insert into podzem3(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,sunduk1,sunduk2,sunduk3,sunduk4,sunduk5,sunduk6,sunduk7)
values("' . $login . '","Канализация 1 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["sunduk1"] . '","' . $retr["sunduk2"] . '","' . $retr["sunduk3"] . '","' . $retr["sunduk4"] . '","' . $retr["sunduk5"] . '","' . $retr["sunduk6"] . '","' . $retr["sunduk7"] . '")');
$ferrr = mysql_query("SELECT * FROM podzem3 WHERE glava='default' and name='Канализация 2 этаж'");
$retr = mysql_fetch_array($ferrr);
mysql_query('insert into podzem3(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,sunduk1,sunduk2,sunduk3,sunduk4,sunduk5,sunduk6,sunduk7)
values("' . $login . '","Канализация 2 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["sunduk1"] . '","' . $retr["sunduk2"] . '","' . $retr["sunduk3"] . '","' . $retr["sunduk4"] . '","' . $retr["sunduk5"] . '","' . $retr["sunduk6"] . '","' . $retr["sunduk7"] . '")');
$ferrr = mysql_query("SELECT * FROM podzem4 WHERE glava='default' and name='Канализация 1 этаж'");
$retr = mysql_fetch_array($ferrr);
mysql_query('insert into podzem4(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,v1,v2,v3,v4,v5,v6,v7,v8,v9,v11,v12,v13,v14,v15,v16,v17,v18,v19,v21,v22,v23,v24,v25,v26,v27,v28,v29,v31,v32,v33,v34,v35,v36,v37,v38,v39,v41,v42,v43,v44,v45,v46,v47,v48,v49,v51,v52,v53,v54,v55,v56,v57,v58,v59,v61,v62,v63,v64,v65,v66,v67,v68,v69,v71,v72,v73,v74,v75,v76,v77,v78,v79,v81,v82,v83,v84,v85,v86,v87,v88,v89,v91,v92,v93,v94,v95,v96,v97,v98,v99)
values("' . $login . '","Канализация 1 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["v1"] . '","' . $retr["v2"] . '","' . $retr["v3"] . '","' . $retr["v4"] . '","' . $retr["v5"] . '","' . $retr["v6"] . '","' . $retr["v7"] . '","' . $retr["v8"] . '","' . $retr["v9"] . '","' . $retr["v11"] . '","' . $retr["v12"] . '","' . $retr["v13"] . '","' . $retr["v14"] . '","' . $retr["v15"] . '","' . $retr["v16"] . '","' . $retr["v17"] . '","' . $retr["v18"] . '","' . $retr["v19"] . '","' . $retr["v21"] . '","' . $retr["v22"] . '","' . $retr["v23"] . '","' . $retr["v24"] . '","' . $retr["v25"] . '","' . $retr["v26"] . '","' . $retr["v27"] . '","' . $retr["v28"] . '","' . $retr["v29"] . '","' . $retr["v31"] . '","' . $retr["v32"] . '","' . $retr["v33"] . '","' . $retr["v34"] . '","' . $retr["v35"] . '","' . $retr["v36"] . '","' . $retr["v37"] . '","' . $retr["v38"] . '","' . $retr["v39"] . '","' . $retr["v41"] . '","' . $retr["v42"] . '","' . $retr["v43"] . '","' . $retr["v44"] . '","' . $retr["v45"] . '","' . $retr["v46"] . '","' . $retr["v47"] . '","' . $retr["v48"] . '","' . $retr["v49"] . '","' . $retr["v51"] . '","' . $retr["v52"] . '","' . $retr["v53"] . '","' . $retr["v54"] . '","' . $retr["v55"] . '","' . $retr["v56"] . '","' . $retr["v57"] . '","' . $retr["v58"] . '","' . $retr["v59"] . '","' . $retr["v61"] . '","' . $retr["v62"] . '","' . $retr["v63"] . '","' . $retr["v64"] . '","' . $retr["v65"] . '","' . $retr["v66"] . '","' . $retr["v67"] . '","' . $retr["v68"] . '","' . $retr["v69"] . '","' . $retr["v71"] . '","' . $retr["v72"] . '","' . $retr["v73"] . '","' . $retr["v74"] . '","' . $retr["v75"] . '","' . $retr["v76"] . '","' . $retr["v77"] . '","' . $retr["v78"] . '","' . $retr["v79"] . '","' . $retr["v81"] . '","' . $retr["v82"] . '","' . $retr["v83"] . '","' . $retr["v84"] . '","' . $retr["v85"] . '","' . $retr["v86"] . '","' . $retr["v87"] . '","' . $retr["v88"] . '","' . $retr["v89"] . '","' . $retr["v91"] . '","' . $retr["v92"] . '","' . $retr["v93"] . '","' . $retr["v94"] . '","' . $retr["v95"] . '","' . $retr["v96"] . '","' . $retr["v97"] . '","' . $retr["v98"] . '","' . $retr["v99"] . '")');
$ferrr = mysql_query("SELECT * FROM podzem4 WHERE glava='default' and name='Канализация 2 этаж'");
$retr = mysql_fetch_array($ferrr);
mysql_query('insert into podzem4(glava,name,n1,n2,n3,n4,n5,n6,n7,n8,n9,n11,n12,n13,n14,n15,n16,n17,n18,n19,n21,n22,n23,n24,n25,n26,n27,n28,n29,n31,n32,n33,n34,n35,n36,n37,n38,n39,n41,n42,n43,n44,n45,n46,n47,n48,n49,n51,n52,n53,n54,n55,n56,n57,n58,n59,n61,n62,n63,n64,n65,n66,n67,n68,n69,n71,n72,n73,n74,n75,n76,n77,n78,n79,n81,n82,n83,n84,n85,n86,n87,n88,n89,n91,n92,n93,n94,n95,n96,n97,n98,n99,v1,v2,v3,v4,v5,v6,v7,v8,v9,v11,v12,v13,v14,v15,v16,v17,v18,v19,v21,v22,v23,v24,v25,v26,v27,v28,v29,v31,v32,v33,v34,v35,v36,v37,v38,v39,v41,v42,v43,v44,v45,v46,v47,v48,v49,v51,v52,v53,v54,v55,v56,v57,v58,v59,v61,v62,v63,v64,v65,v66,v67,v68,v69,v71,v72,v73,v74,v75,v76,v77,v78,v79,v81,v82,v83,v84,v85,v86,v87,v88,v89,v91,v92,v93,v94,v95,v96,v97,v98,v99)
values("' . $login . '","Канализация 2 этаж","' . $retr["n1"] . '","' . $retr["n2"] . '","' . $retr["n3"] . '","' . $retr["n4"] . '","' . $retr["n5"] . '","' . $retr["n6"] . '","' . $retr["n7"] . '","' . $retr["n8"] . '","' . $retr["n9"] . '","' . $retr["n11"] . '","' . $retr["n12"] . '","' . $retr["n13"] . '","' . $retr["n14"] . '","' . $retr["n15"] . '","' . $retr["n16"] . '","' . $retr["n17"] . '","' . $retr["n18"] . '","' . $retr["n19"] . '","' . $retr["n21"] . '","' . $retr["n22"] . '","' . $retr["n23"] . '","' . $retr["n24"] . '","' . $retr["n25"] . '","' . $retr["n26"] . '","' . $retr["n27"] . '","' . $retr["n28"] . '","' . $retr["n29"] . '","' . $retr["n31"] . '","' . $retr["n32"] . '","' . $retr["n33"] . '","' . $retr["n34"] . '","' . $retr["n35"] . '","' . $retr["n36"] . '","' . $retr["n37"] . '","' . $retr["n38"] . '","' . $retr["n39"] . '","' . $retr["n41"] . '","' . $retr["n42"] . '","' . $retr["n43"] . '","' . $retr["n44"] . '","' . $retr["n45"] . '","' . $retr["n46"] . '","' . $retr["n47"] . '","' . $retr["n48"] . '","' . $retr["n49"] . '","' . $retr["n51"] . '","' . $retr["n52"] . '","' . $retr["n53"] . '","' . $retr["n54"] . '","' . $retr["n55"] . '","' . $retr["n56"] . '","' . $retr["n57"] . '","' . $retr["n58"] . '","' . $retr["n59"] . '","' . $retr["n61"] . '","' . $retr["n62"] . '","' . $retr["n63"] . '","' . $retr["n64"] . '","' . $retr["n65"] . '","' . $retr["n66"] . '","' . $retr["n67"] . '","' . $retr["n68"] . '","' . $retr["n69"] . '","' . $retr["n71"] . '","' . $retr["n72"] . '","' . $retr["n73"] . '","' . $retr["n74"] . '","' . $retr["n75"] . '","' . $retr["n76"] . '","' . $retr["n77"] . '","' . $retr["n78"] . '","' . $retr["n79"] . '","' . $retr["n81"] . '","' . $retr["n82"] . '","' . $retr["n83"] . '","' . $retr["n84"] . '","' . $retr["n85"] . '","' . $retr["n86"] . '","' . $retr["n87"] . '","' . $retr["n88"] . '","' . $retr["n89"] . '","' . $retr["n91"] . '","' . $retr["n92"] . '","' . $retr["n93"] . '","' . $retr["n94"] . '","' . $retr["n95"] . '","' . $retr["n96"] . '","' . $retr["n97"] . '","' . $retr["n98"] . '","' . $retr["n99"] . '","' . $retr["v1"] . '","' . $retr["v2"] . '","' . $retr["v3"] . '","' . $retr["v4"] . '","' . $retr["v5"] . '","' . $retr["v6"] . '","' . $retr["v7"] . '","' . $retr["v8"] . '","' . $retr["v9"] . '","' . $retr["v11"] . '","' . $retr["v12"] . '","' . $retr["v13"] . '","' . $retr["v14"] . '","' . $retr["v15"] . '","' . $retr["v16"] . '","' . $retr["v17"] . '","' . $retr["v18"] . '","' . $retr["v19"] . '","' . $retr["v21"] . '","' . $retr["v22"] . '","' . $retr["v23"] . '","' . $retr["v24"] . '","' . $retr["v25"] . '","' . $retr["v26"] . '","' . $retr["v27"] . '","' . $retr["v28"] . '","' . $retr["v29"] . '","' . $retr["v31"] . '","' . $retr["v32"] . '","' . $retr["v33"] . '","' . $retr["v34"] . '","' . $retr["v35"] . '","' . $retr["v36"] . '","' . $retr["v37"] . '","' . $retr["v38"] . '","' . $retr["v39"] . '","' . $retr["v41"] . '","' . $retr["v42"] . '","' . $retr["v43"] . '","' . $retr["v44"] . '","' . $retr["v45"] . '","' . $retr["v46"] . '","' . $retr["v47"] . '","' . $retr["v48"] . '","' . $retr["v49"] . '","' . $retr["v51"] . '","' . $retr["v52"] . '","' . $retr["v53"] . '","' . $retr["v54"] . '","' . $retr["v55"] . '","' . $retr["v56"] . '","' . $retr["v57"] . '","' . $retr["v58"] . '","' . $retr["v59"] . '","' . $retr["v61"] . '","' . $retr["v62"] . '","' . $retr["v63"] . '","' . $retr["v64"] . '","' . $retr["v65"] . '","' . $retr["v66"] . '","' . $retr["v67"] . '","' . $retr["v68"] . '","' . $retr["v69"] . '","' . $retr["v71"] . '","' . $retr["v72"] . '","' . $retr["v73"] . '","' . $retr["v74"] . '","' . $retr["v75"] . '","' . $retr["v76"] . '","' . $retr["v77"] . '","' . $retr["v78"] . '","' . $retr["v79"] . '","' . $retr["v81"] . '","' . $retr["v82"] . '","' . $retr["v83"] . '","' . $retr["v84"] . '","' . $retr["v85"] . '","' . $retr["v86"] . '","' . $retr["v87"] . '","' . $retr["v88"] . '","' . $retr["v89"] . '","' . $retr["v91"] . '","' . $retr["v92"] . '","' . $retr["v93"] . '","' . $retr["v94"] . '","' . $retr["v95"] . '","' . $retr["v96"] . '","' . $retr["v97"] . '","' . $retr["v98"] . '","' . $retr["v99"] . '")');
?>
<script>top.frames['online'].location = 'ch.php?online=' + Math.round(Math.random() * 100000);</script>
<?
mysql_query("DELETE FROM vxod WHERE login='$login'");
mysql_query("DELETE FROM vxodd WHERE glav_id=" . $user['id'] . "");
mysql_query("DELETE FROM vxodd WHERE login='$login'");
print "<script>location.href='canalizaciya.php'</script>";
exit;
}
}
?>
<div>
<div id="mmoves"
style="background-color:#FFFFCC; visibility:hidden; overflow:visible; position:absolute; border-color:#666666; border-style:solid; border-width: 1px; padding: 2px; white-space: nowrap;"></div>
<div style="text-align: right;">
<form action="city.php" method="GET">
<INPUT style="font-size:12px;" type='button'
onClick="let f;if( f=document.getElementById('REQUEST')){f.action+='#e1';f.submit()} else{location='/main.php?act=none'}"
value=Обновить>
<INPUT style="font-size:12px;" type='submit' name='bps' value=Вернуться>
<input value="Подсказка" style="background-color: rgb(169, 175, 192);"
onclick="window.open('help/canalizaciya.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')"
type="button">
</form>
</div>
</div>

View File

@ -596,17 +596,13 @@ VALUES ("?s","?s",?i,?i,?i,"?s","?s",?i,?i,?i,?i)',
} }
$zay = new Zayavka; $zay = new Zayavka;
header("Cache-Control: no-cache");
if (!empty($_POST['open'])) { if (!empty($_POST['open'])) {
$f = fopen("/tmp/zayavka/" . $user->id . ".txt", "w+"); $f = fopen("/tmp/zayavka/" . $user->id . ".txt", "w+");
fputs($f, time()); fputs($f, time());
fclose($f); fclose($f);
} }
Template::header('zayavka');
?> ?>
<HTML lang="ru">
<HEAD>
<link rel=stylesheet href="css/main.css">
<meta charset=utf-8">
<style> <style>
.m { .m {
background: #99CCCC; background: #99CCCC;
@ -618,9 +614,6 @@ if (!empty($_POST['open'])) {
text-align: center; text-align: center;
} }
</style> </style>
<title></title>
</HEAD>
<body>
<TABLE width=100% cellspacing=1 cellpadding=1> <TABLE width=100% cellspacing=1 cellpadding=1>
<TR> <TR>
<TD colspan=5> <TD colspan=5>
@ -1087,10 +1080,4 @@ if ($get == 'current') {
} }
} }
} }
db::c()->query('UNLOCK TABLES');
db::c()->query('UNLOCK TABLES');
?>
</form>
</body>
</html>

View File

@ -1,335 +0,0 @@
<?php
session_start();
$stat_nm = ["1" => "Сила", "2" => "Ловкость", "3" => "Интуиция", "4" => "Выносливость", "5" => "Интеллект", "6" => "Мудрость"];
$stat_nmdb = ["1" => "sila", "2" => "lovk", "3" => "inta", "4" => "vinos", "5" => "intel", "6" => "mudra"];
$stat_nmto = ["1" => "в силу", "2" => "в ловкость", "3" => "в интуицию", "4" => "в выносливость", "5" => "в интеллект", "6" => "в мудрость"];
$trv = "";
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once "functions.php";
if ($user->battle) {
header('location: fbattle.php');
exit;
}
?>
<HTML>
<HEAD>
<link rel=stylesheet href="css/main.css">
<meta charset=utf-8">
<title>Комната знахаря</title>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#e0e0e0>
<div style='color:#8F0000; font-weight:bold; font-size:16px; text-align:center; float:left;'>Комната Знахаря</div>
<div style='float:right; padding-right:6px;'><input type=button value='Вернуться'
OnClick="location.href='city.php?bps=1'"></div>
<div style='clear:both;'></div>
<br>
<? $d = mysql_fetch_array(mysql_query("SELECT sum(`massa`) FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0 ; "));
if ($d[0] > get_meshok()) {
echo "<font color=red><b>У вас переполнен рюкзак, вы не можете передвигаться...</b></font><br>";
} ?>
<b><i>Запахи трав наполняют помещение, непонятные и пугающие предметы скрываются в пляшущих тенях...<br>
Говорят, здесь можно изменить свою судьбу. Стать кем-то иным... кем раньше был лишь в мечтах...</b></i><br><br>
Все имеет цену. Но не все можно купить. Помните - некоторые шансы даются лишь раз в жизни...<br>
<?
$owntravma = mysql_fetch_array(mysql_query("SELECT `type` FROM `effects` WHERE `owner` = " . (int)$_SESSION['uid'] . " AND (type=12 OR type=13 OR type=11 OR type=14 OR type=188 OR type=21 OR type=201 OR type=202);"));
if ($owntravma['type'] == 11 or $owntravma['type'] == 12 or $owntravma['type'] == 13 or $owntravma['type'] == 14) {
echo "<br><font color=red><b>Вы не можете воспользоваться услугами Знахаря имея травму!</b></font>";
exit;
} elseif ($owntravma['type'] == 188 or $owntravma['type'] == 21 or $owntravma['type'] == 201 or $owntravma['type'] == 202) {
echo "<br><font color=red><b>Вы не можете воспользоваться услугами Знахаря находясь под действием эликсиров и эффектов!</b></font>";
exit;
}
if ($_POST['undr'] == '1') undressall((int)$_SESSION['uid']);
$s = mysql_fetch_row(mysql_query("SELECT count(id) FROM inventory WHERE dressed!=0 AND owner=" . (int)$_SESSION['uid']));
if ((int)$s[0] > 0) {
echo "<form method=post>Перед входом в комнату Знахарь требует полного очищения! <input type=hidden value=1 name='undr'><input type=submit value='Раздеться'></form>";
exit;
}
if (@(int)$_POST['move_ab'] > 0 && $user['money'] >= 32) {
if (($stat_nmdb[(int)$_POST['move_ab']] == 'sila' && $user['sila'] < 4) || ($stat_nmdb[(int)$_POST['move_ab']] == 'lovk' && $user['lovk'] < 4) || ($stat_nmdb[(int)$_POST['move_ab']] == 'inta' && $user['inta'] < 4) || ($stat_nmdb[(int)$_POST['move_ab']] == 'vinos' && $user['vinos'] < (4 + $user['level']))) echo "<font color=red><b>Невозможно перераспределить статы ниже минимального уровня.</b></font>";
else {
if (@(int)$_POST['move_ab_top'] > 0) {
$money_need = $user[$stat_nmdb[(int)$_POST['move_ab_top']]] <= 10 ? "10" : $user[$stat_nmdb[(int)$_POST['move_ab_top']]];
#$money_need = 0;
if (@(int)$_POST['move_ab'] == @(int)$_POST['move_ab_top']) echo "<font color=red><b>Переносить умение можно только в другое!</b></font>";
elseif (!$user[$stat_nmdb[(int)$_POST['move_ab']]] > 0) {
echo "<font color=red><b>Недостаточно умений для перераспределения!</b></font>";
} elseif (($user['money'] - $money_need) < 0) {
echo "<font color=red><b>Недостаточно кредитов для совершения операции!</b></font>";
} else {
mysql_query("UPDATE `users` SET `" . $stat_nmdb[(int)$_POST['move_ab']] . "`=(`" . $stat_nmdb[(int)$_POST['move_ab']] . "`-1), `" . $stat_nmdb[(int)$_POST['move_ab_top']] . "`=(`" . $stat_nmdb[(int)$_POST['move_ab_top']] . "`+1), money=(money-" . $money_need . ") WHERE id=" . (int)$_SESSION['uid'] . " ");
echo "<font color=red>Перераспределение статов \"" . $stat_nm[(int)$_POST['move_ab']] . " " . $stat_nmto[(int)$_POST['move_ab_top']] . "\" произведено успешно. Цена операции " . $money_need . "</font>";
$user[$stat_nmdb[(int)$_POST['move_ab_top']]]++;
$user[$stat_nmdb[(int)$_POST['move_ab']]]--;
$user['money'] -= $money_need;
#$trv=settravma((int)$_SESSION['uid'],20,rand(300,600),1);
}
}
}
} elseif ((int)$_POST['sbr_nav'] > 0 && $user['money'] >= 32) {
if (($user['noj'] + $user['mec'] + $user['topor'] + $user['dubina'] + $user['mfire'] + $user['mwater'] + $user['mair'] + $user['mearth'] + $user['mlight'] + $user['mgray'] + $user['mdark']) == 0) echo "<font color=red><b>У Вас нет нераспределённых умений!</b></font>";
elseif (!file_exists('/tmp/memcache/uml' . $_SESSION['uid'])) {
if (mysql_query("UPDATE `users` SET `master` = noj+mec+topor+dubina+mfire+mwater+mair+mearth+mlight+mgray+mdark+master,noj=0,mec=0,topor=0,dubina=0,mfire=0,mwater=0,mair=0,mearth=0,mlight=0,mgray=0,mdark=0,money=(money-32) WHERE `id`= " . (int)$_SESSION['uid'] . " LIMIT 1;")) {
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" перераспределил умения, заплатив 32 кр в Комнате Знахаря. ',1,'" . time() . "');");
echo "<font color=red>Все прошло удачно.Цена операции <b>32</b> кр. Вы можете перераспределить умения.</font>";
$flum = fopen('/tmp/memcache/uml' . $_SESSION['uid'], 'w');
fwrite($flum, date('Y-m-d H:i:s'));
fclose($flum);
$user['money'] -= 32;
$trv = settravma((int)$_SESSION['uid'], 20, rand(300, 600), 1);
} else echo "<font color=red>Произошла ошибка!</font>";
} else {
if ($user['money'] < 32) {
echo "<font color=red><b>Недостаточно кредитов для совершения операции!</b></font>";
} else {
if (mysql_query("UPDATE `users` SET `master` = noj+mec+topor+dubina+mfire+mwater+mair+mearth+mlight+mgray+mdark+master,noj=0,mec=0,topor=0,dubina=0,mfire=0,mwater=0,mair=0,mearth=0,mlight=0,mgray=0,mdark=0,money=(money-32) WHERE `id`= " . (int)$_SESSION['uid'] . " LIMIT 1;")) {
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" перераспределил умения, заплатив 32 кр. в Комнате Знахаря. ',1,'" . time() . "');");
echo "<font color=red>Все прошло удачно.Цена операции <b>32</b> кр. Вы можете перераспределить умения.</font>";
$user['money'] -= 32;
$trv = settravma((int)$_SESSION['uid'], 20, rand(300, 60), 1);
} else echo "<font color=red>Произошла ошибка!</font>";
}
}
} elseif ((int)$_POST['sbr_par'] > 0) {
$expstats = [
/* nextup,summstats*/
"20" => 3, //exp 0-19
"45" => 4, //exp 20-44
"75" => 5, //exp 45-74
"110" => 6, //exp 75-109
"160" => 9, //1лвл, exp 110-159
"215" => 10, //exp 160-214
"280" => 11, //exp 215-279
"350" => 12, //exp 280-349
"410" => 13, //exp 350-409
"530" => 16,//2лвл exp 410-529
"670" => 17,
"830" => 18,
"950" => 19,
"1100" => 20,
"1300" => 21,
"1450" => 24, //3лвл
"1650" => 25,
"1850" => 26,
"2050" => 27,
"2200" => 28,
"2500" => 29,
"2900" => 34, //4лвл
"3350" => 35,
"3800" => 36,
"4200" => 37,
"4600" => 38,
"5000" => 39,
"6000" => 42, //5лвл
"7000" => 43,
"8000" => 44,
"9000" => 45,
"10000" => 46,
"11000" => 47,
"12000" => 48,
"12500" => 49,
"14000" => 52, //6лвл
"15500" => 53,
"17000" => 54,
"19000" => 55,
"21000" => 56,
"23000" => 57,
"27000" => 58,
"30000" => 59,
"60000" => 64, //7лвл
"75000" => 65,
"150000" => 66,
"175000" => 67,
"200000" => 68,
"225000" => 69,
"250000" => 70,
"260000" => 71,
"280000" => 72,
"300000" => 73,
"1500000" => 78,//8лвл
"1750000" => 79,
"2000000" => 80,
"2175000" => 81,
"2300000" => 82,
"2400000" => 83,
"2500000" => 84,
"2600000" => 85,
"2800000" => 86,
"3000000" => 87,
"6000000" => 94,//9лвл
"6500000" => 95,
"7500000" => 96,
"8500000" => 97,
"9000000" => 98,
"9250000" => 99,
"9500000" => 100,
"9750000" => 101,
"9900000" => 102,
"10000000" => 103,
"13000000" => 112,//10лвл
"14000000" => 114,
"15000000" => 116,
"16000000" => 118,
"17000000" => 120,
"17500000" => 122,
"18000000" => 124,
"19000000" => 126,
"19500000" => 128,
"20000000" => 130,
"30000000" => 132,
"32000000" => 134,
"34000000" => 136,
"35000000" => 138,
"36000000" => 140,
"38000000" => 142,
"40000000" => 144,
"42000000" => 146,
"44000000" => 148,
"45000000" => 150,
"46000000" => 152,
"48000000" => 154,
"50000000" => 156,
"52000000" => 158,
"55000000" => 168,//11лвл
"60000000" => 169,
"65000000" => 170,
"70000000" => 171,
"75000000" => 172,
"80000000" => 173,
"85000000" => 174,
"90000000" => 175,
"95000000" => 176,
"100000000" => 177,
"120000000" => 178,
"150000000" => 188,//12лвл
"180000000" => 190,
"210000000" => 192,
"240000000" => 194,
"270000000" => 196,
"310000000" => 198,
"340000000" => 200,
"370000000" => 202,
"400000000" => 204,
"430000000" => 206,
"470000000" => 208,
"500000000" => 210,
"600000000" => 220 //13лвл
];
$vinoslvl = [
/* level,summvinos*/
"0" => 3,
"1" => 4,
"2" => 5,
"3" => 6,
"4" => 7,
"5" => 8,
"6" => 9,
"7" => 10,
"8" => 11,
"9" => 13,
"10" => 16,
"11" => 21,
"12" => 26,
"13" => 31];
if (!file_exists('/tmp/memcache/par' . $_SESSION['uid']) && $user['money'] >= 10) {
if (mysql_query("UPDATE `users` SET `stats` = " . $expstats[$user['nextup']] . ", `sila`=3,`lovk`=3,`inta`=3,`mudra`=0,`intel`=0,`duh`=0,`vinos`= " . $vinoslvl[$user['level']] . ",`maxhp`= " . $vinoslvl[$user['level']] . "*6,`maxmana`= 0,`mana`= '0',`hp`=" . $vinoslvl[$user['level']] . "*6, `money`=(`money`-10) WHERE `id`= " . (int)$_SESSION['uid'] . " LIMIT 1;")) {
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" сбросил параметры, заплатив 10 кр. в Комнате Знахаря. ',1,'" . time() . "');");
echo "<font color=red>Все прошло удачно.Цена операции <b>10</b> кр. Вы можете перераспределить параметры.</font>";
$flum = fopen('/tmp/memcache/par' . $_SESSION['uid'], 'w');
fwrite($flum, date('Y-m-d H:i:s'));
fclose($flum);
$trv = settravma((int)$_SESSION['uid'], 20, rand(300, 600), 1);
$user['money'] -= 10;
} else echo "<font color=red>Произошла ошибка!</font>";
} else {
if ($user['money'] < 10) echo "<font color=red><b>Недостаточно кредитов для совершения операции!</b></font>";
else {
if (mysql_query("UPDATE `users` SET `stats` = " . $expstats[$user['nextup']] . ", `sila`=3,`lovk`=3,`inta`=3,`mudra`=0,`intel`=0,`duh`=0,`vinos`= " . $vinoslvl[$user['level']] . ",`maxhp`= " . $vinoslvl[$user['level']] . "*6,`maxmana`= 0,`mana`= 0,`money`=(`money`-10) WHERE `id`= " . (int)$_SESSION['uid'] . " LIMIT 1;")) {
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" сбросил параметры, заплатив 10 кр. в Комнате Знахаря. ',1,'" . time() . "');");
echo "<font color=red>Все прошло удачно.Цена операции <b>10</b> кр. Вы можете перераспределить параметры.</font>";
$trv = settravma((int)$_SESSION['uid'], 20, rand(300, 600), 1);
$user['money'] -= 10;
} else echo "<font color=red>Произошла ошибка!</font>";
}
}
}
if ($trv != "") echo "<br>Вы чувствуете слабость.. " . $trv . "";
?>
<br>Деньги: <b><?= $user['money']; ?></b> кр.
<br><br>
<fieldset>
<legend style='font-weight:bold; color:#8F0000;'>Навыки владения оружием и магией</legend>
<form method=post><input type=hidden value='<?= $_SESSION['uid']; ?>' name='sbr_nav'> У Вас есть шанс забыть старое
ради нового: <input type=submit
value='Отпустить умения <? echo file_exists('/tmp/memcache/uml' . $_SESSION['uid']) ? "(32кр.)" : "(32кр.)" ?>'>
</form>
</fieldset>
<br><br>
<fieldset>
<legend style='font-weight:bold; color:#8F0000;'>Параметры</legend>
<form method=post><input type=hidden value='<?= $_SESSION['uid']; ?>' name='sbr_par'> У Вас есть шанс забыть старое
ради нового: <input type=submit
value='Отпустить параметры <? echo file_exists('/tmp/memcache/par' . $_SESSION['uid']) ? "(10кр.)" : "(10кр.)" ?>'>
</form>
</fieldset>
<br><br>
<fieldset>
<legend style='font-weight:bold; color:#8F0000;'>Параметры</legend>
Вы можете стать иным - более ловким, сильным или мудрым... но лишь за счет других параметров<br>
<? echo $stat_nm[1] . " " . $user['sila']; ?><br>
<? echo $stat_nm[2] . " " . $user['lovk']; ?><br>
<? echo $stat_nm[3] . " " . $user['inta']; ?><br>
<? echo $stat_nm[4] . " " . $user['vinos']; ?><br>
<? echo $stat_nm[5] . " " . $user['intel']; ?><br>
<? echo $stat_nm[6] . " " . $user['mudra']; ?><br>
<form method=post>
Перенести <select name='move_ab'>
<option value=1><?= $stat_nm[1]; ?></option>
<option value=2><?= $stat_nm[2]; ?></option>
<option value=3><?= $stat_nm[3]; ?></option>
<option value=4><?= $stat_nm[4]; ?></option>
<option value=5><?= $stat_nm[5]; ?></option>
<option value=6><?= $stat_nm[6]; ?></option>
</select> в
<select name='move_ab_top'>
<option value=1><? echo $stat_nmto[1] . " " . ($user['sila'] <= 10 ? "10 кр." : $user['sila'] . " кр.") ?></option>
<option value=2><? echo $stat_nmto[2] . " " . ($user['lovk'] <= 10 ? "10 кр." : $user['lovk'] . " кр.") ?></option>
<option value=3><? echo $stat_nmto[3] . " " . ($user['inta'] <= 10 ? "10 кр." : $user['inta'] . " кр.") ?></option>
<option value=4><? echo $stat_nmto[4] . " " . ($user['vinos'] <= 10 ? "10 кр." : $user['vinos'] . " кр.") ?></option>
<option value=5><? echo $stat_nmto[5] . " " . ($user['intel'] <= 10 ? "10 кр." : $user['intel'] . " кр.") ?></option>
<option value=6><? echo $stat_nmto[6] . " " . ($user['mudra'] <= 10 ? "10 кр." : $user['mudra'] . " кр.") ?></option>
</select><br>
<!--
<select name='move_ab_top'>
<option value=1><? echo $stat_nmto[1] . " Бесплатно"; ?></option>
<option value=2><? echo $stat_nmto[2] . " Бесплатно"; ?></option>
<option value=3><? echo $stat_nmto[3] . " Бесплатно"; ?></option>
<option value=4><? echo $stat_nmto[4] . " Бесплатно"; ?></option>
<option value=5><? echo $stat_nmto[5] . " Бесплатно"; ?></option>
<option value=6><? echo $stat_nmto[6] . " Бесплатно"; ?></option>
</select><br>
-->
Роспись: <input type=submit value='Согласен'></form>
</fieldset>
</BODY>
</HTML>