99))
alert("포인트 비율을 0과 99 사이의 값으로 입력해 주십시오.");
// 관련상품을 우선 삭제함
sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id = '$it_id' ");
// 관련상품의 반대도 삭제
sql_query(" delete from {$g5['g5_shop_item_relation_table']} where it_id2 = '$it_id' ");
// 이벤트상품을 우선 삭제함
sql_query(" delete from {$g5['g5_shop_event_item_table']} where it_id = '$it_id' ");
// 선택옵션
sql_query(" delete from {$g5['g5_shop_item_option_table']} where io_type = '0' and it_id = '$it_id' "); // 기존선택옵션삭제
$option_count = (isset($_POST['opt_id']) && is_array($_POST['opt_id'])) ? count($_POST['opt_id']) : array();
$it_option_subject = '';
$it_supply_subject = '';
if($option_count) {
// 옵션명
$opt1_cnt = $opt2_cnt = $opt3_cnt = 0;
for($i=0; $i<$option_count; $i++) {
$post_opt_id = isset($_POST['opt_id'][$i]) ? preg_replace(G5_OPTION_ID_FILTER, '', strip_tags($_POST['opt_id'][$i])) : '';
$opt_val = explode(chr(30), $post_opt_id);
if(isset($opt_val[0]) && $opt_val[0])
$opt1_cnt++;
if(isset($opt_val[1]) && $opt_val[1])
$opt2_cnt++;
if(isset($opt_val[2]) && $opt_val[2])
$opt3_cnt++;
}
if($opt1_subject && $opt1_cnt) {
$it_option_subject = $opt1_subject;
if($opt2_subject && $opt2_cnt)
$it_option_subject .= ','.$opt2_subject;
if($opt3_subject && $opt3_cnt)
$it_option_subject .= ','.$opt3_subject;
}
}
// 추가옵션
sql_query(" delete from {$g5['g5_shop_item_option_table']} where io_type = '1' and it_id = '$it_id' "); // 기존추가옵션삭제
$supply_count = (isset($_POST['spl_id']) && is_array($_POST['spl_id'])) ? count($_POST['spl_id']) : array();
if($supply_count) {
// 추가옵션명
$arr_spl = array();
for($i=0; $i<$supply_count; $i++) {
$post_spl_id = isset($_POST['spl_id'][$i]) ? preg_replace(G5_OPTION_ID_FILTER, '', strip_tags($_POST['spl_id'][$i])) : '';
$spl_val = explode(chr(30), $post_spl_id);
if(!in_array($spl_val[0], $arr_spl))
$arr_spl[] = $spl_val[0];
}
$it_supply_subject = implode(',', $arr_spl);
}
// 상품요약정보
$value_array = array();
$count_ii_article = (isset($_POST['ii_article']) && is_array($_POST['ii_article'])) ? count($_POST['ii_article']) : 0;
for($i=0; $i<$count_ii_article; $i++) {
$key = isset($_POST['ii_article'][$i]) ? strip_tags($_POST['ii_article'][$i], '
') : '';
$val = isset($_POST['ii_value'][$i]) ? strip_tags($_POST['ii_value'][$i], '
') : '';
$value_array[$key] = $val;
}
$it_info_value = addslashes(serialize($value_array));
$it_name = isset($_POST['it_name']) ? strip_tags(clean_xss_attributes(trim($_POST['it_name']))) : '';
// KVE-2019-0708
$check_sanitize_keys = array(
'it_order', // 출력순서
'it_maker', // 제조사
'it_origin', // 원산지
'it_brand', // 브랜드
'it_model', // 모델
'it_tel_inq', // 전화문의
'it_use', // 판매가능
'it_nocoupon', // 쿠폰적용안함
'ec_mall_pid', // 네이버쇼핑 상품ID
'it_sell_email', // 판매자 e-mail
'it_price', // 판매가격
'it_cust_price', // 시중가격
'it_point_type', // 포인트 유형
'it_point', // 포인트
'it_supply_point', // 추가옵션상품 포인트
'it_soldout', // 상품품절
'it_stock_sms', // 재입고SMS 알림
'it_stock_qty', // 재고수량
'it_noti_qty', // 재고 통보수량
'it_buy_min_qty', // 최소구매수량
'it_notax', // 상품과세 유형
'it_sc_type', // 배송비 유형
'it_sc_method', // 배송비 결제
'it_sc_price', // 기본배송비
'it_sc_minimum', // 배송비 상세조건
'it_type1', // 상품유형(히트)
'it_type2', // 상품유형(추천)
'it_type3', // 상품유형(신상품)
'it_type4', // 상품유형(인기)
'it_type5', // 상품유형(할인)
);
foreach( $check_sanitize_keys as $key ){
$$key = isset($_POST[$key]) ? strip_tags(clean_xss_attributes($_POST[$key])) : '';
}
$it_basic = preg_replace('#