보유 아이템 관리 개선
보유 아이템 관리에서 아이템 지급 시, 아이템 갯수를 지정하여 다수의 아이템을 지급할 수 있도록 업데이트 하였습니다.
This commit is contained in:
parent
900cacdcaa
commit
841475f47e
2 changed files with 12 additions and 14 deletions
|
|
@ -117,6 +117,7 @@ $frm_submit = '<div class="btn_confirm01 btn_confirm">
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="it_id" id="it_id" value="" />
|
<input type="hidden" name="it_id" id="it_id" value="" />
|
||||||
<input type="text" name="it_name" value="" id="it_name" onkeyup="get_ajax_item(this, 'item_list', 'it_id');" />
|
<input type="text" name="it_name" value="" id="it_name" onkeyup="get_ajax_item(this, 'item_list', 'it_id');" />
|
||||||
|
<input type="text" name="item_count" value="" style="width:50px;"/>개
|
||||||
<div id="item_list" class="ajax-list-box"><div class="list"></div></div>
|
<div id="item_list" class="ajax-list-box"><div class="list"></div></div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,19 @@ auth_check($auth[$sub_menu], 'w');
|
||||||
check_token();
|
check_token();
|
||||||
|
|
||||||
if(!$it_id && $it_name) {
|
if(!$it_id && $it_name) {
|
||||||
$it = sql_fetch("select it_id from {$g5['item_table']} where it_name = '{$it_name}'");
|
$it = sql_fetch("select * from {$g5['item_table']} where it_name = '{$it_name}'");
|
||||||
if($it['it_id'] == 0) {
|
if(!$it['it_id']) {
|
||||||
alert("해당 아이템의 정보가 없습니다.");
|
alert("해당 아이템의 정보가 없습니다.");
|
||||||
}
|
}
|
||||||
$it_id = $it['it_id'];
|
$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') {
|
if($take_type == 'A') {
|
||||||
// 전체지급
|
// 전체지급
|
||||||
|
|
@ -22,12 +29,7 @@ if($take_type == 'A') {
|
||||||
$result = sql_query($sql);
|
$result = sql_query($sql);
|
||||||
|
|
||||||
for($i=0; $ch = sql_fetch_array($result); $i++) {
|
for($i=0; $ch = sql_fetch_array($result); $i++) {
|
||||||
$sql = " insert into {$g5['inventory_table']}
|
insert_inventory($ch['ch_id'], $it_id, $it, $item_count);
|
||||||
set ch_id = '{$ch['ch_id']}',
|
|
||||||
it_id = '{$it_id}',
|
|
||||||
it_name = '{$it_name}',
|
|
||||||
ch_name = '{$ch['ch_name']}'";
|
|
||||||
sql_query($sql);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 개별지급
|
// 개별지급
|
||||||
|
|
@ -41,12 +43,7 @@ if($take_type == 'A') {
|
||||||
if (!$ch['ch_id'])
|
if (!$ch['ch_id'])
|
||||||
alert('존재하는 캐릭터가 아닙니다.');
|
alert('존재하는 캐릭터가 아닙니다.');
|
||||||
|
|
||||||
$sql = " insert into {$g5['inventory_table']}
|
insert_inventory($ch['ch_id'], $it_id, $it, $item_count);
|
||||||
set ch_id = '{$ch['ch_id']}',
|
|
||||||
it_id = '{$it_id}',
|
|
||||||
it_name = '{$it_name}',
|
|
||||||
ch_name = '{$ch['ch_name']}'";
|
|
||||||
sql_query($sql);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue