This commit is contained in:
lopar 2019-01-18 21:56:07 +02:00
parent 0d5f5c1a43
commit b8a9a0622b
6 changed files with 543 additions and 568 deletions

214
city.php
View File

@ -35,53 +35,29 @@ function can_i_move()
$eff = db::c()->query('SELECT `type` FROM `effects` WHERE `owner` = ?i AND (`type` = 10 OR `type` = 13 OR `type` = 14)', $user['id'])->fetch_assoc();
if ($d['mass'] > get_meshok()) {
err('У вас переполнен рюкзак, вы не можете передвигаться...');
$location[0] = NULL;
return false;
}
if ($eff['type'] == 10) {
err('Вы парализованы и не можете передвигаться...');
$location[0] = NULL;
return false;
}
if ($eff['type'] == 13 OR $eff['type'] == 14) {
err('У вас тяжелая травма, вы не можете передвигаться...');
$location[0] = NULL;
return false;
}
return true;
}
/**
* Перемещаемся по заданным параметрам в пределах страницы
* @param int $room - номер локации
* @param string $roomname - название локации
*/
function move_to_inside($room = 0, $roomname = 'неизвестное место')
function move($room, $redirect = false)
{
if (can_i_move()) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $_SESSION['uid']);
?>
<html>
<head>
<link rel="stylesheet" href="css/main.css">
<meta charset="utf-8">
</head>
<body>
<?php
die("
<script>setTimeout(function(){location.href='city.php'} , 5000);</script>
<div style='margin: auto; text-align:center;'>
<img src='i/ajax-loader.gif'><br><i>Переходим на $roomname...</i>
</div>
");
if ($redirect) {
header('location: ' . $redirect);}
die();
}
/**
* Перемещаемся по заданным параметрам за пределами страницы
* @param int $room - номер локации
* @param string $redirect - имя скрипта на который идёт редирект
*/
function move_to_outside($room = 0, $redirect = 'city')
{
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $_SESSION['uid']);
header('location: ' . $redirect);
}
$dig_raw = db::c()->query('SELECT `finish_dig`, `finish_guard` FROM `digger` WHERE `id` = ?i', $user['id'])->fetch_assoc();
@ -95,28 +71,28 @@ $location = explode('/', filter_input(INPUT_SERVER, 'QUERY_STRING'));
can_i_move();
switch ($location[0]) {
case 'cp':
move_to_inside(20, 'Центральную площадь');
move(20);
break;
case 'strah':
move_to_inside(21, 'Страшилкину Улицу');
move(21);
break;
case 'bps':
move_to_inside(26, 'Большую Парковую улицу');
move(26);
break;
case 'ps':
move_to_inside(51, 'Парковую улицу');
move(51);
break;
case 'zaliv':
move_to_inside(2111, 'Ристалище');
move(2111);
break;
case 'zamk':
move_to_inside(2601, 'Замковую площадь');
move(2601);
break;
case 'abog':
move_to_inside(2655, 'Арену Богов');
move(2655);
break;
case 'torg':
move_to_inside(2702, 'Торговую улицу');
move(2702);
break;
case 'got':
if ($user['room'] == 20) {
@ -138,25 +114,25 @@ switch ($location[0]) {
header('location: city.php?torg');
break;
case 'level17':
move_to_outside(50, 'ashop.php');
move(50, 'ashop.php');
break;
case 'level2':
move_to_outside(22, 'shop.php');
move(22, 'shop.php');
break;
case 'level4':
move_to_outside(23, 'repair.php');
move(23, 'repair.php');
break;
case 'level10':
move_to_outside(35, 'krshop.php');
move(35, 'krshop.php');
break;
case 'level9':
move_to_outside(24, 'new_year.php');
move(24, 'new_year.php');
break;
case 'level6':
move_to_outside(27, 'post.php');
move(27, 'post.php');
break;
case 'level3':
move_to_outside(26, 'comission.php');
move(25, 'comission.php');
break;
}
} elseif ($user['room'] == 21) {
@ -168,19 +144,19 @@ switch ($location[0]) {
header('location: city.php?zaliv');
break;
case 'level13':
move_to_outside(34, 'fshop.php');
move(34, 'fshop.php');
break;
case 'level5':
move_to_outside(29, 'bank.php');
move(29, 'bank.php');
break;
case 'level16':
move_to_outside(31, 'tower.php');
move(31, 'tower.php');
break;
case 'level14':
move_to_outside(30, 'klanedit.php');
move(30, 'klanedit.php');
break;
case 'level650':
move_to_outside(650, 'ul_clans.php');
move(650, 'ul_clans.php');
break;
}
} elseif ($user['room'] == 2111) {
@ -192,16 +168,16 @@ switch ($location[0]) {
header('location: city.php?haos');
break;
case 'level203':
move_to_outside(1055, 'group_arena.php');
move(1055, 'group_arena.php');
break;
case 'level1000':
move_to_outside(620, 'enter_cave.php');
move(620, 'enter_cave.php');
break;
case 'room666':
move_to_outside(666, 'jail.php');
move(666, 'jail.php');
break;
case 'level5':
move_to_outside(203, 'church.php');
move(203, 'church.php');
break;
}
} elseif ($user['room'] == 2601) {
@ -213,25 +189,25 @@ switch ($location[0]) {
header('location: city.php?abog');
break;
case 'level21':
move_to_outside(87, 'dshop.php');
move(87, 'dshop.php');
break;
case 'level10':
move_to_outside(35, 'krshop.php');
move(35, 'krshop.php');
break;
case 'level44':
move_to_outside(203, 'church.php');
move(203, 'church.php');
break; /*FIXME Второй вход в церковь?*/
case 'level1':
move_to_outside(37, 'gotzamok.php');
move(37, 'gotzamok.php');
break;
case 'level1052':
move_to_outside(1053, 'repshop.php');
move(1053, 'repshop.php');
break;
case 'level1051':
move_to_outside(1051, 'lab_enter.php');
move(1051, 'lab_enter.php');
break;
case 'level5':
move_to_outside(404, 'vxod.php');
move(404, 'vxod.php');
break;
}
} elseif ($user['room'] == 2701) {
@ -240,7 +216,7 @@ switch ($location[0]) {
header('location: city.php?zaliv');
break;
case 'level2':
move_to_outside(402, 'lab_chaos_enter.php');
move(402, 'lab_chaos_enter.php');
break;
}
} elseif ($user['room'] == 2702) {
@ -249,13 +225,13 @@ switch ($location[0]) {
header('location: city.php?cp');
break;
case 'level5':
move_to_outside(1054, 'fontan_luck.php');
move(1054, 'fontan_luck.php');
break;
case 'level202':
move_to_outside(1054, 'fontan_luck.php');
move(1054, 'fontan_luck.php');
break;
case 'level6':
move_to_outside(61, 'akadem.php');
move(61, 'akadem.php');
break;
}
} elseif ($user['room'] == 2655) {
@ -264,7 +240,7 @@ switch ($location[0]) {
header('location: city.php?zamk');
break;
case 'level2055':
move_to_outside(603, 'aren_of_angels.php');
move(603, 'aren_of_angels.php');
break;
}
} elseif ($user['room'] == 26) {
@ -276,47 +252,73 @@ switch ($location[0]) {
header('location: city.php?zamk');
break;
case 'level5':
move_to_outside(43, 'znahar.php');
move(43, 'znahar.php');
break;
case 'level660':
move_to_outside(660, 'hostel.php');
move(660, 'hostel.php');
break;
case 'level20':
move_to_outside(223, 'bench.php');
move(223, 'bench.php');
break;
case 'level21':
move_to_outside(222, 'bench_s.php');
move(222, 'bench_s.php');
break;
case 'level22':
move_to_outside(224, 'bench_m.php');
move(224, 'bench_m.php');
break;
case 'level7':
move_to_outside(777, 'obshaga.php');
move(777, 'obshaga.php');
break;
case 'level11':
move_to_outside(42, 'lotery.php');
move(42, 'lotery.php');
break;
case 'level56':
move(401, 'hell.php');
break;
// case 'level5':
// move_to_outside(401, 'hell.php');
// break;
// case 'level6':
// move_to_outside(110, 'jackill.php');
// break;
}
}
break;
}
function getSeason()
{
$todayMonth = date('n');
if ($todayMonth >= 3 && $todayMonth <= 5) return 'spring_';
if ($todayMonth >= 6 && $todayMonth <= 8) return 'summer_';
if ($todayMonth >= 9 && $todayMonth <= 11) return 'autumn_';
return 'winter_';
}
function buildset($id, $img, $top, $left, $des, $noSeason = 0)
{
if (!$noSeason) $img = getSeason() . $img;
?>
<div style="position:absolute; left:<?= $left ?>px; top:<?= $top ?>px; z-index:90; cursor: pointer;">
<img src="i/city/sub/<?= $img ?>.png" alt="<?= $des ?>" title="<?= $des ?>" class="building"
id="<?= $id ?>" onclick="solo(<?= $id ?>)"/>
</div>
<?php
}
function bgset($img)
{
$daytime = date('H');
if ($daytime >= 6 && $daytime <= 21) $background = getSeason() . $img . '_day';
else $background = getSeason() . $img . '_night';
echo sprintf('<div style="position:relative; display: inline-block;" id="ione"><img src="i/city/%s.jpg">', $background);
}
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
?>
<!doctype html>
<html>
<HEAD>
<link rel=stylesheet href="css/main.css">
<link rel="stylesheet" href="/locations/style.css"/>
<meta charset="utf-8">
<style>
img.building:hover {filter:drop-shadow(2px 2px 2px white) sepia(15%);}
img.building:hover {
filter: drop-shadow(2px 2px 2px white) sepia(15%);
}
</style>
<script type="text/javascript">
function solo(n) {
@ -340,51 +342,7 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
<TR>
<TD align=center colspan=2>
<?php
function getSeason()
{
$todayMonth = date('n');
if ($todayMonth >= 3 && $todayMonth <= 5) return 'spring_';
elseif ($todayMonth >= 6 && $todayMonth <= 8) return 'summer_';
elseif ($todayMonth >= 9 && $todayMonth <= 11) return 'autumn_';
else return 'winter_';
}
function buildset_old($id, $img, $top, $left, $des, $noSeason = 0)
{
if (!$noSeason) $img = getSeason() . $img;
?>
<div style="position:absolute; left:<?= $left ?>px; top:<?= $top ?>px; z-index:90; cursor: pointer;">
<img src="i/city/sub/<?= $img ?>.png" alt="<?= $des ?>" title="<?= $des ?>" class="aFilter2"
id="<?= $id ?>"
onmouseover="this.src='i/city/sub/<?= $img ?>2.png'"
onmouseout="this.src='i/city/sub/<?= $img ?>.png'" onclick="solo(<?= $id ?>)"/>
</div>
<?php
}
function buildset($id, $img, $top, $left, $des, $noSeason = 0)
{
if (!$noSeason) $img = getSeason() . $img;
?>
<div style="position:absolute; left:<?= $left ?>px; top:<?= $top ?>px; z-index:90; cursor: pointer;">
<img src="i/city/sub/<?= $img ?>.png" alt="<?= $des ?>" title="<?= $des ?>" class="building"
id="<?= $id ?>" onclick="solo(<?= $id ?>)"/>
</div>
<?php
}
function bgset($img)
{
$daytime = date('H');
if ($daytime >= 6 && $daytime <= 21) $background = getSeason() . $img . '_day';
else $background = getSeason() . $img . '_night';
echo sprintf('<div style="position:relative; display: inline-block;" id="ione"><img src="i/city/%s.jpg">', $background);
/**
* Исходные строки:
* echo "<table width=1><tr><td><div style=\"position:relative; cursor: pointer;\" id=\"ione\"><img src=\"i/city/", $fon, ".jpg\" alt=\"\" border=\"0\"/>";
* echo "</div></td></tr></table>";
*/
}
if ($user['room'] == 20) {
bgset('cap_cp');

31
classes/magic/attack.php Normal file
View File

@ -0,0 +1,31 @@
<?php
namespace magic\attack;
class attack
{
private $target_user;
private $caster;
private function __construct($target_user_id)
{
if (!$this->caster)
$this->caster = \db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $_SESSION['uid']);
if (!$this->target_user)
$this->target_user = \db::c()->query('SELECT * FROM `users` WHERE `id` = ?i', $target_user_id);
if ($this->checks() == 1) return 'Done!';
}
private function checks()
{
if ($this->caster['battle']) return 'Не в бою...';
else return 1;
}
public static function id($playerId)
{
return new self($playerId);
}
}

View File

@ -1,16 +1,24 @@
<?php
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
if (!$user['login']) header("Location: index.php");
if ($user['level']<1) { header("Location: main.php"); die(); }
if ($user['room'] != 25) { header("Location: main.php"); die(); }
include "functions.php";
$d = mysql_fetch_array(mysql_query("SELECT sum(`massa`) FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `setsale` = 0 ; "));
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
require_once 'functions.php';
if ($_GET['sale'] && $_GET['kredit'] && $_GET['n']) {
if ($user['level'] < 1) {
header("Location: main.php");
die();
}
if ($user['room'] != 25) {
header("Location: main.php");
die();
}
if ($user['battle'] != 0) {
header('location: fbattle.php');
die();
}
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));
if ($get == 'sale' && $_GET['kredit'] && $_GET['n']) {
$_GET['kredit'] = round($_GET['kredit'], 2);
if ((is_numeric($_GET['kredit']) && $_GET['kredit'] > 0) && (is_numeric($_GET['n']) && $_GET['n'] > 0)) {
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `dressed`=0 AND `id` = '{$_GET['n']}' AND `owner` = '{$_SESSION['uid']}' LIMIT 1;"));
@ -19,8 +27,7 @@
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" сдал предмет: \"" . $dress['name'] . "\" id:(cap" . $dress['id'] . ") [" . $dress['duration'] . "/" . $dress['maxdur'] . "] в комиссионку за " . $_GET['kredit'] . " кр. ',1,'" . time() . "');");
echo "<font color=red><b>Вы сдали в магазин \"{$dress['name']}\" за {$_GET['kredit']} кр.</b></font>";
}
}
else {
} else {
echo "<font color=red><b>Не надо так делать</b></font>";
}
}
@ -37,38 +44,39 @@
$user['money'] = $user['money'] - 1;
echo "<font color=red><b>Вы забрали из магазина \"" . $dress['name'] . "\" за 1 кр.</b></font>";
}
else {
} else {
echo "<font color=red><b>Произошла ошибка. Вещь не найдена в магазине!</b></font>";
}
}
else {
} else {
echo "<font color=red><b>Не надо так делать</b></font>";
}
}
else {
} else {
echo "<font color=red><b>У вас недостаточно денег на уплату комиссии.</b></font>";
}
}
if (($_GET['set'] OR $_POST['set'])) {
if ($_GET['set']) { $set = $_GET['set']; }
if ($_POST['set']) { $set = $_POST['set']; }
if (!$_POST['count'] || !is_numeric($_POST['count']) || $_POST['count']<=0) { $_POST['count'] =1; }
if ($_GET['set']) {
$set = $_GET['set'];
}
if ($_POST['set']) {
$set = $_POST['set'];
}
if (!$_POST['count'] || !is_numeric($_POST['count']) || $_POST['count'] <= 0) {
$_POST['count'] = 1;
}
if (is_numeric($set) && $set > 0) {
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `dressed`=0 AND `id` = '{$set}' and `owner`!='" . $user['id'] . "' AND `setsale` > '0' LIMIT 1;"));
$userfrom = mysql_fetch_array(mysql_query("SELECT `login`,`id` FROM `users` WHERE `id` = '" . $dress['owner'] . "' LIMIT 1;"));
$d = mysql_fetch_array(mysql_query("SELECT sum(`massa`) FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `setsale` = 0 ; "));
if ($userfrom['id'] && $dress['id']) {
if (($dress['massa'] + $d[0]) > (get_meshok())) {
echo "<font color=red><b>Недостаточно места в рюкзаке.</b></font>";
}
elseif ($user['money'] >= $dress['setsale']) {
if(mysql_query("UPDATE `inventory` SET `owner` = '{$user['id']}', `setsale` = 0 WHERE `id` = '{$set}' AND `setsale` > '0' LIMIT 1;"))
{
} elseif ($user['money'] >= $dress['setsale']) {
if (mysql_query("UPDATE `inventory` SET `owner` = '{$user['id']}', `setsale` = 0 WHERE `id` = '{$set}' AND `setsale` > '0' LIMIT 1;")) {
$good = 1;
}
else {
} else {
$good = 0;
}
@ -92,21 +100,18 @@
mysql_query("INSERT INTO `telegraph` (`receiver`,`date`,`text`) values ('" . $userfrom['id'] . "','','" . '<font color=red>Внимание!</font> Успешно продан предмет "' . $dress['name'] . '" за ' . $dress['setsale'] . ' кр. Комиссия составила ' . $komiss . ' кр. Вам перечислено от комиссионного магазина ' . $moneyto . ' кр. ' . "');");
}
}
}
else {
} else {
echo "<font color=red><b>Недостаточно денег или нет вещей в наличии.</b></font>";
}
}
else {
} else {
echo "<font color=red><b>Вещь не найдена в магазине</b></font>";
}
}
else {
} else {
echo "<font color=red><b>Не надо так делать</b></font>";
}
}
if ($_GET['unsale'] && $_GET['kredit'] && $_GET['id']) {
if ($get == 'sale' && $_GET['kredit'] && $_GET['id']) {
if ((is_numeric($_GET['kredit']) && $_GET['kredit'] > 0) && (is_numeric($_GET['id']) && $_GET['id'] > 0)) {
$dress = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `dressed`=0 AND `id` = '{$_GET['id']}' AND `owner` = '{$_SESSION['uid']}' AND `setsale` > 0 LIMIT 1;"));
if ($dress['id']) {
@ -117,66 +122,116 @@
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','\"" . $user['login'] . "\" заплатил 0.1 кр за смену цены на предмет \"" . $dress['name'] . "\" id:(cap" . $dress['id'] . ") [" . $dress['duration'] . "/" . $dress['maxdur'] . "] в комиссионке ',1,'" . time() . "');");
$user['money'] = $user['money'] - 0.1;
echo "<font color=red><b>Вы изменили цену \"{$dress['name']}\" на {$_GET['kredit']} кр.</b></font>";
}
else {
} else {
echo "<font color=red><b>У вас недостаточно денег на выполнение операции.</b></font>";
}
}
else {
} else {
echo "<font color=red><b>Предмет не найден.</b></font>";
}
}
else {
} else {
echo "<font color=red><b>Не надо так делать</b></font>";
}
}
$shopCategoryTypeNumber = empty($_GET['otdel']) ?: $_GET['otdel'];
switch ($shopCategoryTypeNumber) {
default:
$shopCategoryType = "Предметы в инвентаре";
$saleItems = true;
break;
case 1:
$shopCategoryType = "Кинжалы";
break;
case 11:
$shopCategoryType = "Топоры";
break;
case 12:
$shopCategoryType = "Дубины";
break;
case 13:
$shopCategoryType = "Мечи";
break;
case 2:
$shopCategoryType = "Сапоги";
break;
case 21:
$shopCategoryType = "Перчатки";
break;
case 22:
$shopCategoryType = "Легкая броня";
break;
case 23:
$shopCategoryType = "Тяжелая броня";
break;
case 24:
$shopCategoryType = "Шлемы";
break;
case 3:
$shopCategoryType = "Щиты";
break;
case 4:
$shopCategoryType = "Серьги";
break;
case 41:
$shopCategoryType = "Ожерелья";
break;
case 42:
$shopCategoryType = "Кольца";
break;
case 5:
$shopCategoryType = "Заклинания: нейтральные";
break;
case 51:
$shopCategoryType = "Заклинания: боевые и защитные";
break;
case 6:
$shopCategoryType = "Амуниция";
break;
case 52:
$shopCategoryType = "Руны";
break;
}
?>
<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>
<HTML>
<HEAD>
<link rel=stylesheet href="css/main.css">
<script src="js/main.js"></script>
<meta charset="utf-8">
<SCRIPT LANGUAGE="JavaScript">
<!--
function sale(name, txt, n, kr)
{
function sale(name, txt, n, kr) {
var s = prompt("Сдать в магазин \"" + txt + "\". Укажите цену:", kr);
if ((s != null)&&(s != '')) {
if ((s != null) && (s !== '')) {
location.href = "comission.php?sale=" + name + "&kredit=" + s + "&n=" + n;
}
}
function chsale(name, txt, id, category, kr)
{
function chsale(name, txt, id, category, kr) {
var s = prompt("Сменить цену для предмета \"" + txt + "\". Укажите новую цену:", kr);
if ((s != null)&&(s != '')) {
if ((s != null) && (s !== '')) {
location.href = "comission.php?unsale=" + name + "&id=" + id + "&sc=" + category + "&kredit=" + s;
}
}
//-->
</SCRIPT>
</HEAD>
<body leftmargin=5 topmargin=5 marginwidth=5 marginheight=5 bgcolor=#d4d4d4>
<body>
<div style="float: right;">
<button onclick="hrefToFrame('?sale')">Сдать вещи в магазин</button>
<button onclick="hrefToFrame('?unsale')">Забрать вещи из магазина</button>
<button onclick="hrefToFrame('city.php?cp=1')">Вернуться</button>
</div>
<TABLE width=100% cellspacing="0" cellpadding="4">
<TR>
<TD valign=top align=left>
<!--Комиссионный Магазин-->
<TABLE width=100% cellspacing="0" cellpadding="0" bgcolor="#A5A5A5">
<TR>
<TD align=center><B>Отдел "<?php
if ($_REQUEST['sale']) {
echo "Сдать вещи";
} elseif ($_REQUEST['unsale']) {
echo "Забрать вещи";
} else
<TD align=center>
<B>Отдел "<?php
if ($_REQUEST['sale']) echo "Сдать вещи";
elseif ($_REQUEST['unsale']) echo "Забрать вещи";
else
switch ($_GET['otdel']) {
case null:
if (!$_REQUEST['max']) {
echo "Оружие: кастеты,ножи"; }
if (!$_REQUEST['max']) echo "Оружие: кастеты,ножи";
else echo $_REQUEST['max'];
$_GET['otdel'] = 1;
break;
@ -237,27 +292,23 @@ switch ($_GET['otdel']) {
case 71:
echo "Сувениры: подарки";
break;
}
?>"</B>
</TD>
</TR>
<TR><TD><!--Рюкзак-->
<TR>
<TD><!--Рюкзак-->
<TABLE BORDER=0 WIDTH=100% CELLSPACING="1" CELLPADDING="2" BGCOLOR="#A5A5A5">
<?
<?php
if ($_REQUEST['max']) {
$data = mysql_query("SELECT * FROM `inventory` WHERE `dressed`=0 AND `name` LIKE '" . mysql_escape_string($_REQUEST['max']) . "%' AND `setsale` > 0 ORDER by `setsale` ASC");
while ($row = mysql_fetch_array($data)) {
$row['count'] = 1;
$row['cost'] = $row['setsale'];
if ($i==0) { $i = 1; $color = '#C7C7C7';} else { $i = 0; $color = '#D5D5D5'; }
echo "<TR bgcolor={$color}><TD align=center style='width:150px'><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
if ($row['owner'] != $user['id']) {
?>
<BR><A HREF="comission.php?otdel=<?=$_GET['otdel']?>&set=<?=$row['id']?>&sid=">купить</A></TD>
<BR>
<A HREF="comission.php?otdel=<?= $_GET['otdel'] ?>&set=<?= $row['id'] ?>&sid=">купить</A></TD>
<?php
} else {
?>
@ -268,16 +319,15 @@ if ($_REQUEST['max']) {
showitem($row);
echo "</TD></TR>";
}
}
elseif ($_REQUEST['sale']) {
} elseif ($_REQUEST['sale']) {
echo "<TR bgcolor=#C7C7C7><TD align=center colspan=2>Комиссия за услуги магазина составляет 10% от цены, по которой вы предлагаете предмет.</TD></TR>";
$data = mysql_query("SELECT * FROM `inventory` WHERE `setsale` = 0 AND `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `present` = '' ORDER by `update` DESC; ");
while ($row = mysql_fetch_array($data)) {
$row['count'] = 1;
if ($i==0) { $i = 1; $color = '#C7C7C7';} else { $i = 0; $color = '#D5D5D5'; }
echo "<TR bgcolor={$color}><TD align=center style='width:150px'><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?>
<BR><A onclick="sale('1', '<?=$row['name']?>', '<?=$row['id']?>', '<?=$row['cost']?>');" HREF="#">ать в магазин</A>
<BR>
<A onclick="sale('1', '<?= $row['name'] ?>', '<?= $row['id'] ?>', '<?= $row['cost'] ?>');"
HREF="#">ать в магазин</A>
</TD>
<?php
echo "<TD valign=top>";
@ -287,20 +337,19 @@ elseif ($_REQUEST['sale']) {
} elseif ($_REQUEST['unsale']) {
$data = mysql_query("SELECT * FROM `inventory` WHERE `setsale` > 0 AND `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 ORDER by `update` DESC; ");
while ($row = mysql_fetch_array($data)) {
$row['count'] = 1;
if ($i==0) { $i = 1; $color = '#C7C7C7';} else { $i = 0; $color = '#D5D5D5'; }
echo "<TR bgcolor={$color}><TD align=center style='width:150px'><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?>
<BR><A HREF="?back=<?= $row['id'] ?>&sid=&unsale=1">забрать за 1 кр.</A>
<BR><A onclick="chsale('1', '<?=$row['name']?>', <?=$row['id']?>, '1', '<?=$row['setsale']?>')" HREF="#">сменить цену<BR>за 0.1 кр.</A>
<BR>
<A onclick="chsale('1', '<?= $row['name'] ?>', <?= $row['id'] ?>, '1', '<?= $row['setsale'] ?>')"
HREF="#">сменить цену<BR>за 0.1 кр.</A>
</TD>
<?php
echo "<TD valign=top>";
showitem($row);
echo "</TD></TR>";
}
} else
{
} else {
$data = mysql_query("SELECT DISTINCT `img`, `name`, `nalign`,`massa` FROM `inventory` WHERE `dressed`=0 AND `setsale` > 0 AND `present` = '' AND `otdel` = '" . $_GET['otdel'] . "' GROUP BY `img` ORDER by `cost` ASC");
while ($row = mysql_fetch_array($data)) {
$item_name1 = str_replace("+1", "", $row[1]);
@ -310,78 +359,70 @@ elseif ($_REQUEST['sale']) {
$item_name1 = str_replace("+5", "", $item_name1);
$item_name = str_replace(" (мф)", "", $item_name1);
$item = mysql_fetch_array(mysql_query("SELECT count(`id`), min(duration), min(maxdur), max(duration), max(maxdur), min(setsale), max(setsale) FROM `inventory` WHERE `dressed`=0 AND `setsale` > 0 AND `present` = '' AND name LIKE '" . $item_name . "%';"));
//$row['count']=1;
if ($i==0) { $i = 1; $color = '#C7C7C7';} else { $i = 0; $color = '#D5D5D5'; }
?>
<TR bgcolor=<?= $color ?>>
<TD align=center><IMG SRC="i/sh/<?=$row['img']?>" ALT="" ><BR><A HREF="comission.php?&max=<?=$item_name?>">подробнее</A></TD>
<TD align=center><IMG SRC="i/sh/<?= $row['img'] ?>" ALT=""><BR><A
HREF="comission.php?&max=<?= $item_name ?>">подробнее</A></TD>
<TD valign=top><A HREF="#"><?= $item_name ?></a>
<IMG SRC="i/align_<?=$row[2]?>.gif" WIDTH="12" HEIGHT="15" ALT=""> (Масса: <?=$row['massa']?>) <BR>
<b>Цена: <?=round($item[5],2)?> - <?=round($item[6],2)?> кр.</b> <small>(количество: <?=$item[0]?>)</small><BR>
<IMG SRC="i/align_<?= $row[2] ?>.gif" WIDTH="12" HEIGHT="15" ALT="">
(Масса: <?= $row['massa'] ?>) <BR>
<b>Цена: <?= round($item[5], 2) ?> - <?= round($item[6], 2) ?> кр.</b>
<small>(количество: <?= $item[0] ?>)</small>
<BR>
Долговечность: <?=$item[1]?>-<?=$item[2]?>/<?=$item[3]?>-<?=$item[4]?></FONT><BR>
Долговечность: <?= $item[1] ?>-<?= $item[2] ?>/<?= $item[3] ?>
-<?= $item[4] ?></FONT><BR>
</TD>
</TR>
<?
}
}
?>
</TABLE>
</TD></TR>
</TABLE>
</TD>
<TD valign=top width=280>
<TABLE border=0 width=100% cellspacing="0" cellpadding="0">
<td align=right>
<FORM action="comission.php" method=GET>
<INPUT TYPE="button" value="Подсказка" style="background-color:#A9AFC0" onclick="window.open('help/shop.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')">
<INPUT TYPE="button" onclick="location.href='city.php?cp=1';" value="Вернуться" name="cp">
</table>
<div style="MARGIN-LEFT:15px; MARGIN-TOP: 10px;">
<INPUT TYPE="submit" value="Сдать вещи в магазин" name="sale"><BR>
<INPUT TYPE="submit" value="Забрать вещи из магазина" name="unsale"><BR>
<div style="background-color:#d2d0d0;padding:1"><center><font color="#oooo"><B>Отделы магазина</B></center></div>
<b>Оружие:</b> <BR>
<A HREF="?otdel=1&sid=&0.162486541405194">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;кастеты,ножи</A><BR>
<A HREF="?otdel=11&sid=&0.337606814894404">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;топоры</A><BR>
<A HREF="?otdel=12&sid=&0.286790872806733">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;дубины,булавы</A><BR>
<A HREF="?otdel=13&sid=&0.0943516060419363">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;мечи</A><BR>
<b>Одежда:</b> <BR>
<A HREF="?otdel=2&sid=&0.76205958316951">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;сапоги</A><BR>
<A HREF="?otdel=21&sid=&0.648260824682342">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;перчатки</A><BR>
<A HREF="?otdel=22&sid=&0.520447517792988">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;легкая броня</A><BR>
<A HREF="?otdel=23&sid=&0.99133839275569">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;тяжелая броня</A><BR>
<A HREF="?otdel=24&sid=&0.567932791291376">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;шлемы</A><BR>
<A HREF="?otdel=3&sid=&0.725667864710179">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Щиты</A><BR>
<b>Ювелирные товары:</b> <BR>
<A HREF="?otdel=4&sid=&0.321709306035984">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;серьги</A><BR>
<A HREF="?otdel=41&sid=&0.902093651333512">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ожерелья</A><BR>
<A HREF="?otdel=42&sid=&0.510210803380268">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;кольца</A><BR>
<b>Магия</b> <BR>
<A HREF="?otdel=51&sid=&0.722009624500359">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;боевые</A><BR>
<A HREF="?otdel=5&sid=&0.648834385828923">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;разные</A><BR>
<b>Разное:</b> <BR>
<A HREF="?otdel=6&sid=&0.925798340638547">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Амуниция</A><BR>
<A HREF="?otdel=7&sid=&0.925798340638547">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Сувениры: открытки</A><BR>
<A HREF="?otdel=71&sid=&0.925798340638547">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;подарки</A><BR>
</div>
<div id="hint3" class="ahint"></div><BR>
<CENTER><B>Масса всех ваших вещей: <?= getItemsMassaInfo() ?><BR>
У вас в наличии: <FONT COLOR="#339900"><?=$user['money']?></FONT> кр.</B></CENTER>
</TD>
</FORM>
</TR>
</TABLE>
<br><div align=right></script><div>
</TD>
<TD valign=top width=280>
<div style="MARGIN-LEFT:15px; MARGIN-TOP: 10px;">
<FORM>
<INPUT TYPE="button" onclick="location.href='city.php?cp=1';" value="Вернуться" name="cp"><br>
<INPUT TYPE="submit" value="Сдать вещи в магазин" name="sale"><BR>
<INPUT TYPE="submit" value="Забрать вещи из магазина" name="unsale"><BR>
</FORM>
<B>Масса всех ваших вещей: <?= getItemsMassaInfo() ?>
<BR>У вас в наличии: <span style="color: darkgreen;"><?= $user['money'] ?></span> кр.</B>
<hr>
<div style="text-align: center; font-weight: bold;">Отделы магазина</div>
<dl>
<dt><b>Оружие:</b></dt>
<dd><a href="?otdel=1&rnd=<?= mt_rand() ?>">кинжалы</a></dd>
<dd><a href="?otdel=11&rnd=<?= mt_rand() ?>">топоры</a></dd>
<dd><a href="?otdel=12&rnd=<?= mt_rand() ?>">дубины</a></dd>
<dd><a href="?otdel=13&rnd=<?= mt_rand() ?>">мечи</a></dd>
<dt><b>Одежда:</b></dt>
<dd><a href="?otdel=24&rnd=<?= mt_rand() ?>">шлемы</a></dd>
<dd><a href="?otdel=23&rnd=<?= mt_rand() ?>">тяжелая броня</a></dd>
<dd><a href="?otdel=22&rnd=<?= mt_rand() ?>">легкая броня</a></dd>
<dd><a href="?otdel=3&rnd=<?= mt_rand() ?>">щиты</a></dd>
<dd><a href="?otdel=21&rnd=<?= mt_rand() ?>">перчатки</a></dd>
<dd><a href="?otdel=2&rnd=<?= mt_rand() ?>">сапоги</a></dd>
<dt><b>Ювелирные товары:</b></dt>
<dd><a href="?otdel=4&rnd=<?= mt_rand() ?>">серьги</a></dd>
<dd><a href="?otdel=41&rnd=<?= mt_rand() ?>">ожерелья</a></dd>
<dd><a href="?otdel=42&rnd=<?= mt_rand() ?>">кольца</a></dd>
<dt><b>Магия:</b></dt>
<dd><a href="?otdel=51&rnd=<?= mt_rand() ?>">боевые</a></dd>
<dd><a href="?otdel=5&rnd=<?= mt_rand() ?>">разные</a></dd>
<dt><b>Разное:</b></dt>
<dd><a href="?otdel=6&rnd=<?= mt_rand() ?>">амуниция</a></dd>
</dl>
</div>
<div id="hint3" class="ahint"></div>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@ -1,62 +0,0 @@
.city-location-container {
width: 950px;
margin: 0 auto;
}
.city-location-container .fireworks {
position: absolute;
left: 4px;
right: 0;
z-index: 1500;
top: 5px;
}
.city-location-container .fireworks #frvrks {
position:relative;
}
.city-location-container .location-map {
position:relative;
cursor: pointer;
width: 950px;
}
.city-location-container .location {
position: absolute;
z-index: 90;
}
.city-location-container .location img:not([title]),
.city-location-container .location img[title=""] {
/*border: dashed 1px yellow;*/
}
.city-location-container .location img:not([onclick]) {
border: dashed 1px red;
}
.city-location-container .location img:hover {
-webkit-filter: drop-shadow(0px 0px 2px rgba(255,255,255,1));
filter: url(#drop-shadow);
-ms-filter: "progid:DXImageTransform.Microsoft.Dropshadow(OffX=0, OffY=0, Color='#FFF')";
filter: drop-shadow(0px 0px 2px rgba(255,255,255,1));
}
.city-location-container .footnote {
border-top: solid 1px #aaa;
}
.city-location-container .footnote * {
font-size: 80%;
}
.error-msg {
background-color: #f2dede;
border: solid 1px red;
text-align: center;
color: red;
font-weight: bold;
padding: .5em;
margin-bottom: .5em;
border-radius: 3px;
}

View File

@ -69,9 +69,6 @@ switch ($shopCategoryTypeNumber) {
case 6:
$shopCategoryType = "Амуниция";
break;
case 52:
$shopCategoryType = "Руны";
break;
}
if (false == $saleItems) {
@ -299,7 +296,6 @@ if (!empty($_GET['buy'])) {
<dd><a href="?otdel=5&rnd=<?= mt_rand() ?>">разные</a></dd>
<dt><b>Разное:</b></dt>
<dd><a href="?otdel=6&rnd=<?= mt_rand() ?>">амуниция</a></dd>
<dd><a href="?otdel=52&rnd=<?= mt_rand() ?>">руны</a></dd>
</dl>
<div id="hint3" class="ahint"></div>
</TD>

View File

@ -10,6 +10,12 @@ session_start();
if (!isset($_SESSION['uid'])) header("Location: index.php");
require_once 'functions.php';
if (!empty($_GET['teeleport']) AND $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']);
header('location: city.php?cp');
die();
}
?>
<!doctype html>
<html>
@ -18,7 +24,12 @@ require_once 'functions.php';
<meta charset="utf-8">
</head>
<body>
<div style="float: right;"><input type="button" onClick="location.href='main.php';" value="Вернуться"></div>
<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>