diff --git a/classes/InventoryItem.php b/classes/InventoryItem.php
index c7c1667..04f126f 100644
--- a/classes/InventoryItem.php
+++ b/classes/InventoryItem.php
@@ -34,7 +34,7 @@ NAME;
}
/**
- * Для кнопок управления под картинкой прелмета в зависимости от ситуации.
+ * Для кнопок управления под картинкой предмета в зависимости от ситуации.
*/
public function printControls()
{
diff --git a/fshop.php b/fshop.php
index 27ae2d1..98b7a7b 100644
--- a/fshop.php
+++ b/fshop.php
@@ -973,8 +973,8 @@ if ($_POST['docompare']) {
букет
";
- showitem($row);
+ echo "
Тут был showitem($row);";
+
echo " | ";
}
}
@@ -986,8 +986,8 @@ if ($_POST['docompare']) {
купить
";
- showitem($row);
+ echo " Тут был showitem($row);";
+
echo " | ";
}
}
diff --git a/gotzamok.php b/gotzamok.php
index 2cc53ca..285b9e0 100644
--- a/gotzamok.php
+++ b/gotzamok.php
@@ -154,7 +154,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
- |
+ Тут был showitem($row); |
@@ -168,7 +168,7 @@ if ($castleOwners['id'] == $user['klan']) { ?>
сдать в арсенал
- |
+ Тут был showitem($row); |
diff --git a/main.php b/main.php
index 5bf6c62..b8312c4 100644
--- a/main.php
+++ b/main.php
@@ -2167,29 +2167,87 @@ if (input::get('edit')) {
query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND (`type` < 12 OR `type` = 22 OR `type` = 23 OR `type` = 24) AND `setsale` = 0 ORDER BY `update` DESC', $user['id']);
+ $data = db::c()->query('SELECT `inventory`.*,
+ `magic`.`name` AS `magic_name`,
+ `magic`.`chanse` AS `magic_chanse`,
+ `magic`.`time` AS `magic_time`,
+ `magic`.`file` AS `magic_file`,
+ `magic`.`targeted` AS `magic_targeted`,
+ `magic`.`needcharge` AS `magic_needcharge`,
+ `magic`.`img` AS `magic_img` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `owner` = ?i AND `dressed` = 0 AND (`type` < 12 OR `type` = 22 OR `type` = 23 OR `type` = 24) AND `setsale` = 0 ORDER BY `update` DESC', $user['id']);
}
if ($_SESSION['razdel'] == 1) {
- $data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 12 AND `setsale` = 0 ORDER BY `update` DESC', $user['id']);
+ $data = db::c()->query('SELECT `inventory`.*,
+ `magic`.`name` AS `magic_name`,
+ `magic`.`chanse` AS `magic_chanse`,
+ `magic`.`time` AS `magic_time`,
+ `magic`.`file` AS `magic_file`,
+ `magic`.`targeted` AS `magic_targeted`,
+ `magic`.`needcharge` AS `magic_needcharge`,
+ `magic`.`img` AS `magic_img` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 12 AND `setsale` = 0 ORDER BY `update` DESC', $user['id']);
}
if ($_SESSION['razdel'] == 2) {
- $data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND (`type` > 12 OR `type` != 22 OR `type` != 23 OR `type` != 24) AND `setsale` = 0 ORDER BY `update` DESC', $user['id']);
+ $data = db::c()->query('SELECT `inventory`.*,
+ `magic`.`name` AS `magic_name`,
+ `magic`.`chanse` AS `magic_chanse`,
+ `magic`.`time` AS `magic_time`,
+ `magic`.`file` AS `magic_file`,
+ `magic`.`targeted` AS `magic_targeted`,
+ `magic`.`needcharge` AS `magic_needcharge`,
+ `magic`.`img` AS `magic_img` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `owner` = ?i AND `dressed` = 0 AND (`type` > 12 OR `type` != 22 OR `type` != 23 OR `type` != 24) AND `setsale` = 0 ORDER BY `update` DESC', $user['id']);
}
if ($_SESSION['razdel'] == 3) {
- $data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` >= 80 AND `type` <= 89 AND `setsale` = 0 ORDER BY `update` ASC', $user['id']);
+ $data = db::c()->query('SELECT `inventory`.*,
+ `magic`.`name` AS `magic_name`,
+ `magic`.`chanse` AS `magic_chanse`,
+ `magic`.`time` AS `magic_time`,
+ `magic`.`file` AS `magic_file`,
+ `magic`.`targeted` AS `magic_targeted`,
+ `magic`.`needcharge` AS `magic_needcharge`,
+ `magic`.`img` AS `magic_img` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `owner` = ?i AND `dressed` = 0 AND `type` >= 80 AND `type` <= 89 AND `setsale` = 0 ORDER BY `update` ASC', $user['id']);
}
if ($_SESSION['razdel'] == 4) {
- $data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 200 AND `setsale` = 0 ORDER BY `update` ASC', $user['id']);
+ $data = db::c()->query('SELECT `inventory`.*,
+ `magic`.`name` AS `magic_name`,
+ `magic`.`chanse` AS `magic_chanse`,
+ `magic`.`time` AS `magic_time`,
+ `magic`.`file` AS `magic_file`,
+ `magic`.`targeted` AS `magic_targeted`,
+ `magic`.`needcharge` AS `magic_needcharge`,
+ `magic`.`img` AS `magic_img` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 200 AND `setsale` = 0 ORDER BY `update` ASC', $user['id']);
}
if ($_SESSION['razdel'] == 5) {
- $data = db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 199 AND `setsale` = 0 ORDER BY `update` ASC', $user['id']);
+ $data = db::c()->query('SELECT `inventory`.*,
+ `magic`.`name` AS `magic_name`,
+ `magic`.`chanse` AS `magic_chanse`,
+ `magic`.`time` AS `magic_time`,
+ `magic`.`file` AS `magic_file`,
+ `magic`.`targeted` AS `magic_targeted`,
+ `magic`.`needcharge` AS `magic_needcharge`,
+ `magic`.`img` AS `magic_img` FROM `inventory` LEFT JOIN `magic` ON `magic` = `magic`.`id` WHERE `owner` = ?i AND `dressed` = 0 AND `type` = 199 AND `setsale` = 0 ORDER BY `update` ASC', $user['id']);
}
+
$groupNum = [];
$viewInventory = [];
$getItems = [];
$row = [];
+ $iteminfo =[];
#while ($row = $data->fetch_assoc()) showitem($row, null, "edit=1&razdel=$_SESSION[razdel]");
- while ($row = $data->fetch_assoc()) showitem($row);
+ #while ($row = $data->fetch_assoc()) showitem($row);
+ while ($row = $data->fetch_assoc()) $iteminfo[] = new InventoryItem($row);
+
+ echo "";
+ foreach ($iteminfo as $ii) {
+ echo "";
+ $ii->printImage();
+ $ii->printControls();
+ echo " | ";
+ echo "";
+ $ii->printInfo();
+ echo " |
";
+ }
+ echo "
";
+
if ($viewInventory and $getItems) {
foreach ($viewInventory as $viewCategiryes) {
echo $viewCategiryes['header'];