Вынос стилей в отдельный файл

This commit is contained in:
Igor Barkov [iwork] 2018-12-12 13:59:29 +02:00
parent d5bc6c59fc
commit f5f7beaf5d
4 changed files with 360 additions and 365 deletions

View File

@ -2,8 +2,7 @@
ob_start("ob_gzhandler"); ob_start("ob_gzhandler");
session_start(); session_start();
if ($_SESSION['uid'] == null) header("Location: index.php"); if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php"; require_once "functions.php";
include "functions.php";
if ($user['room'] != 29) header("Location: main.php"); if ($user['room'] != 29) header("Location: main.php");
if ($user['battle'] != 0) { if ($user['battle'] != 0) {
header('location: fbattle.php'); header('location: fbattle.php');
@ -22,45 +21,13 @@ if (!$bank['id']) db::c()->query('INSERT INTO `bank` (`id`) VALUES (?i)', $_SESS
<head> <head>
<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/secondary.css" rel="stylesheet"/>
<title>Банк</title> <title>Банк</title>
<script> <script>
function leave() { function leave() {
top.frames['main'].location = 'city.php?strah' top.frames['main'].location = 'city.php?strah'
} }
</script> </script>
<style>
.appblock {
background: silver;
border-radius: 2px;
float: left;
height: 200px;
margin: 10px;
width: 250px;
opacity: 0.75;
padding: 5px;
}
div.appblock form {
margin: 5px;
}
div.appblock span.legend {
padding: 0.2em 0.5em;
color: #666;
font-weight: bold;
display: block;
}
div.appblock br {
margin: 5px;
}
div.appblock span.wrap {
padding: 5px;
display: block;
font-family: Consolas, monospace;
}
div.appblock span.wrap span.num {
float:right;
display:block;
}
</style>
</head> </head>
<body> <body>
<h1>Банк</h1> <h1>Банк</h1>
@ -172,7 +139,7 @@ if (!$_SESSION['bankid']) {
err($mywarn); err($mywarn);
?> ?>
<p><a href="?exit"> выйти из счёта</a></p> <p><a href="?exit"> выйти из счёта</a></p>
<div class="appblock" style="background: whitesmoke;"> <div class="appblock appblock-main">
<span class="legend">ет <?=$bank['id']?></span> <span class="legend">ет <?=$bank['id']?></span>
<span class="wrap">Кредитов<span class="num"><?=$bank['cr']?></span></span> <span class="wrap">Кредитов<span class="num"><?=$bank['cr']?></span></span>
<span class="wrap">ЕвроКредитов<span class="num"><?=$bank['ekr']?></span></span><hr> <span class="wrap">ЕвроКредитов<span class="num"><?=$bank['ekr']?></span></span><hr>

View File

@ -543,7 +543,7 @@ div.effectList > div > [action] {
font-weight: bold; font-weight: bold;
font-size: 12pt; font-size: 12pt;
color: #8F0000; color: #8F0000;
font-family: Arial; font-family: Arial, serif;
text-align: center; text-align: center;
} }
@ -1027,9 +1027,9 @@ table.zebra tr:nth-child(even) {
background-color: #D5D5D5; background-color: #D5D5D5;
} }
legend { legend, .legend {
color: dimgray; color: dimgray;
font-family: consolas, sans-serif; font-family: consolas, sans-serif;
font-size: 18px; font-size: 18px;
margin-top: 10px; margin-top: 10px;
} }

35
css/secondary.css Normal file
View File

@ -0,0 +1,35 @@
/* Стили, созданные для этого проекта, которые должны стать основными. */
div.appblock {
background: silver;
border-radius: 2px;
float: left;
height: 200px;
margin: 10px;
width: 250px;
opacity: 0.75;
padding: 5px;
}
div.appblock-main {
background: whitesmoke;
}
div.appblock form {
margin: 5px;
}
div.appblock span.legend {
padding: 0.2em 0.5em;
color: #666;
font-weight: bold;
display: block;
}
div.appblock br {
margin: 5px;
}
div.appblock span.wrap {
padding: 5px;
display: block;
font-family: Consolas, monospace;
}
div.appblock span.wrap span.num {
float:right;
display:block;
}

View File

@ -1,8 +1,6 @@
<?php <?php
session_start(); session_start();
if (!isset($_SESSION['uid'])) { if ($_SESSION['uid'] == null) header("Location: index.php");
header("Location: index.php");
}
require_once("functions.php"); require_once("functions.php");
$d = db::c()->query('SELECT SUM(`massa`) FROM `inventory` WHERE `dressed` = 0 AND `owner` = ?i', $_SESSION['uid'])->fetch_assoc(); $d = db::c()->query('SELECT SUM(`massa`) FROM `inventory` WHERE `dressed` = 0 AND `owner` = ?i', $_SESSION['uid'])->fetch_assoc();
if ($user['room'] != 23) { if ($user['room'] != 23) {
@ -99,8 +97,9 @@ if ($_GET['sid'] && $_GET['rep']) {
?> ?>
<HTML> <HTML>
<HEAD> <HEAD>
<link rel=stylesheet href="css/main.css">
<meta charset="utf-8"> <meta charset="utf-8">
<link rel=stylesheet href="css/main.css">
<link href="css/secondary.css" rel="stylesheet"/>
</HEAD> </HEAD>
<body> <body>
<h1>Ремонтная мастерская</h1> <h1>Ремонтная мастерская</h1>
@ -152,19 +151,12 @@ if ($_GET['sid'] && $_GET['rep']) {
<TABLE WIDTH=100% BGCOLOR="#A5A5A5"> <TABLE WIDTH=100% BGCOLOR="#A5A5A5">
<?php <?php
if ($_GET['razdel'] == 0) { if ($_GET['razdel'] == 0) {
$data = db::c()->query('SELECT * FROM `inventory` WHERE `type` < 12 AND `dressed` = 0 AND `isrep` = 1 AND `setsale` = 0 AND `owner` = ?i ORDER BY `update` DESC',$_SESSION['uid']); $data = db::c()->query('SELECT * FROM `inventory` WHERE `type` < 12 AND `dressed` = 0 AND `isrep` = 1 AND `setsale` = 0 AND `owner` = ?i ORDER BY `update` DESC', $_SESSION['uid']);
while ($row = $data->fetch_assoc()) { while ($row = $data->fetch_assoc()) {
$row['count'] = 1; $onecost = 0.1;
if ($i == 0) { ?>
$i = 1; <TR>
$color = '#C7C7C7'; <TD align=center><IMG SRC="i/sh/<?= $row['img'] ?>">
} else {
$i = 0;
$color = '#D5D5D5';
}
echo "<TR bgcolor={$color}><TD align=center ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
$onecost = 0.1;
?>
<BR> <BR>
<small> <small>
<? if ($row['duration'] > 0) { ?><A HREF="?rep=<?= $row['id'] ?>&sid=1">Ремонт 1 ед. <? if ($row['duration'] > 0) { ?><A HREF="?rep=<?= $row['id'] ?>&sid=1">Ремонт 1 ед.
@ -178,170 +170,171 @@ if ($_GET['sid'] && $_GET['rep']) {
ремонт за <?= round(($row['duration'] * $onecost), 2) ?> кр.</A><? ремонт за <?= round(($row['duration'] * $onecost), 2) ?> кр.</A><?
} ?> } ?>
</small> </small>
</TD> </TD>
<?php <?php
echo "<TD valign=top>"; echo "<TD valign=top>";
showitem($row); showitem($row);
echo "</TD></TR>"; echo "</TD></TR>";
} }
}
if ($_GET['razdel'] == 1) {
$data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 3 AND `name` NOT LIKE "?S" AND `setsale`=0 ORDER by `update` DESC',$_SESSION['uid'],'%Букет%');
while ($row = $data->fetch_assoc()) {
$row['count'] = 1;
if ($i == 0) {
$i = 1;
$color = '#C7C7C7';
} else {
$i = 0;
$color = '#D5D5D5';
}
echo "<TR bgcolor={$color}><TD align=center ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?>
<BR>
<small>
<? if (empty($row['text'])) { ?><A HREF="#" onclick="AddCount(<?= $row['id'] ?>)">
Нанести надпись за 30 кр.</A><BR><? } else {
?><A HREF="?razdel=1&rep=<?= $row['id'] ?>&sid=2">Стереть надпись</A><BR><?
} ?>
</small>
</TD>
<?php
echo "<TD valign=top>";
showitem($row);
echo "</TD></TR>";
} }
}
if ($_GET['razdel'] == 2) { if ($_GET['razdel'] == 1) {
if ($_GET['it']) { $data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 3 AND `name` NOT LIKE "?S" AND `setsale`=0 ORDER by `update` DESC', $_SESSION['uid'], '%Букет%');
$row = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `includemagicmax` > 0 AND `id` = '{$_GET['it']}' LIMIT 1;")); while ($row = $data->fetch_assoc()) {
if ($user['money'] < $row['includemagiccost'] && $row['includemagicdex'] == 0) { $row['count'] = 1;
$err = "<font color=red><b>У вас не хватает денег на перезарядку.</b></font>"; if ($i == 0) {
} else { $i = 1;
if ($row['includemagicuses'] <= 1) { $color = '#C7C7C7';
$onecost = $row['includemagiccost'];
$err = "<font color=red><b>Мы сожалеем, свиток исчерпал все свои ресурсы, и мы уже не можем его перезарядить.</b></font>";
mysql_query("UPDATE `users` set `money` = `money`- '" . ($row['includemagiccost']) . "' WHERE id = {$user['id']}");
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','Перезаряжена магия \"" . $row['name'] . "\" id:(cap" . $row['id'] . ") [" . $newduration . "/" . $row['maxdur'] . "] у \"" . $user['login'] . "\" за " . round($onecost, 2) . " кр. ',1,'" . time() . "');");
mysql_query("UPDATE `inventory` SET `includemagic` = '', `includemagicdex` = '', `includemagicmax` = '', `includemagicname` = '', `includemagicuses` = '', `includemagiccost` = '' WHERE `id` = '{$_GET['it']}' LIMIT 1;");
} else { } else {
$onecost = $row['includemagiccost']; $i = 0;
$err = "<font color=red><b>Магия успешно перезаряжена.</b></font>"; $color = '#D5D5D5';
mysql_query("UPDATE `users` set `money` = `money`- '" . ($row['includemagiccost']) . "' WHERE id = {$user['id']}");
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','Перезаряжена магия \"" . $row['name'] . "\" id:(cap" . $row['id'] . ") [" . $newduration . "/" . $row['maxdur'] . "] у \"" . $user['login'] . "\" за " . round($onecost, 2) . " кр. ',1,'" . time() . "');");
mysql_query("UPDATE `inventory` SET `includemagicdex` = `includemagicmax`, `includemagicuses` = `includemagicuses`-1 WHERE `id` = '{$_GET['it']}' LIMIT 1;");
}
}
}
$data = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `includemagicmax` > 0 AND `setsale`=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 ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?>
<BR>
<small>
<?
if ($row['includemagicdex'] == 0) {
?><A HREF="?razdel=2&it=<?= $row['id'] ?>">Перезарядить
за <?= $row['includemagiccost'] ?> кр.</A><BR><?
} else {
echo 'Не нуждается в перезарядке';
} }
echo "<TR bgcolor={$color}><TD align=center ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?> ?>
</small> <BR>
</TD> <small>
<?php <? if (empty($row['text'])) { ?><A HREF="#"
echo "<TD valign=top>"; onclick="AddCount(<?= $row['id'] ?>)">
showitem($row); Нанести надпись за 30 кр.</A><BR><? } else {
echo "</TD></TR>"; ?><A HREF="?razdel=1&rep=<?= $row['id'] ?>&sid=2">Стереть надпись</A><BR><?
} ?>
</small>
</TD>
<?php
echo "<TD valign=top>";
showitem($row);
echo "</TD></TR>";
}
} }
}
if ($_GET['razdel'] == 3) { if ($_GET['razdel'] == 2) {
if ($_GET['it']) {
if ($_GET['mf']) { $row = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `includemagicmax` > 0 AND `id` = '{$_GET['it']}' LIMIT 1;"));
$row = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `type` < 12 AND `type` != 3 AND `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `id` = '{$_GET['mf']}' AND `name` NOT LIKE '% (мф)%' LIMIT 1;")); if ($user['money'] < $row['includemagiccost'] && $row['includemagicdex'] == 0) {
if ($user['money'] < $row['cost'] OR !$row) { $err = "<font color=red><b>У вас не хватает денег на перезарядку.</b></font>";
$err = "<font color=red><b>У вас не хватает денег на модификацию.</b></font>"; } else {
} else { if ($row['includemagicuses'] <= 1) {
srand(make_seed()); $onecost = $row['includemagiccost'];
$type = rand(1, 4); $err = "<font color=red><b>Мы сожалеем, свиток исчерпал все свои ресурсы, и мы уже не можем его перезарядить.</b></font>";
$mfintel = round($user['intel'] / 5 - 10); mysql_query("UPDATE `users` set `money` = `money`- '" . ($row['includemagiccost']) . "' WHERE id = {$user['id']}");
if ($mfintel > -1) { mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','Перезаряжена магия \"" . $row['name'] . "\" id:(cap" . $row['id'] . ") [" . $newduration . "/" . $row['maxdur'] . "] у \"" . $user['login'] . "\" за " . round($onecost, 2) . " кр. ',1,'" . time() . "');");
$mfintel = -1; mysql_query("UPDATE `inventory` SET `includemagic` = '', `includemagicdex` = '', `includemagicmax` = '', `includemagicname` = '', `includemagicuses` = '', `includemagiccost` = '' WHERE `id` = '{$_GET['it']}' LIMIT 1;");
} else {
$onecost = $row['includemagiccost'];
$err = "<font color=red><b>Магия успешно перезаряжена.</b></font>";
mysql_query("UPDATE `users` set `money` = `money`- '" . ($row['includemagiccost']) . "' WHERE id = {$user['id']}");
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$user['id']}','Перезаряжена магия \"" . $row['name'] . "\" id:(cap" . $row['id'] . ") [" . $newduration . "/" . $row['maxdur'] . "] у \"" . $user['login'] . "\" за " . round($onecost, 2) . " кр. ',1,'" . time() . "');");
mysql_query("UPDATE `inventory` SET `includemagicdex` = `includemagicmax`, `includemagicuses` = `includemagicuses`-1 WHERE `id` = '{$_GET['it']}' LIMIT 1;");
}
} }
$statintel = round($user['intel'] / 25 - 2); }
if ($statintel > -1) {
$statintel = -1; $data = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `includemagicmax` > 0 AND `setsale`=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';
} }
$nstatintel = round(2 - $user['intel'] / 25); echo "<TR bgcolor={$color}><TD align=center ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
if ($nstatintel < 1) { ?>
$statintel = 1; <BR>
} <small>
srand(make_seed()); <?
$mf1 = rand($mfintel, 10); if ($row['includemagicdex'] == 0) {
srand(make_seed()); ?><A HREF="?razdel=2&it=<?= $row['id'] ?>">Перезарядить
$mf2 = rand($mfintel, 10); за <?= $row['includemagiccost'] ?> кр.</A><BR><?
srand(make_seed()); } else {
$st1 = rand($statintel, 2); echo 'Не нуждается в перезарядке';
srand(make_seed()); }
$st2 = rand(-2, $nstatintel); ?>
srand(make_seed()); </small>
$min = rand($statintel, 2); </TD>
srand(make_seed()); <?php
$max = rand($statintel, 4); echo "<TD valign=top>";
showitem($row);
echo "</TD></TR>";
}
}
if ($_GET['razdel'] == 3) {
if ($_GET['mf']) {
$row = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `type` < 12 AND `type` != 3 AND `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `id` = '{$_GET['mf']}' AND `name` NOT LIKE '% (мф)%' LIMIT 1;"));
if ($user['money'] < $row['cost'] OR !$row) {
$err = "<font color=red><b>У вас не хватает денег на модификацию.</b></font>";
} else {
srand(make_seed());
$type = rand(1, 4);
$mfintel = round($user['intel'] / 5 - 10);
if ($mfintel > -1) {
$mfintel = -1;
}
$statintel = round($user['intel'] / 25 - 2);
if ($statintel > -1) {
$statintel = -1;
}
$nstatintel = round(2 - $user['intel'] / 25);
if ($nstatintel < 1) {
$statintel = 1;
}
srand(make_seed());
$mf1 = rand($mfintel, 10);
srand(make_seed());
$mf2 = rand($mfintel, 10);
srand(make_seed());
$st1 = rand($statintel, 2);
srand(make_seed());
$st2 = rand(-2, $nstatintel);
srand(make_seed());
$min = rand($statintel, 2);
srand(make_seed());
$max = rand($statintel, 4);
switch ($type) { switch ($type) {
case 1: case 1:
// крит // крит
$mfkrit = $mf1; $mfkrit = $mf1;
$mfantiuvorot = $mf2; $mfantiuvorot = $mf2;
$inta = $st1; $inta = $st1;
$hp = rand(0, 15); $hp = rand(0, 15);
$ninta = $st2; $ninta = $st2;
break; break;
case 2: case 2:
// ловкость // ловкость
$mfuvorot = $mf1; $mfuvorot = $mf1;
$mfantikrit = $mf2; $mfantikrit = $mf2;
$lovk = $st1; $lovk = $st1;
$hp = rand(1, 15); $hp = rand(1, 15);
$nlovk = $st2; $nlovk = $st2;
break; break;
case 3: case 3:
// сила // сила
$mfminu = $min; $mfminu = $min;
$mfmaxu = $max; $mfmaxu = $max;
$sila = $st1; $sila = $st1;
$hp = rand(6, 20); $hp = rand(6, 20);
$nsila = $st2; $nsila = $st2;
$mfantikrit = $mf2; $mfantikrit = $mf2;
break; break;
case 4: case 4:
// вынос // вынос
$nvinos = $st2; $nvinos = $st2;
$mfantikrit = $mf1; $mfantikrit = $mf1;
$bron1 = rand(0, 3); $bron1 = rand(0, 3);
$bron2 = rand(0, 3); $bron2 = rand(0, 3);
$bron3 = rand(0, 3); $bron3 = rand(0, 3);
$bron4 = rand(0, 3); $bron4 = rand(0, 3);
$hp = rand(0, 15); $hp = rand(0, 15);
break; break;
} }
if (mysql_query("UPDATE `inventory` SET if (mysql_query("UPDATE `inventory` SET
`ghp` = `ghp`+'" . (int)$hp . "', `ghp` = `ghp`+'" . (int)$hp . "',
`bron1` = `bron1`+'" . (int)$bron1 . "', `bron1` = `bron1`+'" . (int)$bron1 . "',
`bron2` = `bron2`+'" . (int)$bron2 . "', `bron2` = `bron2`+'" . (int)$bron2 . "',
@ -361,186 +354,186 @@ if ($_GET['sid'] && $_GET['rep']) {
`cost` = `cost` + '" . round($row['cost'] / 2) . "', `cost` = `cost` + '" . round($row['cost'] / 2) . "',
`name` = CONCAT(`name`, ' (мф)') `name` = CONCAT(`name`, ' (мф)')
WHERE `id` = '{$_GET['mf']}' LIMIT 1;")) { WHERE `id` = '{$_GET['mf']}' LIMIT 1;")) {
//echo $row['cost']; //echo $row['cost'];
mysql_query("UPDATE `users` set `money` = `money`- '" . ($row['cost']) . "' WHERE id = {$_SESSION['uid']}"); mysql_query("UPDATE `users` set `money` = `money`- '" . ($row['cost']) . "' WHERE id = {$_SESSION['uid']}");
mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','Моцифицирована вещь \"" . $row['name'] . "\" id:(cap" . $row['id'] . ") [" . $newduration . "/" . $row['maxdur'] . "] у \"" . $user['login'] . "\" за " . round($onecost, 2) . " кр. ',1,'" . time() . "');"); mysql_query("INSERT INTO `delo` (`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','{$_SESSION['uid']}','Моцифицирована вещь \"" . $row['name'] . "\" id:(cap" . $row['id'] . ") [" . $newduration . "/" . $row['maxdur'] . "] у \"" . $user['login'] . "\" за " . round($onecost, 2) . " кр. ',1,'" . time() . "');");
$err = "<font color=red><b>Вещь модифицирована.</b></font>"; $err = "<font color=red><b>Вещь модифицирована.</b></font>";
}
} }
} }
$data = mysql_query("SELECT * FROM `inventory` WHERE `type` < 12 AND `type` != 3 AND `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `name` NOT LIKE '% (мф)%' AND `name` NOT LIKE '%Букет%' AND `setsale`=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 ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?>
<BR>
<small>
<A HREF="?razdel=3&mf=<?= $row['id'] ?>"
onClick="if(!confirm('Вы действительно хотите модифицировать эту вещь?')){ return false;}">Модифицировать
за <?= $row['cost'] ?> кр.</A><BR>
</small>
</TD>
<?php
echo "<TD valign=top>";
showitem($row);
echo "</TD></TR>";
}
} }
$data = mysql_query("SELECT * FROM `inventory` WHERE `type` < 12 AND `type` != 3 AND `owner` = '{$_SESSION['uid']}' AND `dressed` = 0 AND `name` NOT LIKE '% (мф)%' AND `name` NOT LIKE '%Букет%' AND `setsale`=0 ORDER by `update` DESC; "); if ($_GET['razdel'] == 4) {
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 ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?>
<BR>
<small>
<A HREF="?razdel=3&mf=<?= $row['id'] ?>"
onClick="if(!confirm('Вы действительно хотите модифицировать эту вещь?')){ return false;}">Модифицировать
за <?= $row['cost'] ?> кр.</A><BR>
</small>
</TD>
<?php
echo "<TD valign=top>";
showitem($row);
echo "</TD></TR>";
}
}
if ($_GET['razdel'] == 4) { if ($_GET['podgon']) {
$row = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `type` < 12 AND `type` != 3 AND `owner` = '{$user['id']}' AND `dressed` = 0 AND `id` = '{$_GET['podgon']}' AND `modif`='1' AND `podgon`<'5' LIMIT 1;"));
if ($_GET['podgon']) { if ($row['point'] > 0) {
$row = mysql_fetch_array(mysql_query("SELECT * FROM `inventory` WHERE `type` < 12 AND `type` != 3 AND `owner` = '{$user['id']}' AND `dressed` = 0 AND `id` = '{$_GET['podgon']}' AND `modif`='1' AND `podgon`<'5' LIMIT 1;")); $cost = round(($row['point'] / 2), 0);
if ($row['point'] > 0) { } else {
$cost = round(($row['point'] / 2), 0); $cost = round(($row['cost'] / 2), 0);
} else {
$cost = round(($row['cost'] / 2), 0);
}
if ($user['money'] < $cost || !$row) {
$err = "<font color=red><b>У вас не хватает денег на подгонку.</b></font>";
} else {
$kol_mf = round($row['mfkrit'] + $row['mfakrit'] + $row['mfuvorot'] + $row['mfauvorot'], 0);
if ($row['podgon'] == 0) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 20) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 20) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 2;
} elseif ($row['podgon'] == 1) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 20) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 20) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 3;
} elseif ($row['podgon'] == 2) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 40) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 40) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 4;
} elseif ($row['podgon'] == 3) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 70) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 70) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 6;
} elseif ($row['podgon'] == 4) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 100) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 100) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 10;
} }
if ($row['mfkrit'] == 0 && $row['mfakrit'] == 0 && $row['mfuvorot'] == 0 && $row['mfauvorot'] == 0) { if ($user['money'] < $cost || !$row) {
$gmf = 0; $err = "<font color=red><b>У вас не хватает денег на подгонку.</b></font>";
} } else {
if (mysql_query("UPDATE `inventory` SET $kol_mf = round($row['mfkrit'] + $row['mfakrit'] + $row['mfuvorot'] + $row['mfauvorot'], 0);
if ($row['podgon'] == 0) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 20) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 20) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 2;
} elseif ($row['podgon'] == 1) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 20) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 20) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 3;
} elseif ($row['podgon'] == 2) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 40) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 40) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 4;
} elseif ($row['podgon'] == 3) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 70) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 70) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 6;
} elseif ($row['podgon'] == 4) {
if ($row['point'] > 0) {
$new_cena = round(($row['point'] * 100) / 100, 0);
$sql = '`point` = `point`+' . $new_cena;
$user['doblest'] -= $cost;
$usql = '`doblest` = "' . $user['doblest'] . '"';
$cost_t = 'реп';
} else {
$new_cena = round(($row['cost'] * 100) / 100, 0);
$sql = '`cost` = `cost`+' . $new_cena;
$user['money'] -= $cost;
$usql = '`money` = "' . $user['money'] . '"';
$cost_t = 'кр';
}
$gmf = 10;
}
if ($row['mfkrit'] == 0 && $row['mfakrit'] == 0 && $row['mfuvorot'] == 0 && $row['mfauvorot'] == 0) {
$gmf = 0;
}
if (mysql_query("UPDATE `inventory` SET
`free_mf` = `free_mf`+'" . (int)$gmf . "', `free_mf` = `free_mf`+'" . (int)$gmf . "',
$sql, $sql,
`podgon`=`podgon`+'1' `podgon`=`podgon`+'1'
WHERE `id` = '{$_GET['podgon']}' LIMIT 1")) { WHERE `id` = '{$_GET['podgon']}' LIMIT 1")) {
mysql_query("UPDATE `users` set $usql WHERE id = {$user['id']}"); mysql_query("UPDATE `users` set $usql WHERE id = {$user['id']}");
mysql_query("INSERT INTO `delo` (`author` ,`pers`, `text`, `type`, `date`) VALUES ('0','{$user['id']}','Подогнана вещь \"" . $row['name'] . "\" id:(cap" . $row['id'] . ") [" . $newduration . "/" . $row['maxdur'] . "] у \"" . $user['login'] . "\" за " . round($cost, 2) . " " . $cost_t . ". ',1,'" . time() . "');"); mysql_query("INSERT INTO `delo` (`author` ,`pers`, `text`, `type`, `date`) VALUES ('0','{$user['id']}','Подогнана вещь \"" . $row['name'] . "\" id:(cap" . $row['id'] . ") [" . $newduration . "/" . $row['maxdur'] . "] у \"" . $user['login'] . "\" за " . round($cost, 2) . " " . $cost_t . ". ',1,'" . time() . "');");
$err = "<font color=red><b>Вещь подогнана.</b></font>"; $err = "<font color=red><b>Вещь подогнана.</b></font>";
}
} }
} }
}
$data = mysql_query("SELECT * FROM `inventory` WHERE `type` < 12 AND `type` != 3 AND `owner` = '{$user['id']}' AND `dressed` = 0 AND `modif`='1' AND `podgon`<'5' AND `name` NOT LIKE '%Букет%' AND `setsale`=0 ORDER by `update` DESC; "); $data = mysql_query("SELECT * FROM `inventory` WHERE `type` < 12 AND `type` != 3 AND `owner` = '{$user['id']}' AND `dressed` = 0 AND `modif`='1' AND `podgon`<'5' AND `name` NOT LIKE '%Букет%' AND `setsale`=0 ORDER by `update` DESC; ");
while ($row = mysql_fetch_array($data)) { while ($row = mysql_fetch_array($data)) {
$row['count'] = 1; $row['count'] = 1;
if ($i == 0) { if ($i == 0) {
$i = 1; $i = 1;
$color = '#C7C7C7'; $color = '#C7C7C7';
} else {
$i = 0;
$color = '#D5D5D5';
}
echo "<TR bgcolor={$color}><TD align=center ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?>
<BR>
<small>
<?
if ($row['point'] > 0) {
$babki = round(($row['point'] / 2), 0);
$cost_t = 'Реп';
} else { } else {
$babki = round(($row['cost'] / 2), 0); $i = 0;
$cost_t = 'Кр'; $color = '#D5D5D5';
} }
echo "<TR bgcolor={$color}><TD align=center ><IMG SRC=\"i/sh/{$row['img']}\" BORDER=0>";
?> ?>
<A HREF="?razdel=4&podgon=<?= $row['id'] ?>" <BR>
onclick="if(!confirm('Вы действительно хотите подогнать эту вещь?')){ return false;}">Подогнать <small>
за <?= $babki ?> <?= $cost_t ?>.</A><BR> <?
</small> if ($row['point'] > 0) {
</TD> $babki = round(($row['point'] / 2), 0);
<?php $cost_t = 'Реп';
echo "<TD valign=top>"; } else {
showitem($row); $babki = round(($row['cost'] / 2), 0);
echo "</TD></TR>"; $cost_t = 'Кр';
}
?>
<A HREF="?razdel=4&podgon=<?= $row['id'] ?>"
onclick="if(!confirm('Вы действительно хотите подогнать эту вещь?')){ return false;}">Подогнать
за <?= $babki ?> <?= $cost_t ?>.</A><BR>
</small>
</TD>
<?php
echo "<TD valign=top>";
showitem($row);
echo "</TD></TR>";
}
} }
}
?> ?>
</TABLE> </TABLE>
</TD> </TD>