- 쿠폰/희망배송일/검색어/계정/결제 콜백 등 입력값을 SQL 컨텍스트에 맞게 재처리 - dt_data·PG 응답 등 비-GPC 값과 소셜 provider 입력 정제 보완 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
87 lines
3.3 KiB
PHP
87 lines
3.3 KiB
PHP
<?php
|
|
$sub_menu = "900600";
|
|
include_once("./_common.php");
|
|
|
|
auth_check_menu($auth, $sub_menu, "w");
|
|
|
|
check_admin_token();
|
|
|
|
$fo_no = isset($_REQUEST['fo_no']) ? (int) $_REQUEST['fo_no'] : 0;
|
|
$fg_no = isset($_REQUEST['fg_no']) ? (int) $_REQUEST['fg_no'] : 0;
|
|
$fo_name = isset($_REQUEST['fo_name']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_REQUEST['fo_name'])))) : '';
|
|
$fo_content = isset($_REQUEST['fo_content']) ? addslashes(strip_tags(clean_xss_attributes(stripslashes($_REQUEST['fo_content'])))) : '';
|
|
$fo_receipt = isset($_REQUEST['fo_receipt']) ? clean_xss_tags($_REQUEST['fo_receipt'], 1, 1) : '';
|
|
$get_fg_no = '';
|
|
|
|
$g5['title'] = "이모티콘 업데이트";
|
|
|
|
if ($w == 'u') // 업데이트
|
|
{
|
|
if (!$fg_no) $fg_no = 0;
|
|
|
|
if (!$fo_receipt) $fo_receipt = 0; else $fo_receipt = 1;
|
|
|
|
if (!strlen(trim($fo_name)))
|
|
alert('이름을 입력해주세요');
|
|
|
|
if (!strlen(trim($fo_content)))
|
|
alert('이모티콘을 입력해주세요');
|
|
/*
|
|
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no<>'$fo_no' and fo_content='$fo_content'");
|
|
if ($res)
|
|
alert('같은 이모티콘이 존재합니다.');
|
|
*/
|
|
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no='$fo_no'");
|
|
if (!$res)
|
|
alert('존재하지 않는 데이터 입니다.');
|
|
|
|
if ($fg_no != $res['fg_no']) {
|
|
if ($res['fg_no'])
|
|
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count - 1 where fg_no='{$res['fg_no']}'");
|
|
|
|
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count + 1 where fg_no='$fg_no'");
|
|
}
|
|
|
|
$group = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no = '$fg_no'");
|
|
|
|
sql_query("update {$g5['sms5_form_table']} set fg_no='$fg_no', fg_member='{$group['fg_member']}', fo_name='$fo_name', fo_content='$fo_content', fo_datetime='".G5_TIME_YMDHIS."' where fo_no='$fo_no'");
|
|
}
|
|
else if ($w == 'd') // 삭제
|
|
{
|
|
if (!is_numeric($fo_no))
|
|
alert('고유번호가 없습니다.');
|
|
|
|
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_no='$fo_no'");
|
|
if (!$res)
|
|
alert('존재하지 않는 데이터 입니다.');
|
|
|
|
sql_query("delete from {$g5['sms5_form_table']} where fo_no='$fo_no'");
|
|
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count - 1 where fg_no = '{$res['fg_no']}'");
|
|
|
|
$get_fg_no = $fg_no;
|
|
}
|
|
else // 등록
|
|
{
|
|
if (!$fg_no) $fg_no = 0;
|
|
|
|
if (!strlen(trim($fo_name)))
|
|
alert('이름을 입력해주세요');
|
|
|
|
if (!strlen(trim($fo_content)))
|
|
alert('이모티콘을 입력해주세요');
|
|
|
|
$res = sql_fetch("select * from {$g5['sms5_form_table']} where fo_content='$fo_content'");
|
|
if ($res)
|
|
alert('같은 이모티콘이 존재합니다.');
|
|
|
|
$group = sql_fetch("select * from {$g5['sms5_form_group_table']} where fg_no = '$fg_no'");
|
|
|
|
sql_query("insert into {$g5['sms5_form_table']} set fg_no='$fg_no', fg_member='{$group['fg_member']}', fo_name='$fo_name', fo_content='$fo_content', fo_datetime='".G5_TIME_YMDHIS."'");
|
|
sql_query("update {$g5['sms5_form_group_table']} set fg_count = fg_count + 1 where fg_no = '$fg_no'");
|
|
|
|
$get_fg_no = $fg_no;
|
|
}
|
|
|
|
$go_url = './form_list.php?page='.$page.'&fg_no='.$get_fg_no;
|
|
goto_url($go_url);
|