"; echo ""; } else { // gd 버전에 따라 if (function_exists("imagecopyresampled")) { // 이미지(소) 생성 $dst = imagecreatetruecolor($default[de_simg_width], $default[de_simg_height]); imagecopyresampled($dst, $src, 0, 0, 0, 0, $default[de_simg_width], $default[de_simg_height], $size[0], $size[1]); } else { // 이미지(소) 생성 $dst = imagecreate($default[de_simg_width], $default[de_simg_height]); imagecopyresized($dst, $src, 0, 0, 0, 0, $default[de_simg_width], $default[de_simg_height], $size[0], $size[1]); } imagejpeg($dst, "$g4[path]/data/item/$it_id"."_s", 90); if (function_exists("imagecopyresampled")) { // 이미지(중) 생성 $dst = imagecreatetruecolor($default[de_mimg_width], $default[de_mimg_height]); imagecopyresampled($dst, $src, 0, 0, 0, 0, $default[de_mimg_width], $default[de_mimg_height], $size[0], $size[1]); } else { // 이미지(중) 생성 $dst = imagecreate($default[de_mimg_width], $default[de_mimg_height]); imagecopyresized($dst, $src, 0, 0, 0, 0, $default[de_mimg_width], $default[de_mimg_height], $size[0], $size[1]); } @imagejpeg($dst, "$g4[path]/data/item/$it_id"."_m", 90); } } if ($w == "" || $w == "u") { // 다음 입력을 위해서 옵션값을 쿠키로 한달동안 저장함 //@setcookie("ck_ca_id", $ca_id, time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]); //@setcookie("ck_maker", stripslashes($it_maker), time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]); //@setcookie("ck_origin", stripslashes($it_origin), time() + 86400*31, $default[de_cookie_dir], $default[de_cookie_domain]); @set_cookie("ck_ca_id", $ca_id, time() + 86400*31); @set_cookie("ck_ca_id2", $ca_id2, time() + 86400*31); @set_cookie("ck_ca_id3", $ca_id3, time() + 86400*31); @set_cookie("ck_maker", stripslashes($it_maker), time() + 86400*31); @set_cookie("ck_origin", stripslashes($it_origin), time() + 86400*31); } // 관련상품을 우선 삭제함 sql_query(" delete from $g4[yc4_item_relation_table] where it_id = '$it_id' "); // 관련상품의 반대도 삭제 sql_query(" delete from $g4[yc4_item_relation_table] where it_id2 = '$it_id' "); // 이벤트상품을 우선 삭제함 sql_query(" delete from $g4[yc4_event_item_table] where it_id = '$it_id' "); // 개별배송비처리 if($default['de_send_cost_case'] == "개별배송") { if($it_sc_type == 3) { // 수량별 $itcount = (int)preg_replace("/[^0-9]/", "", $_POST['it_count']); if(!$itcount) { alert('반복수량을 입력해 주세요.'); } $condition = $itcount; } else if($it_sc_type == 1) { // 조건부무료 $itminimum = (int)preg_replace("/[^0-9]/", "", $_POST['it_minimum']); if(!$itminimum) { alert('구매합계 금액을 입력해 주세요.'); } $condition = $itminimum; } else { $condition = 0; } $it_sc_basic = preg_replace("/[^0-9]/", "", $it_sc_basic); if($it_sc_type && !$it_sc_basic) { alert('기본배송비를 입력해 주세요.'); } } $sql_common = " ca_id = '$ca_id', ca_id2 = '$ca_id2', ca_id3 = '$ca_id3', it_name = '$it_name', it_gallery = '$it_gallery', it_maker = '$it_maker', it_origin = '$it_origin', it_brand = '$it_brand', it_model = '$it_model', it_option_use = '$it_option_use', it_opt1_subject = '$it_opt1_subject', it_opt2_subject = '$it_opt2_subject', it_opt3_subject = '$it_opt3_subject', it_opt4_subject = '$it_opt4_subject', it_opt5_subject = '$it_opt5_subject', it_opt6_subject = '$it_opt6_subject', it_opt1 = '$it_opt1', it_opt2 = '$it_opt2', it_opt3 = '$it_opt3', it_opt4 = '$it_opt4', it_opt5 = '$it_opt5', it_opt6 = '$it_opt6', it_supplement_use = '$it_supplement_use', it_type1 = '$it_type1', it_type2 = '$it_type2', it_type3 = '$it_type3', it_type4 = '$it_type4', it_type5 = '$it_type5', it_basic = '$it_basic', it_explan = '$it_explan', it_explan_html = '$it_explan_html', it_notax = '$it_notax', it_cust_amount = '$it_cust_amount', it_amount = '$it_amount', it_amount2 = '$it_amount2', it_amount3 = '$it_amount3', it_point = '$it_point', it_sell_email = '$it_sell_email', it_use = '$it_use', it_stock_qty = '$it_stock_qty', it_nocoupon = '$it_nocoupon', it_sc_type = '$it_sc_type', it_sc_method = '$it_sc_method', it_sc_basic = '$it_sc_basic', it_sc_condition = '$condition', it_head_html = '$it_head_html', it_tail_html = '$it_tail_html', it_time = '$g4[time_ymdhis]', it_ip = '$_SERVER[REMOTE_ADDR]', it_order = '$it_order', it_tel_inq = '$it_tel_inq' "; if ($w == "") { if (!trim($it_id)) { alert("상품 코드가 없으므로 상품을 추가하실 수 없습니다."); } $sql = " insert $g4[yc4_item_table] set it_id = '$it_id', $sql_common "; sql_query($sql); // 상품등록시 등록된 선택옵션의 it_id 가 변경됐을 경우 처리 if($it_option_use) { $op_item_code = get_session('ss_op_item_code'); if($it_id != $op_item_code) { $sql = " update {$g4['yc4_option_table']} set it_id = '$it_id' where it_id = '$op_item_code' "; sql_query($sql); } } // 상품등록시 등록된 추가옵션의 it_id 가 변경됐을 경우 처리 if($it_supplement_use) { $sp_item_code = get_session('ss_sp_item_code'); if($it_id != $sp_item_code) { $sql = " update {$g4['yc4_supplement_table']} set it_id = '$it_id' where it_id = '$sp_item_code' "; sql_query($sql); } } unset($_SESSION['ss_op_item_code']); unset($_SESSION['ss_sp_item_code']); } else if ($w == "u") { $sql = " update $g4[yc4_item_table] set $sql_common where it_id = '$it_id' "; sql_query($sql); // 선택옵션정보 삭제 if(!$it_option_use) { $sql = " delete from {$g4['yc4_option_table']} where it_id = '$it_id' "; sql_query($sql); } // 추가옵션정보 삭제 if(!$it_supplement_use) { $sql = " delete from {$g4['yc4_supplement_table']} where it_id = '$it_id' "; sql_query($sql); } } else if ($w == "d") { if ($is_admin != 'super') { $sql = " select it_id from $g4[yc4_item_table] a, $g4[yc4_category_table] b where a.it_id = '$it_id' and a.ca_id = b.ca_id and b.ca_mb_id = '$member[mb_id]' "; $row = sql_fetch($sql); if (!$row[it_id]) alert("\'{$member[mb_id]}\' 님께서 삭제 할 권한이 없는 상품입니다."); } itemdelete($it_id); } if ($w == "" || $w == "u") { // 관련상품 등록 $it_id2 = explode(",", $it_list); for ($i=0; $i"; ?>