} } else { echo 'aa'; } } elseif (isset($_GET['hran'])) { $hranel_check = myquery("SELECT count_item From game_items Where user_id={$user_id} and id=" . $_GET['hran'] . ""); if ($hranel_check != false and mysql_num_rows($hranel_check) > 0) { list($hranel) = mysql_fetch_array($hranel_check); if (isset($_GET['hrannow']) and $_GET['hrannow'] > 0) { $col_el = max(0, (int) $_GET['hrannow']); $col_el = min($col_el, $hranel); $Item = new Item($_GET['hran']); if ($free >= $col_el) { $Item = new Item($_GET['hran']); if ($Item->getItem('user_id') == $user_id and $Item->getFact('type') == 13 and $Item->getItem('item_for_quest') == 0 and $Item->getItem('priznak') == 0 and $Item->getItem('used') == 0) { $Item->move_item_to_market($town, 0, 0, 0, 4, $col_el); $free = $free - $col_el; } } else { echo 'Недостаточно места в хранилище!'; } } else { list($el_name) = mysql_fetch_array(myquery("SELECT t1.name From game_items_factsheet as t1\n\t\t\t\t\t\t\t\t\t\t\t\t\t Join game_items as t2 On t1.id=t2.item_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t Where t2.id=" . $_GET['hran'] . "")); echo '<center><br />Положить эликсир <b>' . $el_name . '</b> в количестве <input size="5" type="text" id="hran_col" value="0"> шт.</a>'; echo '<br><i>У вас есть ' . $hranel . ' ' . pluralForm($hranel, 'эликсир', 'эликсира', 'эликсиров') . '</i>'; echo '<br /><br /><input type="button" value="Положить эликсир в хранилище" onClick="location.replace(\'town.php?option=' . $option . '&part4&add=' . $build_id . '&hran=' . $_GET['hran'] . '&hrannow=\'+document.getElementById(\'hran_col\').value+\'\')"><br />'; } } } //хранилище echo '<strong>' . $templ['name'] . ' (максимум ' . $templ['min_value'] . ' эликсиров)</strong><br /><br />';
} echo 'Нажми на рисунок, чтобы положить предмет в хранилище'; } else { echo '<br />В хранилище больше нет свободных мест!<br />'; } } elseif (isset($_GET['get'])) { $Item = new Item($_GET['get']); if ($Item->getItem('user_id') == $user_id and $Item->getItem('priznak') == 4 and $Item->getFact('weight') <= $char['CC'] - $char['CW']) { $Item->move_item_to_user(0, $user_id); $free++; } } elseif (isset($_GET['hran'])) { if ($free > 0) { $Item = new Item($_GET['hran']); if ($Item->getItem('user_id') == $user_id and $Item->getFact('type') < 90 and $Item->getFact('type') != 13 and $Item->getItem('item_for_quest') == 0 and ($Item->getItem('ref_id') == 0 or $Item->getFact('type') == 12 or $Item->getFact('type') == 14) and $Item->getItem('priznak') == 0 and $Item->getItem('used') == 0) { $Item->move_item_to_market($town, 0, 0, 0, 4); $free--; } } } //хранилище echo '<strong>Хранилище предметов (максимум ' . $templ['min_value'] . ' предметов)</strong><br /><br />'; echo 'Сейчас свободно <b><font color=red>' . $free . '</font></b> мест для хранения предметов.<br />'; echo "В инвентаре свободно место для <b><font color=red>" . max(0, $char['CC'] - $char['CW']) . "</font></b> кг.<br><br>"; echo '<a href="?option=' . $option . '&town_id=' . $town . '&part4&dom&sel_hran">Положить предметы в хранилище</a><br /><br />'; echo '<SCRIPT language=javascript src="../js/info.js"></SCRIPT><DIV id=hint style="Z-INDEX: 0; LEFT: 0px; VISIBILITY: hidden; POSITION: absolute; TOP: 0px"></DIV>'; QuoteTable('open', '100%'); $sel = myquery("SELECT * FROM game_items WHERE priznak=4 AND user_id={$user_id} AND town={$town} AND item_id NOT IN (SELECT id FROM game_items_factsheet WHERE type=13)"); if ($sel != false and mysql_num_rows($sel) > 0) { while ($hran = mysql_fetch_array($sel)) { echo '