code inspect
This commit is contained in:
parent
e93f8ebca1
commit
77e8b7de2a
13
akadem.php
13
akadem.php
@ -28,7 +28,10 @@ function setProfession($name, $type, $needMoney, $needLevel)
|
||||
if ($name == 'наёмник') $profId = 21;
|
||||
if ($name == 'лекарь') $profId = 22;
|
||||
if (!empty($profId)) {
|
||||
db::c()->query('UPDATE `users` SET ?f = ?i, `money` = `money` - ?i WHERE `id` = ?i', 'prof' . $type, $profId, $needMoney, $_SESSION['uid']);
|
||||
try {
|
||||
db::c()->query('UPDATE `users` SET ?f = ?i, `money` = `money` - ?i WHERE `id` = ?i', 'prof' . $type, $profId, $needMoney, $_SESSION['uid']);
|
||||
} catch (\Krugozor\Database\Mysql\Exception $e) {
|
||||
}
|
||||
$deloText = "{$user['login']} купил профессию «{$name}» в академии за {$needMoney} кр.";
|
||||
addToDelo($deloText);
|
||||
$user['prof'.$type] = true;
|
||||
@ -42,16 +45,20 @@ if ($get == 'mercenary') $status = setProfession('наёмник', 2, 700, 5);
|
||||
if ($get == 'medic') $status = setProfession('лекарь', 2, 700, 5);
|
||||
|
||||
if ($get == 'exit') {
|
||||
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $_SESSION['uid'], $_SESSION['uid']);
|
||||
try {
|
||||
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = 2702, `online`.`room` = 2702 WHERE `users`.`id` = ?i AND `online`.`id` = ?i', $_SESSION['uid'], $_SESSION['uid']);
|
||||
} catch (\Krugozor\Database\Mysql\Exception $e) {
|
||||
}
|
||||
header('Location: city.php');
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link href="css/main.css" rel="stylesheet">
|
||||
<link href="css/secondary.css" rel="stylesheet"/>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<div style="float: right;">
|
||||
|
@ -77,7 +77,7 @@ $shopCategory = '';
|
||||
$shopCategoryTypeNumber = empty($_GET['otdel']) ?: $_GET['otdel'];
|
||||
switch ($shopCategoryTypeNumber) {
|
||||
default:
|
||||
$shopCategory = "Кастеты и ножи";
|
||||
$shopCategory = "Прихожая";
|
||||
break;
|
||||
case 1:
|
||||
$shopCategory = "Кастеты и ножи";
|
||||
|
@ -19,4 +19,10 @@
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
<?php
|
||||
/*
|
||||
* Скамейка - level20 - room 223
|
||||
* Средняя скамейка - level21 - room 222
|
||||
* Малая скамейка - level22 - room224
|
||||
*/
|
22
bench_m.php
22
bench_m.php
@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link href="css/main.css" rel="stylesheet"/>
|
||||
<title>Скамейка</title>
|
||||
</head>
|
||||
<body>
|
||||
<a onclick="returned()"> ← на главную</a>
|
||||
<h1>Скамейка</h1>
|
||||
<p>
|
||||
Если вы устали от шума боев и суеты центральных улиц, вы можете отдохнуть на скамейке под тенью парковых деревьев...<br>
|
||||
Здесь можно, уединившись, подумать о вечном, назначить романтическое свидание или просто спокойно поболтать.<br>
|
||||
Если только местные хулиганы не помешают вам
|
||||
</p>
|
||||
<script>
|
||||
function returned() {
|
||||
location.href='city.php?bps=1&tmp='+Math.random();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
22
bench_s.php
22
bench_s.php
@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<link href="css/main.css" rel="stylesheet"/>
|
||||
<title>Скамейка</title>
|
||||
</head>
|
||||
<body>
|
||||
<a onclick="returned()"> ← на главную</a>
|
||||
<h1>Скамейка</h1>
|
||||
<p>
|
||||
Если вы устали от шума боев и суеты центральных улиц, вы можете отдохнуть на скамейке под тенью парковых деревьев...<br>
|
||||
Здесь можно, уединившись, подумать о вечном, назначить романтическое свидание или просто спокойно поболтать.<br>
|
||||
Если только местные хулиганы не помешают вам
|
||||
</p>
|
||||
<script>
|
||||
function returned() {
|
||||
location.href='city.php?bps=1&tmp='+Math.random();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
10
city.php
10
city.php
@ -249,10 +249,10 @@ switch ($location[0]) {
|
||||
move(223, 'bench.php');
|
||||
break;
|
||||
case 'level21':
|
||||
move(222, 'bench_s.php');
|
||||
move(222, 'bench.php');
|
||||
break;
|
||||
case 'level22':
|
||||
move(224, 'bench_m.php');
|
||||
move(224, 'bench.php');
|
||||
break;
|
||||
case 'level7':
|
||||
move(777, 'obshaga.php');
|
||||
@ -293,13 +293,13 @@ 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 sprintf('<div style="position:relative; display: inline-block;" id="ione"><img alt="background" src="i/city/%s.jpg">', $background);
|
||||
}
|
||||
|
||||
$online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time() - 60));
|
||||
?>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<html lang="ru">
|
||||
<HEAD>
|
||||
<link rel=stylesheet href="css/main.css">
|
||||
<meta charset="utf-8">
|
||||
@ -320,6 +320,7 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
|
||||
|
||||
document.onmousedown = Down;
|
||||
</script>
|
||||
<title></title>
|
||||
</HEAD>
|
||||
<body>
|
||||
<table width=100% border=0 cellspacing="0" cellpadding="0">
|
||||
@ -416,6 +417,5 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script language="javascript" src="js/refreshonline.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,3 +0,0 @@
|
||||
//top.localroom=top.changeroom;
|
||||
//top.frames['online'].location='ch.php?online='+Math.round(Math.random()*100000);
|
||||
//<script language="javascript" src="ajax/refreshonline.js"></script>
|
24
main.php
24
main.php
@ -63,9 +63,9 @@ function stack($it_id)
|
||||
{
|
||||
global $user;
|
||||
$it_id = (int)$it_id;
|
||||
$stack = mysql_query("SELECT * FROM `inventory` WHERE `id` = '" . $it_id . "' AND `owner` = " . $user['id'] . " LIMIT 1");
|
||||
if (mysql_num_rows($stack) == 1) {
|
||||
$stack = mysql_fetch_array($stack);
|
||||
$stack = db::c()->query('SELECT * FROM `inventory` WHERE `id` = ?i AND `owner` = ?i', $it_id, $user['id']);
|
||||
if (db::c()->getAffectedRows() === 1) {
|
||||
$stack = $stack->fetch_assoc();
|
||||
$similar = mysql_fetch_array(mysql_query("SELECT SUM(`koll`) FROM `inventory` WHERE `owner` = '" . $user['id'] . "' AND `id` != '" . $stack['id'] . "' AND `name` = '" . $stack['name'] . "' AND `present` = '" . $stack['present'] . "' AND `duration` = '" . $stack['duration'] . "' AND `maxdur` = '" . $stack['maxdur'] . "' AND `laba` = '" . $stack['laba'] . "' AND `gmeshok` = '" . $stack['gmeshok'] . "' AND `dressed` = 0 AND `goden` = 0 AND `setsale` = 0 AND `koll` >= 1 AND `isrep` = '" . $stack['isrep'] . "' AND FORMAT(`cost`/`koll`, 2) = FORMAT(" . ($stack['cost'] / $stack['koll']) . ", 2) AND FORMAT(`point`/`koll`, 2) = FORMAT(" . ($stack['point'] / $stack['koll']) . ", 2) AND FORMAT(`bcost`/`koll`, 2) = FORMAT(" . ($stack['bcost'] / $stack['koll']) . ", 2)"));
|
||||
if ($similar[0] >= 1) {
|
||||
mysql_query("UPDATE `inventory` SET `cost` = (`cost`+`cost`/`koll`*" . $similar[0] . "), `point` = (`point`+`point`/`koll`*" . $similar[0] . "), `bcost` = (`bcost`+`bcost`/`koll`*" . $similar[0] . "), `massa` = (`massa`+`massa`/`koll`*" . $similar[0] . "), `koll` = (`koll`+" . $similar[0] . "), `gmeshok` = (`gmeshok`+`gmeshok`*" . $similar[0] . ") WHERE `id` = '" . $stack['id'] . "' LIMIT 1");
|
||||
@ -822,7 +822,7 @@ if (input::get('setch')) {
|
||||
|
||||
var perm = getCurrentPermission();
|
||||
|
||||
if (perm == 'true') {
|
||||
if (perm === 'true') {
|
||||
new Notification('Thenks');
|
||||
} else {
|
||||
Notification.requestPermission('Сайт запрашивает доступ к уведомлениям.');
|
||||
@ -1586,11 +1586,11 @@ if (input::get('edit')) {
|
||||
function okno(title, script, name, coma, errk) {
|
||||
var errkom = '';
|
||||
var com = '';
|
||||
if (errk == 1) {
|
||||
if (errk === 1) {
|
||||
errkom = 'Нельзя использовать символы: /\:*?"<>|+%<br>';
|
||||
com = coma
|
||||
}
|
||||
if (errk == 2) {
|
||||
if (errk === 2) {
|
||||
errkom = 'Такой комплект уже существует<br>';
|
||||
com = coma
|
||||
}
|
||||
@ -1625,7 +1625,7 @@ if (input::get('edit')) {
|
||||
|
||||
$(document).ready(function () {
|
||||
$('a').live('click', function () {
|
||||
if ($(this).attr('ajax') != undefined) {
|
||||
if ($(this).attr('ajax') !== undefined) {
|
||||
var ajaxModule = $(this).attr('ajax');
|
||||
|
||||
switch (ajaxModule) {
|
||||
@ -2402,18 +2402,10 @@ if ($user['room'] == 650) {
|
||||
header('Location: ul_clans.php');
|
||||
die();
|
||||
}
|
||||
if ($user['room'] == 223) {
|
||||
if ($user['room'] == 222 OR $user['room'] == 223 OR $user['room'] == 224) {
|
||||
header('Location: bench.php');
|
||||
die();
|
||||
}
|
||||
if ($user['room'] == 222) {
|
||||
header('Location: bench_s.php');
|
||||
die();
|
||||
}
|
||||
if ($user['room'] == 224) {
|
||||
header('Location: bench_m.php');
|
||||
die();
|
||||
}
|
||||
//БС
|
||||
if ($user['in_tower'] == 1) {
|
||||
header('Location: towerin.php');
|
||||
|
Loading…
Reference in New Issue
Block a user