code quality

This commit is contained in:
Amberstone 2024-10-07 10:47:40 +09:00
parent 5ac6319e3f
commit b4fe117c38
Signed by: amber
GPG key ID: 094B0E55F98D8BF1
7 changed files with 106 additions and 110 deletions

View file

@ -1,4 +1,7 @@
<?php
/**
* @var string $sch_it_id
*/
include_once './_common.php';
auth_check($auth[$sub_menu], 'r');
@ -51,7 +54,6 @@ $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall">전체
$g5['title'] = '아이템 뽑기 관리';
include_once './admin.head.php';
$pg_anchor = '<ul class="anchor">
<li><a href="#anc_001">뽑기 설정 목록</a></li>
<li><a href="#anc_002">뽑기 등록</a></li>
@ -70,24 +72,19 @@ if ($sch_it_id) {
}
?>
<section id="anc_001">
<h2 class="h2_frm">뽑기 설정 목록</h2>
<?php echo $pg_anchor ?>
<div class="local_ov01 local_ov">
<?php echo $listall ?>
등록된 뽑기 설정 <?php echo number_format($total_count) ?>
</div>
<?php if ($sch_it_name) { ?>
<div style="padding-bottom: 10px;">
<img src="<?= $sch_it_img ?>" style="width: 50px;" />
[ <?= $sch_it_name ?> ] 뽑기 설정
</div>
<?php } ?>
<form name="ftitlelist" id="ftitlelist" action="./explorer_list_update.php" method="post"
enctype="multipart/form-data">
<input type="hidden" name="sst" value="<?php echo $sst ?>">
@ -97,7 +94,6 @@ if ($sch_it_id) {
<input type="hidden" name="sch_it_id" value="<?php echo $sch_it_id ?>">
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="token" value="">
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
@ -105,7 +101,6 @@ if ($sch_it_id) {
<col style="width: 45px;" />
<col style="width: 100px;" />
<col style="width: 200px;" />
<col style="width: 100px;" />
<col style="width: 200px;" />
<col />
@ -128,7 +123,6 @@ if ($sch_it_id) {
$re_it = sql_fetch("select it_id, it_name, it_img from {$g5['item_table']} where it_id = '{$ie['re_it_id']}'");
$bg = 'bg' . ($i % 2);
?>
<tr class="<?php echo $bg; ?>">
<td>
<input type="hidden" name="ie_id[<?php echo $i ?>]" value="<?php echo $ie['ie_id'] ?>"
@ -145,7 +139,6 @@ if ($sch_it_id) {
<td>
<a href="?sch_it_id=<?= $it['it_id'] ?>"><?= $it['it_name'] ?></a>
</td>
<td>
<?php if ($re_it['it_img']) { ?>
<img src="<?= $re_it['it_img'] ?>" style="max-width: 50px;" />
@ -156,7 +149,6 @@ if ($sch_it_id) {
<td>
<?= $re_it['it_name'] ?>
</td>
<td>
<input type="text" name="ie_per_s[<?php echo $i ?>]" value="<?php echo $ie['ie_per_s']; ?>" size="5"
maxlength="11">
@ -165,7 +157,6 @@ if ($sch_it_id) {
maxlength="11"> 구간 획득
</td>
</tr>
<?php
}
if ($i == 0)
@ -174,15 +165,12 @@ if ($sch_it_id) {
</tbody>
</table>
</div>
<div class="list_confirm">
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
<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['SCRIPT_NAME']}?$qstr&amp;page="); ?>
<script>
$(function () {
$('#ftitlelist').submit(function () {
@ -201,7 +189,6 @@ if ($sch_it_id) {
});
</script>
</section>
<?php
if (!$sch_it_id || $sch_it['it_type'] == '뽑기') {
?>
@ -215,10 +202,8 @@ if (!$sch_it_id || $sch_it['it_type'] == '뽑기') {
<input type="hidden" name="page" value="<?php echo $page ?>">
<input type="hidden" name="token" value="<?php echo $token ?>">
<input type="hidden" name="sch_it_id" value="<?php echo $sch_it_id ?>">
<h2 class="h2_frm">뽑기 등록</h2>
<?php echo $pg_anchor ?>
<div class="tbl_frm01 tbl_wrap">
<table>
<colgroup>
@ -233,7 +218,6 @@ if (!$sch_it_id || $sch_it['it_type'] == '뽑기') {
<input type="hidden" name="it_id" value="<?= $sch_it_id ?>" />
<input type="hidden" name="it_name" value="<?= $sch_it_name ?>" />
<img src="<?= $sch_it_img ?>" alt="" style="max-width: 50px;" /> <?= $sch_it_name ?>
<?php } else { ?>
<?php echo help("※ [ 아이템 기능 - 뽑기 아이템 ] 이 설정되어 있어야 적용됩니다.") ?>
<input type="hidden" name="it_id" id="it_id" value="<?= $sch_it_id ?>" />
@ -268,17 +252,11 @@ if (!$sch_it_id || $sch_it['it_type'] == '뽑기') {
</tbody>
</table>
</div>
<div class="list_confirm">
<input type="submit" value="등록" class="btn_submit" id="btn_submit">
</div>
</form>
</section>
<?php } ?>
<?php
<?php }
include_once './admin.tail.php';
?>

View file

@ -1,4 +1,16 @@
<?php
/**
* @var string $it_name
* @var string $re_it_name
* @var string|int $ie_per_s
* @var string|int $ie_per_e
* @var string|int $ma_id
* @var string|int $ie_1
* @var string|int $ie_2
* @var string|int $ie_3
* @var string|int $ie_4
* @var string|int $ie_5
*/
include_once './_common.php';
auth_check($auth[$sub_menu], 'w');

View file

@ -1,5 +1,7 @@
<?php
$sub_menu = "500100";
/**
* @var string|int $sh_id
*/
include_once './_common.php';
include_once G5_EDITOR_LIB;
@ -186,11 +188,9 @@ if (empty($fr_date))
</div>
</section>
<?php echo $frm_submit; ?>
<section id="anc_002">
<h2 class="h2_frm">가격 설정</h2>
<?php echo $pg_anchor ?>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>아이템 기본 설정</caption>
@ -263,7 +263,7 @@ if (empty($fr_date))
</td>
<td>
<input type="hidden" name="sh_has_title" id="sh_has_title" value="<?= $shop['sh_has_title'] ?>" />
<input type="text" name="sh_has_title_name" value="<?= get_title($shop['sh_has_title'], true) ?>"
<input type="text" name="sh_has_title_name" value="<?= get_title($shop['sh_has_title']) ?>"
id="sh_has_title_name" onkeyup="get_ajax_title(this, 'has_title_list', 'sh_has_title');" />
<div id="has_title_list" class="ajax-list-box">
<div class="list"></div>
@ -283,11 +283,9 @@ if (empty($fr_date))
</div>
</section>
<?php echo $frm_submit; ?>
<section id="anc_003">
<h2 class="h2_frm">구매제한 설정</h2>
<?php echo $pg_anchor ?>
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>아이템 기본 설정</caption>
@ -392,10 +390,7 @@ if (empty($fr_date))
</div>
</section>
<?php echo $frm_submit; ?>
</form>
<script>
$(function () {
$(".date").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yymmdd", showButtonPanel: true, yearRange: "c-99:c+99" });

View file

@ -3,6 +3,36 @@
* @var string $it_name
* @var string $sh_has_item_name
* @var string $sh_has_title_name
* @var string|int $sh_id
*
* @var array|null $sh_week
* @var array|null $sh_side
* @var array|null $sh_class
* @var array|null $sh_rank
*
* @var string|int $it_id
* @var string|int $ca_name
* @var string|int $sh_limit
* @var string|int $sh_qty
* @var string|int $sh_money
* @var string|int $sh_use_money
* @var string|int $sh_exp
* @var string|int $sh_use_exp
* @var string|int $sh_content
* @var string|int $sh_use_side
* @var string|int $sh_use_class
* @var string|int $sh_use_rank
* @var string|int $sh_has_item
* @var string|int $sh_use_has_item
* @var string|int $sh_has_item_count
* @var string|int $sh_has_title
* @var string|int $sh_use_has_title
* @var string|int $sh_use
* @var string|int $sh_date_s
* @var string|int $sh_date_e
* @var string|int $sh_time_s
* @var string|int $sh_time_e
* @var string|int $sh_order
*/
include_once './_common.php';
@ -12,23 +42,23 @@ auth_check($auth[$sub_menu], 'w');
check_token();
// 요일 데이터 저장
if (count($sh_week) > 0) {
if (isset($sh_week) && is_array($sh_week) && count($sh_week)) {
$sh_week = implode("||", $sh_week);
$sh_week = "||" . $sh_week . "||";
}
// 소속 제한 설정 저장
if (count($sh_side) > 0) {
if (isset($sh_side) && is_array($sh_side) && count($sh_side)) {
$sh_side = implode("||", $sh_side);
$sh_side = "||" . $sh_side . "||";
}
// 종족 제한 설정 저장
if (count($sh_class) > 0) {
if (isset($sh_class) && is_array($sh_class) && count($sh_class)) {
$sh_class = implode("||", $sh_class);
$sh_class = "||" . $sh_class . "||";
}
// 랭킹 제한 설정 저장
if (count($sh_rank) > 0) {
if (isset($sh_rank) && is_array($sh_rank) && count($sh_rank)) {
$sh_rank = implode("||", $sh_rank);
$sh_rank = "||" . $sh_rank . "||";
}
@ -68,33 +98,33 @@ if (!$sh_has_title_name) {
}
$sql_common = "
it_id = '{$it_id}',
ca_name = '{$ca_name}',
sh_limit = '{$sh_limit}',
sh_qty = '{$sh_qty}',
sh_money = '{$sh_money}',
sh_use_money = '{$sh_use_money}',
sh_exp = '{$sh_exp}',
sh_use_exp = '{$sh_use_exp}',
sh_content = '{$sh_content}',
sh_side = '{$sh_side}',
sh_use_side = '{$sh_use_side}',
sh_class = '{$sh_class}',
sh_use_class = '{$sh_use_class}',
sh_rank = '{$sh_rank}',
sh_use_rank = '{$sh_use_rank}',
sh_has_item = '{$sh_has_item}',
sh_use_has_item = '{$sh_use_has_item}',
sh_has_item_count = '{$sh_has_item_count}',
sh_has_title = '{$sh_has_title}',
sh_use_has_title = '{$sh_use_has_title}',
sh_use = '{$sh_use}',
sh_date_s = '{$sh_date_s}',
sh_date_e = '{$sh_date_e}',
sh_time_s = '{$sh_time_s}',
sh_time_e = '{$sh_time_e}',
sh_week = '{$sh_week}',
sh_order = '{$sh_order}'
it_id = '{$it_id}',
ca_name = '{$ca_name}',
sh_limit = '{$sh_limit}',
sh_qty = '{$sh_qty}',
sh_money = '{$sh_money}',
sh_use_money = '{$sh_use_money}',
sh_exp = '{$sh_exp}',
sh_use_exp = '{$sh_use_exp}',
sh_content = '{$sh_content}',
sh_side = '{$sh_side}',
sh_use_side = '{$sh_use_side}',
sh_class = '{$sh_class}',
sh_use_class = '{$sh_use_class}',
sh_rank = '{$sh_rank}',
sh_use_rank = '{$sh_use_rank}',
sh_has_item = '{$sh_has_item}',
sh_use_has_item = '{$sh_use_has_item}',
sh_has_item_count = '{$sh_has_item_count}',
sh_has_title = '{$sh_has_title}',
sh_use_has_title = '{$sh_use_has_title}',
sh_use = '{$sh_use}',
sh_date_s = '{$sh_date_s}',
sh_date_e = '{$sh_date_e}',
sh_time_s = '{$sh_time_s}',
sh_time_e = '{$sh_time_e}',
sh_week = '{$sh_week}',
sh_order = '{$sh_order}'
";
@ -115,5 +145,4 @@ if ($w == '') {
sql_query($sql);
}
goto_url('./shop_list.php?' . $qstr, false);
?>
goto_url('./shop_list.php?' . $qstr);

View file

@ -1,5 +1,7 @@
<?php
$sub_menu = "500100";
/**
* @var string $cate
*/
include_once './_common.php';
auth_check($auth[$sub_menu], 'r');
@ -81,7 +83,7 @@ $colspan = 19;
<label for="sfl" class="sound_only">검색대상</label>
<select name="sfl" id="sfl">
<option value="it_name" <?php echo get_selected($_GET['sfl'], "it_name", true); ?>>아이템 이름</option>
<option value="it_name" <?php echo get_selected($_GET['sfl'], "it_name"); ?>>아이템 이름</option>
<option value="it_content" <?php echo get_selected($_GET['sfl'], "it_content"); ?>>아이템 설명</option>
</select>
<label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
@ -234,11 +236,6 @@ $colspan = 19;
<input type="text" name="sh_has_item_count[<?php echo $i ?>]"
value="<?php echo get_text($shop['sh_has_item_count']) ?>" style="width:70%;">
</td>
<td style="width:30px; padding:0; border-right-width:0;">
<input type="checkbox" name="sh_use_has_title[<?php echo $i ?>]" value="1" <?php echo $shop['sh_use_has_title'] ? "checked" : "" ?>>
</td>
@ -249,7 +246,6 @@ $colspan = 19;
-
<?php } ?>
</td>
<td style="width:50px;">
<input type="text" name="sh_limit[<?php echo $i ?>]" value="<?php echo get_text($shop['sh_limit']) ?>"
style="width:100%;">
@ -267,7 +263,6 @@ $colspan = 19;
<?php echo $one_copy ?>
</td>
</tr>
<?php
}
if ($i == 0)
@ -276,18 +271,14 @@ $colspan = 19;
</tbody>
</table>
</div>
<div class="list_confirm">
<input type="submit" name="act_button" value="선택수정" onclick="document.pressed=this.value">
<?php if ($is_admin == 'super') { ?>
<input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value">
<?php } ?>
</div>
</form>
<?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'] . '?' . $qstr . '&amp;cate=' . $cate . '&amp;cate2=' . $cate2 . '&amp;map_id=' . $map_id . '&amp;page='); ?>
<script>
function fshoplist_submit(f) {
if (!is_checked("chk[]")) {
@ -304,7 +295,5 @@ $colspan = 19;
return true;
}
</script>
<?php
include_once './admin.tail.php';
?>

View file

@ -1,5 +1,4 @@
<?php
$sub_menu = "500100";
include_once './_common.php';
check_demo();
@ -9,42 +8,35 @@ if (!count($_POST['chk'])) {
}
if ($_POST['act_button'] == "선택수정") {
auth_check($auth[$sub_menu], 'w');
for ($i=0; $i<count($_POST['chk']); $i++) {
// 실제 번호를 넘김
$k = $_POST['chk'][$i];
$sql = " update {$g5['shop_table']}
set ca_name = '{$_POST['ca_name'][$k]}',
sh_money = '{$_POST['sh_money'][$k]}',
sh_use_money = '{$_POST['sh_use_money'][$k]}',
sh_exp = '{$_POST['sh_exp'][$k]}',
sh_use_exp = '{$_POST['sh_use_exp'][$k]}',
sh_limit = '{$_POST['sh_limit'][$k]}',
sh_qty = '{$_POST['sh_qty'][$k]}',
sh_use_money = '{$_POST['sh_use_money'][$k]}',
sh_use_exp = '{$_POST['sh_use_exp'][$k]}',
sh_use_has_title = '{$_POST['sh_use_has_title'][$k]}',
sh_use_has_item = '{$_POST['sh_use_has_item'][$k]}',
sh_has_item_count = '{$_POST['sh_has_item_count'][$k]}',
sh_order = '{$_POST['sh_order'][$k]}'
where sh_id = '{$_POST['sh_id'][$k]}' ";
$sql = "UPDATE {$g5['shop_table']} SET
ca_name = '{$_POST['ca_name'][$k]}',
sh_money = '{$_POST['sh_money'][$k]}',
sh_use_money = '{$_POST['sh_use_money'][$k]}',
sh_exp = '{$_POST['sh_exp'][$k]}',
sh_use_exp = '{$_POST['sh_use_exp'][$k]}',
sh_limit = '{$_POST['sh_limit'][$k]}',
sh_qty = '{$_POST['sh_qty'][$k]}',
sh_use_money = '{$_POST['sh_use_money'][$k]}',
sh_use_exp = '{$_POST['sh_use_exp'][$k]}',
sh_use_has_title = '{$_POST['sh_use_has_title'][$k]}',
sh_use_has_item = '{$_POST['sh_use_has_item'][$k]}',
sh_has_item_count = '{$_POST['sh_has_item_count'][$k]}',
sh_order = '{$_POST['sh_order'][$k]}'
WHERE sh_id = '{$_POST['sh_id'][$k]}' ";
sql_query($sql);
}
} else if ($_POST['act_button'] == "선택삭제") {
auth_check($auth[$sub_menu], 'd');
check_token();
for ($i=0; $i<count($_POST['chk']); $i++) {
$k = $_POST['chk'][$i];
$temp_sh_id = trim($_POST['sh_id'][$k]);
if (!$temp_sh_id) { return; }
sql_query(" delete from {$g5['shop_table']} where sh_id = '{$temp_sh_id}'");
}
}

View file

@ -1,5 +1,8 @@
<?php
$sub_menu = "400200";
/**
* @var string|int $s_side
* @var string|int $s_class
*/
include_once "./_common.php";
auth_check($auth[$sub_menu], 'r');
@ -321,7 +324,5 @@ if ($profile['ad_use_rank']) {
return true;
}
</script>
<?php
include_once "./admin.tail.php";
?>