diff --git a/functions.php b/functions.php index 64051c6..7b297aa 100644 --- a/functions.php +++ b/functions.php @@ -2728,10 +2728,22 @@ function telegraph($to, $text) function get_meshok() { global $user; - $d = db::c()->query('SELECT SUM(`gmeshok`) AS `ves` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0 AND `gmeshok` > 0', $user['id'])->fetch_assoc(); + $d = db::c()->query('SELECT SUM(`gmeshok`) AS `ves` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0 AND `gmeshok` > 0', $_SESSION['uid'])->fetch_assoc(); return ($user['sila'] * 4 + $d['ves']); } +/** + * Надеюсь временная заглушка, которая объединяет get_meshok() и другую выдачу одной строкой. + * @return string + * @throws \Krugozor\Database\Mysql\Exception + */ +function getItemsMassaInfo() +{ + $i_row = db::c()->query('SELECT SUM(`massa`) AS `massa`, SUM(`gmeshok`) AS `massa_bonus` FROM `inventory` WHERE `setsale` = 0 AND `owner` = ?i',$_SESSION['uid'])->fetch_assoc(); + $u_row = db::c()->query('SELECT `sila` FROM `users` WHERE `id` = ?i', $_SESSION['uid'])->fetch_assoc(); + return $i_row['massa'] . "/" . ($u_row['sila'] * 4 + $i_row['massa_bonus']); +} + function addlog($id, $log) { $fp = fopen("backup/logs/battle" . $id . ".txt", "a"); diff --git a/main.php b/main.php index a6802e4..4caf260 100644 --- a/main.php +++ b/main.php @@ -2234,7 +2234,7 @@ if (input::get('edit')) { Рюкзак (масса : query('SELECT SUM(`massa`) AS `weight`, COUNT(`id`) AS `cnt` FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'])->fetch_assoc(); + $d = db::c()->query('SELECT SUM(`massa`) AS `weight`, COUNT(`id`) AS `cnt` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $user['id'])->fetch_assoc(); echo $d['weight']; ?>/) diff --git a/repair.php b/repair.php index 3ef67e4..93ef209 100644 --- a/repair.php +++ b/repair.php @@ -104,7 +104,11 @@ if ($_GET['sid'] && $_GET['rep']) {

Ремонтная мастерская

← выйти из мастерской - +
+ Информация + Кредиты + Масса вещей +
@@ -540,7 +544,6 @@ if ($_GET['sid'] && $_GET['rep']) {

Масса всех ваших вещей: / -
У вас в наличии: кр.