Часть логов теперь пишется в SQLITE, а не в текстовые файлы (#33). Проинициализирован класс Nick в свитках.
This commit is contained in:
+23
-4
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
|
||||
use Battles\Database\DBPDO;
|
||||
use Battles\InventoryItem;
|
||||
use Battles\Template;
|
||||
use Battles\User;
|
||||
use Battles\UserInfo;
|
||||
|
||||
require_once "functions.php";
|
||||
|
||||
$d = mysql_fetch_array(mysql_query("SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = '{$user['id']}' AND `dressed` = 0 AND `setsale` = 0"));
|
||||
@@ -8,10 +15,21 @@ $hostel = mysql_fetch_array(mysql_query('SELECT * FROM `hostel` WHERE `uid` = "'
|
||||
$base = [1 => 15, 2 => 30, 3 => 50, 4 => 100];
|
||||
$vips = [1 => 0.15, 2 => 0.30, 3 => 0.45];
|
||||
|
||||
function get_meshok(): object
|
||||
{
|
||||
$allweight = DBPDO::$db->ofetch('select sum(weight) as items_weight_sum from inventory where on_sale = 0 and owner_id = ?', User::$current->getId());
|
||||
$stat = new UserInfo(User::$current->getId());
|
||||
return (object)[
|
||||
'currentweight' => $allweight->items_weight_sum,
|
||||
'maxweight' => $stat->getStat('strength') * 4 + $allweight->items_weight_sum,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
function show_item($row, $txt, $place)
|
||||
{
|
||||
if (($row['maxdur'] <= $row['duration']) || ($row['dategoden'] && $row['dategoden'] <= time())) {
|
||||
\Battles\InventoryItem::destroyItem($row['id']);
|
||||
InventoryItem::destroyItem($row['id']);
|
||||
}
|
||||
$r = '';
|
||||
|
||||
@@ -317,7 +335,8 @@ if ($_GET['search']) {
|
||||
}
|
||||
|
||||
#######
|
||||
$w = (270 * $d['mass'] / get_meshok());
|
||||
$w = (270 * get_meshok()->currentweight / get_meshok()->allweight);
|
||||
|
||||
$w_a = 270 - $w;
|
||||
$h = (270 * $in['cnt'] / $count);
|
||||
$h_a = 270 - $h;
|
||||
@@ -328,7 +347,7 @@ if ($_GET['go_back'] == 1) {
|
||||
header('Location: hostel.php');
|
||||
}
|
||||
|
||||
\Battles\Template::header('hostel_room');
|
||||
Template::header('hostel_room');
|
||||
?>
|
||||
<script src="js/ajaxLoad.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="css/hostel.css"/>
|
||||
@@ -442,7 +461,7 @@ if ($_GET['go_back'] == 1) {
|
||||
style="width: <?= $w; ?>px; height: 14px;"><img
|
||||
title="Мешок за спиной" src="/i/1silver.gif"
|
||||
style=" width: <?= $w_a; ?>px; height:14px"><tt
|
||||
style="font-size:13px"> <?= $d['mass']; ?>/<?= get_meshok() ?></tt></div>
|
||||
style="font-size:13px"> <?= getItemsMassaInfo() ?> </tt></div>
|
||||
<div class="progressBar" style='height:14px'><img title="Заполнение сундука" src="/i/chest.gif"
|
||||
height="14px"><img title="Заполнение сундука"
|
||||
src="/i/1blue.gif"
|
||||
|
||||
Reference in New Issue
Block a user