fix itemlog display and logger
This commit is contained in:
parent
37a2c53f79
commit
f2283d75e1
8 changed files with 162 additions and 85 deletions
|
|
@ -52,10 +52,10 @@ $menu["config"]->addChildMenu("config", "홈페이지 상세관리", G5_ADMIN_UR
|
|||
$menu["config"]->getLastAddedMenu()->addSubFile("/config_form_update.php");
|
||||
|
||||
if (Community::isInitCommunity()) {
|
||||
$menu["config"]->addChildMenu("config", "메인슬라이드 관리", G5_ADMIN_URL . "/banner_list.php", true, 700, "\F2CC", 0);
|
||||
$menu["config"]->addChildMenu("config", "메인슬라이드 관리", G5_ADMIN_URL . "/banner_list.php", true, 700, "\F66D", 0);
|
||||
$menu["config"]->getLastAddedMenu()->addSubFile("/banner_form.php");
|
||||
|
||||
$menu["config"]->addChildMenu("config", "인트로 관리", G5_ADMIN_URL . "/intro_list.php", true, 700, "\F289", 0);
|
||||
$menu["config"]->addChildMenu("config", "인트로 관리", G5_ADMIN_URL . "/intro_list.php", true, 710, "\F7BF", 0);
|
||||
$menu["config"]->getLastAddedMenu()->addSubFile("/intro_form.php");
|
||||
$menu["config"]->getLastAddedMenu()->addSubFile("/intro_form_update.php");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ if (Community::isInitCommunity()) {
|
|||
$menu["item"]->getLastAddedMenu()->addSubFile("/inventory_update.php");
|
||||
|
||||
$menu["item"]->addChildMenu("item", "레시피 관리", G5_ADMIN_URL . "/recipe_list.php", true, 0, "\F442", 0);
|
||||
$menu["item"]->addChildMenu("item", "아이템 기록", G5_ADMIN_URL . "/itemlog_list.php", true, 0, "\F50F", 0);
|
||||
$menu["item"]->addChildMenu("item", "아이템 구매 기록", G5_ADMIN_URL . "/order_list.php", true, 0, "\F50F", 0);
|
||||
$menu["item"]->addChildMenu("item", "아이템 사용 기록", G5_ADMIN_URL . "/itemlog_list.php", true, 0, "\F50F", 0);
|
||||
|
||||
$menu["character"]->addChildMenu("character", "캐릭터 관리", G5_ADMIN_URL . "/character_list.php", true, 0, "\F379", 0);
|
||||
$menu["character"]->getLastAddedMenu()->addSubFile("/character_list_update.php");
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ if ($take_type == 'A') {
|
|||
$result = sql_query($sql);
|
||||
|
||||
for ($i = 0; $ch = sql_fetch_array($result); $i++) {
|
||||
insert_inventory($ch['ch_id'], $it_id, $it, $item_count);
|
||||
Item::giveItem($ch['ch_id'], $it_id, $it, $item_count, "시스템 지급");
|
||||
}
|
||||
} else {
|
||||
// 개별지급
|
||||
|
|
@ -43,10 +43,11 @@ if ($take_type == 'A') {
|
|||
$ch = sql_fetch("select ch_id, ch_name from {$g5['character_table']} where ch_id = '{$ch_id}'");
|
||||
}
|
||||
|
||||
if (!$ch['ch_id'])
|
||||
if (!$ch['ch_id']) {
|
||||
alert('존재하는 캐릭터가 아닙니다.');
|
||||
}
|
||||
|
||||
insert_inventory($ch['ch_id'], $it_id, $it, $item_count);
|
||||
Item::giveItem($ch['ch_id'], $it_id, $it, $item_count, "시스템 지급");
|
||||
}
|
||||
|
||||
goto_url('./inventory_list.php?' . $qstr);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ auth_check($auth[$sub_menu], 'r');
|
|||
|
||||
$token = get_token();
|
||||
|
||||
$sql_common = " FROM {$g5['item_modifylog']} o ";
|
||||
$sql_common = " FROM {$g5['item_modify_table']} o ";
|
||||
$sql_search = " WHERE (1) ";
|
||||
|
||||
if ($stx) {
|
||||
|
|
@ -19,16 +19,16 @@ if ($stx) {
|
|||
}
|
||||
|
||||
if (!$sst) {
|
||||
$sst = "o.srl";
|
||||
$sst = "o.im_id";
|
||||
$sod = "DESC";
|
||||
}
|
||||
|
||||
$sql_order = " ORDER BY {$sst} {$sod} ";
|
||||
|
||||
$sql = " SELECT count(*) AS cnt
|
||||
{$sql_common}
|
||||
{$sql_search}
|
||||
{$sql_order} ";
|
||||
{$sql_common}
|
||||
{$sql_search}
|
||||
{$sql_order} ";
|
||||
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
|
|
@ -42,10 +42,10 @@ if ($page < 1)
|
|||
|
||||
$from_record = ($page - 1) * $rows;
|
||||
$sql = " SELECT *
|
||||
{$sql_common}
|
||||
{$sql_search}
|
||||
{$sql_order}
|
||||
LIMIT {$from_record}, {$rows} ";
|
||||
{$sql_common}
|
||||
{$sql_search}
|
||||
{$sql_order}
|
||||
LIMIT {$from_record}, {$rows} ";
|
||||
|
||||
$result = sql_query($sql);
|
||||
$listall = '<a href="' . $_SERVER['PHP_SELF'] . '" class="ov_listall">전체목록</a>';
|
||||
|
|
@ -58,7 +58,7 @@ $g5['title'] = '아이템 기록';
|
|||
|
||||
include_once './admin.head.php';
|
||||
|
||||
$colspan = 4; ?>
|
||||
$colspan = 5; ?>
|
||||
<div class="local_ov01 local_ov">
|
||||
<?php echo $listall ?>
|
||||
전체 <?php echo number_format($total_count) ?> 건
|
||||
|
|
@ -79,47 +79,85 @@ $colspan = 4; ?>
|
|||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<colgroup>
|
||||
<col style="width: 150px;" />
|
||||
<col />
|
||||
<col style="width: 150px;" />
|
||||
<col style="width: 150px;" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">캐릭터명</th>
|
||||
<th scope="col">아이템</th>
|
||||
<th scope="col">구분</th>
|
||||
<th scope="col">일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i = 0; $row = sql_fetch_array($result); $i++) {
|
||||
$bg = 'bg' . ($i % 2);
|
||||
$it = get_item($row['it_id']);
|
||||
$ch = get_character($row['ch_id']);
|
||||
$mb = get_member($row['mb_id']);
|
||||
<form name="fmodifylist" id="fmodifylist" method="post" action="./itemlog_list_delete.php"
|
||||
onsubmit="return fmodifylist_submit(this);">
|
||||
<input type="hidden" name="sst" value="<?php echo $sst ?>">
|
||||
<input type="hidden" name="sod" value="<?php echo $sod ?>">
|
||||
<input type="hidden" name="sfl" value="<?php echo $sfl ?>">
|
||||
<input type="hidden" name="stx" value="<?php echo $stx ?>">
|
||||
<input type="hidden" name="page" value="<?php echo $page ?>">
|
||||
<input type="hidden" name="token" value="<?php echo $token ?>">
|
||||
<div class="tbl_head01 tbl_wrap">
|
||||
<table>
|
||||
<caption><?php echo $g5['title']; ?> 목록</caption>
|
||||
<colgroup>
|
||||
<col style="width: 50px;" />
|
||||
<col style="width: 150px;" />
|
||||
<col />
|
||||
<col style="width: 150px;" />
|
||||
<col style="width: 150px;" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<label for="chkall" class="sound_only">아이템 전체</label>
|
||||
<input type="checkbox" name="chkall" value="1" id="chkall" onclick="check_all(this.form)">
|
||||
</th>
|
||||
<th scope="col">캐릭터명</th>
|
||||
<th scope="col">아이템</th>
|
||||
<th scope="col">구분</th>
|
||||
<th scope="col">일시</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for ($i = 0; $row = sql_fetch_array($result); $i++) {
|
||||
$bg = 'bg' . ($i % 2);
|
||||
$it = get_item($row['it_id']);
|
||||
$ch = get_character($row['ch_id']);
|
||||
$mb = get_member($row['mb_id']);
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td>
|
||||
<input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>">
|
||||
<input type="hidden" name="im_id[<?php echo $i ?>]" value="<?php echo $row['im_id'] ?>" />
|
||||
</td>
|
||||
<td><?php echo get_text($ch['ch_name']); ?></td>
|
||||
<td class="al">
|
||||
<img src="<?= $it['it_img'] ?>" style="max-width: 30px;" />
|
||||
<?php echo get_text($it['it_name']); ?>
|
||||
</td>
|
||||
<td><?php echo get_text($row['im_using_type']); ?></td>
|
||||
<td><?php echo ($row['im_date'] == '0000-00-00 00:00:00') ? '' : $row['im_date'] ?></td>
|
||||
</tr><?php
|
||||
}
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
<tr class="<?php echo $bg; ?>">
|
||||
<td><?php echo get_text($ch['ch_name']); ?></td>
|
||||
<td class="al">
|
||||
<img src="<?= $it['it_img'] ?>" style="max-width: 30px;" />
|
||||
<?php echo get_text($it['it_name']); ?>
|
||||
</td>
|
||||
<td><?php echo get_text($row['using_type']); ?></td>
|
||||
<td><?php echo ($row['regdate'] == '0000-00-00 00:00:00') ? '' : $row['regdate'] ?></td>
|
||||
</tr><?php
|
||||
}
|
||||
if ($i == 0)
|
||||
echo '<tr><td colspan="' . $colspan . '" class="empty_table">자료가 없습니다.</td></tr>';
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="list_confirm">
|
||||
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page=");
|
||||
?><script>
|
||||
function fmodifylist_submit(f) {
|
||||
if (!is_checked("chk[]")) {
|
||||
alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (document.pressed == "선택삭제") {
|
||||
if (!confirm("선택한 자료를 정말 삭제하시겠습니까?")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
include_once './admin.tail.php';
|
||||
|
|
|
|||
20
AvocadoEdition_Light/adm/itemlog_list_delete.php
Normal file
20
AvocadoEdition_Light/adm/itemlog_list_delete.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
include_once "./_common.php";
|
||||
|
||||
check_demo();
|
||||
auth_check($auth[$sub_menu], 'd');
|
||||
check_token();
|
||||
|
||||
print_r($_POST);
|
||||
|
||||
for ($i = 0; $i < count($_POST['chk']); $i++) {
|
||||
$k = $_POST['chk'][$i];
|
||||
$temp_or_id = trim($_POST['im_id'][$k]);
|
||||
if (!$temp_or_id) {
|
||||
return;
|
||||
}
|
||||
|
||||
sql_query("DELETE FROM {$g5['item_modify_table']} WHERE im_id = '{$temp_or_id}'");
|
||||
}
|
||||
|
||||
goto_url('./order_list.php?' . $qstr);
|
||||
|
|
@ -68,9 +68,10 @@ class Item extends Module
|
|||
public static function takeItem($inventory_id, $delete = 0, $type = "사용")
|
||||
{
|
||||
global $g5;
|
||||
|
||||
self::addUseLog($inventory_id, $type . ($delete != 0 ? " (삭제)" : " (보존)"));
|
||||
|
||||
if ($delete === 0) {
|
||||
self::addUseLog($inventory_id, $type);
|
||||
sql_query("DELETE FROM {$g5['inventory_table']} WHERE in_id = '{$inventory_id}'");
|
||||
}
|
||||
}
|
||||
|
|
@ -117,19 +118,26 @@ class Item extends Module
|
|||
public static function addGetLog($it_id, $ch_id, $item = null, $type = '획득')
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if ($item == null || array_key_exists('it_id', $item)) {
|
||||
$item = self::getItem($it_id);
|
||||
try {
|
||||
if ($item == null || array_key_exists('it_id', $item)) {
|
||||
$item = self::getItem($it_id);
|
||||
}
|
||||
$item = $item ? addslashes(json_encode($item, JSON_UNESCAPED_UNICODE)) : "{}";
|
||||
$sql = "INSERT INTO `{$g5['item_modify_table']}` SET
|
||||
`it_id` = '{$it_id}',
|
||||
`ch_id` = '{$ch_id}',
|
||||
`it_count` = 1,
|
||||
`im_using_type` = '{$type}',
|
||||
`im_origin_item` = '{$item}'";
|
||||
|
||||
sql_query($sql);
|
||||
|
||||
if (sql_error_info()) {
|
||||
throw new exception(sql_error_info());
|
||||
}
|
||||
} catch(Exception $x) {
|
||||
|
||||
}
|
||||
$item = addslashes(base64_encode(json_encode($item)));
|
||||
$sql = "INSERT INTO `{$g5['item_modify_table']}` SET
|
||||
`it_id` = '{$it_id}',
|
||||
`ch_id` = '{$ch_id}',
|
||||
`it_count` = 1,
|
||||
`using_type` = '{$type}',
|
||||
`origin_item` = '{$item}'";
|
||||
|
||||
sql_query($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -139,19 +147,27 @@ class Item extends Module
|
|||
public static function addUseLog($in_id, $type)
|
||||
{
|
||||
global $g5;
|
||||
$origin_item = sql_fetch("SELECT * FROM {$g5['inventory_table']} where in_id = '{$in_id}'");
|
||||
|
||||
$item = addslashes(base64_encode(json_encode($origin_item)));
|
||||
$it_id = $origin_item['it_id'];
|
||||
$ch_id = $origin_item['ch_id'];
|
||||
|
||||
$sql = "INSERT INTO `{$g5['item_modify_table']}` SET
|
||||
`it_id` = '{$it_id}',
|
||||
`ch_id` = '{$ch_id}',
|
||||
`it_count` = 1,
|
||||
`using_type` = '{$type}',
|
||||
`origin_item` = '{$item}'";
|
||||
|
||||
sql_query($sql);
|
||||
try {
|
||||
$origin_item = sql_fetch("SELECT * FROM {$g5['inventory_table']} where in_id = '{$in_id}'");
|
||||
|
||||
$item = $origin_item ? addslashes(json_encode($origin_item, JSON_UNESCAPED_UNICODE)) : "{}";
|
||||
$it_id = $origin_item['it_id'];
|
||||
$ch_id = $origin_item['ch_id'];
|
||||
|
||||
$sql = "INSERT INTO `{$g5['item_modify_table']}` SET
|
||||
`it_id` = '{$it_id}',
|
||||
`ch_id` = '{$ch_id}',
|
||||
`it_count` = 1,
|
||||
`im_using_type` = '{$type}',
|
||||
`im_origin_item` = '{$item}'";
|
||||
|
||||
sql_query($sql);
|
||||
|
||||
if (sql_error_info()) {
|
||||
throw new exception(sql_error_info());
|
||||
}
|
||||
} catch(Exception $x) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ function display_banner($skin = '', $start = true, $effect = 'slide', $speed = '
|
|||
if (!$cache_fwrite)
|
||||
include $cache_file;
|
||||
}
|
||||
} else if (!G5_USE_CACHE || $cache_fwrite) {
|
||||
}
|
||||
|
||||
if (!G5_USE_CACHE || $cache_fwrite) {
|
||||
$banner = [];
|
||||
$sql = " select * from {$g5['banner_table']} where '" . G5_TIME_YMDHIS . "' between bn_begin_time and bn_end_time order by bn_order, bn_id desc ";
|
||||
$result = sql_query($sql);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ function get_mmb_image($bo_table, $wr_id)
|
|||
{
|
||||
global $g5, $config;
|
||||
$sql = "SELECT bf_file, bf_width, bf_height FROM {$g5['board_file_table']}
|
||||
where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_type between '1' and '3' order by bf_no limit 0, 1 ";
|
||||
where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_type between '1' and '3' order by bf_no limit 0, 1 ";
|
||||
$row = sql_fetch($sql);
|
||||
|
||||
if ($row['bf_file']) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue