From 841475f47e431b3e8fb9d32c7ce41e15f386c9dd Mon Sep 17 00:00:00 2001 From: TATECK Date: Thu, 1 Dec 2022 00:10:38 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B3=B4=EC=9C=A0=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=ED=85=9C=20=EA=B4=80=EB=A6=AC=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 보유 아이템 관리에서 아이템 지급 시, 아이템 갯수를 지정하여 다수의 아이템을 지급할 수 있도록 업데이트 하였습니다. --- AvocadoEdition/adm/inventory_list.php | 1 + AvocadoEdition/adm/inventory_update.php | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/AvocadoEdition/adm/inventory_list.php b/AvocadoEdition/adm/inventory_list.php index 7c6d34b..3d10e58 100644 --- a/AvocadoEdition/adm/inventory_list.php +++ b/AvocadoEdition/adm/inventory_list.php @@ -117,6 +117,7 @@ $frm_submit = '
+
diff --git a/AvocadoEdition/adm/inventory_update.php b/AvocadoEdition/adm/inventory_update.php index f05d208..3698493 100644 --- a/AvocadoEdition/adm/inventory_update.php +++ b/AvocadoEdition/adm/inventory_update.php @@ -7,13 +7,20 @@ auth_check($auth[$sub_menu], 'w'); check_token(); if(!$it_id && $it_name) { - $it = sql_fetch("select it_id from {$g5['item_table']} where it_name = '{$it_name}'"); - if($it['it_id'] == 0) { + $it = sql_fetch("select * from {$g5['item_table']} where it_name = '{$it_name}'"); + if(!$it['it_id']) { alert("해당 아이템의 정보가 없습니다."); } $it_id = $it['it_id']; +} else { + $it = sql_fetch("select * from {$g5['item_table']} where it_id = '{$it_id}'"); + if(!$it['it_id']) { + alert("해당 아이템의 정보가 없습니다."); + } } +$item_count = $item_count ? $item_count : 1; + if($take_type == 'A') { // 전체지급 $sql_common = " from {$g5['character_table']} "; @@ -22,12 +29,7 @@ if($take_type == 'A') { $result = sql_query($sql); for($i=0; $ch = sql_fetch_array($result); $i++) { - $sql = " insert into {$g5['inventory_table']} - set ch_id = '{$ch['ch_id']}', - it_id = '{$it_id}', - it_name = '{$it_name}', - ch_name = '{$ch['ch_name']}'"; - sql_query($sql); + insert_inventory($ch['ch_id'], $it_id, $it, $item_count); } } else { // 개별지급 @@ -41,12 +43,7 @@ if($take_type == 'A') { if (!$ch['ch_id']) alert('존재하는 캐릭터가 아닙니다.'); - $sql = " insert into {$g5['inventory_table']} - set ch_id = '{$ch['ch_id']}', - it_id = '{$it_id}', - it_name = '{$it_name}', - ch_name = '{$ch['ch_name']}'"; - sql_query($sql); + insert_inventory($ch['ch_id'], $it_id, $it, $item_count); }