Переезд lookstats отовсюду в 1 класс.

This commit is contained in:
2023-04-16 01:54:07 +03:00
parent 2d63efd915
commit 3dc4cf7284
76 changed files with 1112 additions and 1124 deletions
+4 -26
View File
@@ -148,34 +148,12 @@ function timeOut($ttm)
return $out;
}
function lookStats($m)
{
if (empty($m)) {
return [];
}
$ist = [];
$di = explode('|', $m);
$i = 0;
$de = false;
while ($i < count($di)) {
$de = explode('=', $di[$i]);
if (isset($de[0], $de[1])) {
if (!isset($ist[$de[0]])) {
$ist[$de[0]] = 0;
}
$ist[$de[0]] = $de[1];
}
$i++;
}
return $ist;
}
if (empty($itm['id']) && !empty($_GET['id'])) {
$data = Db::getValue('select data from items_main_data where items_id = ?', [$_GET['id']]);
} else {
$data = Db::getValue('select data from items_main_data where items_id = ?', [$itm['id']]);
}
$itd = !empty($data) ? lookStats($data) : [];
$itd = !empty($data) ? \Core\ConversionHelper::dataStringToArray($data) : [];
$items = [
'tr' => ['lvl', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'mg1', 'mg2', 'mg3', 'mg4', 'mg5', 'mg6', 'mg7', 'mall', 'm2all', 'aall'],
@@ -597,7 +575,7 @@ $rz[$rt[$itm['type']]][1] ??= 'Прочие предметы';
//действие комплекта
$i1c = 0;
$i2c = 0;
$i1e = lookStats($itmc['data']);
$i1e = \Core\ConversionHelper::dataStringToArray($itmc['data']);
while ($i1c < count($items['add'])) {
if (isset($i1e[$items['add'][$i1c]])) {
$i3c = $i1e[$items['add'][$i1c]];
@@ -815,7 +793,7 @@ $rz[$rt[$itm['type']]][1] ??= 'Прочие предметы';
$itd = mysql_fetch_array(
mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = ' . $itm['id'])
);
$itd = lookStats($itd['data']);
$itd = \Core\ConversionHelper::dataStringToArray($itd['data']);
?>
<br>
<table width="100%" border="0" align=center cellpadding="0" cellspacing="0">
@@ -1076,7 +1054,7 @@ $rz[$rt[$itm['type']]][1] ??= 'Прочие предметы';
//действие комплекта
$i1c = 0;
$i2c = 0;
$i1e = lookStats($itmc['data']);
$i1e = \Core\ConversionHelper::dataStringToArray($itmc['data']);
while ($i1c < count($items['add'])) {
if (isset($i1e[$items['add'][$i1c]])) {
$i3c = $i1e[$items['add'][$i1c]];