Fix errors

This commit is contained in:
lopar 2018-06-22 22:33:11 +03:00
parent 78a9733c7e
commit 30ae0642db

View File

@ -17,21 +17,18 @@ if ($user['battle'] != 0) {
$bank = db::c()->query('SELECT `ekr` FROM `bank` WHERE `id`=?i', $_SESSION['uid'])->fetch_assoc();
if (($_GET['set'] OR $_POST['set'])) {
if ($_GET['set']) {
$set = $_GET['set'];
}
if ($_POST['set']) {
$set = $_POST['set'];
}
if (!$_POST['count']) {
$_POST['count'] = 1;
}
if (!is_numeric($_POST['count']) || $_POST['count'] != ((int)$_POST['count'])) {
$_POST['count'] = 0;
$count_ok = 0;
} elseif ($_POST['count'] < 1) {
$_POST['count'] = 0;
//$set = isset($_POST['set']) ? $_POST['set'] : '';
//$var = $value ?: "Другое значение";
if (isset($_GET['set']) OR isset($_POST['set'])){
$set = empty($_GET['set']) ?: $_GET['set'];
$set = empty($_POST['set']) ?: $_POST['set'];
$count = isset($_POST['count']) && is_numeric($_POST['count']) ? $_POST['count'] : 0;
if ($count < 1) {
$count = 0;
$count_ok = 0;
} else $count_ok = 1;
@ -131,12 +128,10 @@ if (($_GET['set'] OR $_POST['set'])) {
<input type="hidden" name="id" value="1">
<td valign=top align=left>
<!--Магазин-->
<table border=0 width=100% cellspacing="0" cellpadding="0" <? if (!$_REQUEST['present']) {
echo 'bgcolor="#A5A5A5"';
} ?>>
<table border=0 width=100% cellspacing="0" cellpadding="0" <?php if (!$_REQUEST['present']) { echo 'bgcolor="#A5A5A5"';} ?>>
<tr>
<td align=center><b>
<?
<?php
if ($_REQUEST['compare'] && !$_REQUEST['common'] && !$_REQUEST['present']) {
echo "Составление подарочного букета";
} elseif ($_REQUEST['present']) {
@ -209,7 +204,7 @@ if (($_GET['set'] OR $_POST['set'])) {
<tr>
<td><!--Рюкзак-->
<table border=0 width=100% cellspacing="1" cellpadding="2" bgcolor="#A5A5A5">
<?
<?php
if ($_REQUEST['present']) {
if ($_POST['to_login'] && $_POST['flower']) {
$to = db::c()->query('SELECT `id`,`login`,`room` FROM `users` WHERE `login` = ?i', $_POST['to_login'])->fetch_assoc();
@ -226,7 +221,7 @@ if (($_GET['set'] OR $_POST['set'])) {
$from = $user['login'];
}
db::c()->query('UPDATE `inventory` SET `owner` = ?i, `present` = "?s", `letter` = "?s" WHERE `present` = "?s" AND `id` = ?i AND `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $to['id'], $from, $_POST['podarok2'], null, $_POST['flower'], $_SESSION['uid']);
db::c()->query('UPDATE `inventory` SET `owner` = ?i, `present` = "?s", `letter` = "?s" WHERE `present` = "?s" AND `id` = "?s" AND `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $to['id'], $from, $_POST['podarok2'], null, $_POST['flower'], $_SESSION['uid']);
$res = db::c()->query('SELECT `id`,`name`,`duration`,`maxdur` FROM `inventory` WHERE `id` = ?i', $_POST['flower'])->fetch_assoc();
$deloTextSender = "Подарен предмет \"" . $res['name'] . "\" id:(cap" . $res['id'] . ") [" . $res['duration'] . "/" . $res['maxdur'] . "] от \"" . $user['login'] . "\" к \"" . $to['login'] . "\"";
$deloTextReceiver = "Подарен предмет \"" . $res['name'] . "\" id:(cap" . $res['id'] . ") [" . $res['duration'] . "/" . $res['maxdur'] . "] от \"" . $user['login'] . "\" к \"" . $to['login'] . "\"";