Выпилен глючащий stackall
This commit is contained in:
parent
53fe3e2ce2
commit
71a62ad960
51
main.php
51
main.php
@ -637,23 +637,7 @@ function updstats()
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($_SESSION['stackall'])) {
|
||||
$_SESSION['stackall'] = true;
|
||||
}
|
||||
|
||||
if (isset($_GET['stackall'])) {
|
||||
$_SESSION['stackall'] = ($_SESSION['stackall'] ? false : true);
|
||||
/*
|
||||
$rec = mysql_query("SELECT `id` FROM `inventory` WHERE `owner` = '$user[id]' AND `setsale` = 0 AND `koll` >= 1 ORDER BY `id` DESC");
|
||||
while($pl = mysql_fetch_array($rec)) {
|
||||
if(isset($pl['id'])) {
|
||||
stack($pl['id']);
|
||||
echo '<b style=\'margin-left: 15px; color: Red;\'>Все прошло успешно ...</b>';
|
||||
}
|
||||
unset($pl, $rec);
|
||||
}
|
||||
*/
|
||||
}
|
||||
unset($_SESSION['stackall']);
|
||||
|
||||
if (isset($_GET["stack"])) {
|
||||
$_GET["stack"] = (int)$_GET["stack"];
|
||||
@ -1986,7 +1970,7 @@ if (input::get('edit')) {
|
||||
|
||||
<? echo topsethp(); ?>
|
||||
|
||||
var groupItems = <?php echo($_SESSION['stackall'] ? 'true' : 'false'); ?>;
|
||||
var groupItems = false;
|
||||
$(document).ready(function () {
|
||||
$('a').live('click', function () {
|
||||
if ($(this).attr('ajax') != undefined) {
|
||||
@ -2043,11 +2027,6 @@ if (input::get('edit')) {
|
||||
<center>
|
||||
<a href='main.php?edit=1&undress=all'>Снять все</a><BR>
|
||||
<a href="javascript: void(0);" onclick="saveComplect(); return false;">Запомнить комплект</a><br/>
|
||||
<?php if ($_SESSION['stackall']): ?>
|
||||
<a href="/main.php?edit=1&stackall=false" ajax="mZeFilter">Разгруппировать предметы</a><br/><br/>
|
||||
<?php else: ?>
|
||||
<a href="/main.php?edit=1&stackall=true" ajax="mZeFilter">Группировать предметы</a><br/><br/>
|
||||
<?php endif; ?>
|
||||
</center>
|
||||
<BR>
|
||||
<table>
|
||||
@ -2648,32 +2627,8 @@ if (input::get('edit')) {
|
||||
$viewInventory = [];
|
||||
$getItems = [];
|
||||
$row = [];
|
||||
while ($row = $data->fetch_assoc()) {
|
||||
if ($_SESSION['stackall']) {
|
||||
while ($row = $data->fetch_assoc()) showitem($row, null, "edit=1&razdel=$_SESSION[razdel]");
|
||||
|
||||
$itemsCount = ($row['prototype'] ? db::c()->query('SELECT * FROM `inventory` WHERE `owner` = ?i AND `prototype` = ?i AND `dressed` = 0 AND `setsale` = 0', $user['id'], $row['prototype'])->getNumRows() : 1);
|
||||
|
||||
if (!isset($groupNum[$row['prototype']])) {
|
||||
$viewInventory[($row['prototype'] ? $row['prototype'] : $row['id'])]['header'] = '<tr bgcolor="#C7C7C7"><td onclick="$(\'#items_' . ($row['prototype'] ? $row['prototype'] : $row['id']) . '\').slideToggle(\'fast\'); collapse(' . ($row['prototype'] ? $row['prototype'] : $row['id']) . ');" style="cursor: pointer; overflow: hidden; z-index: 0;">';
|
||||
$viewInventory[($row['prototype'] ? $row['prototype'] : $row['id'])]['header'] .= '➕ <b>' . $row['name'] . ($row['upgrade'] > 0 ? " <font color=blue><b>[" . $row['upgrade'] . "]</b></font>" : "") . ' [' . $itemsCount . ']</b>';
|
||||
$viewInventory[($row['prototype'] ? $row['prototype'] : $row['id'])]['header'] .= '</td></tr><tr><td style="padding: 0px;">';
|
||||
$viewInventory[($row['prototype'] ? $row['prototype'] : $row['id'])]['header'] .= '<div id="items_' . ($row['prototype'] ? $row['prototype'] : $row['id']) . '" style="display: none;"><table width="100%">';
|
||||
}
|
||||
|
||||
$viewInventory[($row['prototype'] ? $row['prototype'] : $row['id'])]['ids'][] = $row['id'];
|
||||
|
||||
$groupNum[($row['prototype'] ? $row['prototype'] : $row['id'])]['count'] = $itemsCount;
|
||||
$groupNum[($row['prototype'] ? $row['prototype'] : $row['id'])]['id'][] += $row['id'];
|
||||
|
||||
$getItems[$row['id']] = showitem($row, null, "edit=1&razdel=$_SESSION[razdel]", true);
|
||||
|
||||
if (count($groupNum[$row['prototype']]['id']) == $itemsCount || count($groupNum[$row['id']]['id']) == $itemsCount) {
|
||||
$viewInventory[($row['prototype'] ? $row['prototype'] : $row['id'])]['fooder'] = '</table></div></td></tr>';
|
||||
}
|
||||
} else {
|
||||
showitem($row, null, "edit=1&razdel=$_SESSION[razdel]");
|
||||
}
|
||||
}
|
||||
if ($viewInventory and $getItems) {
|
||||
foreach ($viewInventory as $viewCategiryes) {
|
||||
echo $viewCategiryes['header'];
|
||||
|
Loading…
Reference in New Issue
Block a user