$selres = myquery("SELECT * FROM craft_resource_user WHERE user_id={$user_id} AND res_id={$resid}"); if ($selres != false and mysql_num_rows($selres) > 0) { $res = mysql_fetch_array($selres); QuoteTable('open'); echo 'Укажи кол-во ресурса, которые ты хочешь выбросить:<br>'; echo '<form action="act.php?func=inv&dropres=' . $resid . '" method="POST">'; echo '<img src=http://' . img_domain . '/item/resources/' . $ress['img3'] . '.gif border=0 width=50 height=50> ' . $ress['name'] . ' - есть ' . $res['col'] . ' ед.<br><br>'; echo 'Выбросить: <input type="text" name="kol" value="1" size=5 maxsize=5> ед. '; echo '<input type="submit" name="submit" value="Выбросить">'; echo '</form>'; QuoteTable('close'); } } elseif (isset($_POST['kol']) and $_POST['kol'] > 0 and is_numeric($_POST['kol'])) { $kol = (int) $_POST['kol']; $Res = new Res($ress, 0); $Res->drop($kol); QuoteTable('open'); echo $Res->message; QuoteTable('close'); } } $sel_used_items = myquery("SELECT id,item_id,used FROM game_items WHERE user_id={$user_id} AND priznak=0 AND used>0"); $used_items = array(); while ($it = mysql_fetch_array($sel_used_items)) { $used_items[$it['used']]['id'] = $it['id']; $used_items[$it['used']]['item_id'] = $it['item_id']; } PrintInv($user_id, 0); $check = myquery("SELECT * FROM game_users_complects WHERE user_id='" . $user_id . "'"); $kol = mysql_num_rows($check); $i = 0;