} $pt_partner = $pt_partner ? 1 : 0; $pt_marketer = $pt_marketer ? 1 : 0; $pt_hp = preg_replace('/[^0-9\\-]/', '', strip_tags($pt_hp)); $pt_email = get_email_address($pt_email); if (!$pt_email) { alert('이메일을 입력하세요.'); } if (!preg_match("/([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\\.([0-9a-zA-Z_-]+)/", $pt_email)) { alert('이메일 주소가 형식에 맞지 않습니다.'); } if (empty($_POST)) { alert("파일 또는 글내용의 크기가 서버에서 설정한 값을 넘어 오류가 발생하였습니다.\\npost_max_size=" . ini_get('post_max_size') . " , upload_max_filesize=" . ini_get('upload_max_filesize') . "\\n게시판관리자 또는 서버관리자에게 문의 바랍니다."); } //파일등록 $file_upload_msg = apms_upload_file('partner', $member['mb_id']); if ($file_upload_msg) { alert($file_upload_msg, G5_URL); } else { //자동등록 $pt_register = $apms['apms_register'] ? date("Ymd") : ''; //정보등록 $sql = " insert into {$g5['apms_partner']}\n\t\t\t\tset pt_id = '{$member['mb_id']}',\n\t\t\t\t\tpt_partner = '{$pt_partner}',\n\t\t\t\t\tpt_marketer = '{$pt_marketer}',\n\t\t\t\t\tpt_type = '{$pt_type}',\n\t\t\t\t\tpt_register = '{$pt_register}',\n\t\t\t\t\tpt_datetime = '" . G5_TIME_YMDHIS . "',\n\t\t\t\t\tpt_name = '{$pt_name}',\n\t\t\t\t\tpt_hp = '{$pt_hp}',\n\t\t\t\t\tpt_email = '{$pt_email}' "; sql_query($sql); // 파트너 신청 알림쪽지 발송 $msg = $member['mb_nick'] . '(' . $member['mb_id'] . ')님이 파트너 등록을 신청하셨습니다.'; $mb_list = $config['cf_admin'] . ',' . $config['as_admin']; $mb = array_unique(explode(",", $mb_list)); for ($i = 0; $i < count($mb); $i++) { $tmp_row = sql_fetch(" select max(me_id) as max_me_id from {$g5['memo_table']} "); $me_id = $tmp_row['max_me_id'] + 1;
$comma = ' , '; } sql_query($sql); } // APMS : 태그 및 파일 등록 - 2014.07.20 $file_upload_msg = ''; if ($w == "" || $w == "u") { // 태그등록 $it_time = G5_TIME_YMDHIS; if ($w == "u") { $row = sql_fetch("select it_time from {$g5['g5_shop_item_table']} where it_id = '{$it_id}' "); $it_time = $row['it_time']; } apms_add_tag($it_id, $pt_tag, $it_time); // 파일등록 $file_upload_msg = apms_upload_file('item', $it_id); // 네이버 신디 if ($is_admin == 'super' && $it_use && $pt_syndi) { apms_naver_syndi_ping($it_id); } } // 동일 분류내 상품 동일 옵션 적용 $ca_fields = ''; if (is_checked('chk_ca_it_skin')) { $ca_fields .= " , it_skin = '{$it_skin}' "; } if (is_checked('chk_ca_it_mobile_skin')) { $ca_fields .= " , it_mobile_skin = '{$it_mobile_skin}' "; } if (is_checked('chk_ca_it_basic')) { $ca_fields .= " , it_basic = '{$it_basic}' ";
sql_query(" update {$g5['member_table']} set as_partner = '0', as_marketer = '0' where mb_id = '{$pt_id}' ", false); //이동하기 goto_url('./apms.admin.php?ap=plist&' . $qstr); } //업데이트 $sql = " update {$g5['apms_partner']}\n set pt_type\t\t\t\t\t= '{$_POST['pt_type']}'\n\t\t\t\t\t, pt_register\t\t\t= '{$_POST['pt_register']}'\n\t\t\t\t\t, pt_leave\t\t\t\t= '{$_POST['pt_leave']}'\n\t\t\t\t\t, pt_name\t\t\t\t= '{$_POST['pt_name']}'\n\t\t\t\t\t, pt_hp\t\t\t\t\t= '{$_POST['pt_hp']}'\n\t\t\t\t\t, pt_email\t\t\t\t= '{$_POST['pt_email']}'\n\t\t\t\t\t, pt_partner\t\t\t= '{$_POST['pt_partner']}'\n\t\t\t\t\t, pt_marketer\t\t\t= '{$_POST['pt_marketer']}'\n\t\t\t\t\t, pt_company\t\t\t= '{$_POST['pt_company']}'\n\t\t\t\t\t, pt_company_name\t\t= '{$_POST['pt_company_name']}'\n\t\t\t\t\t, pt_company_president\t= '{$_POST['pt_company_president']}'\n\t\t\t\t\t, pt_company_saupja\t\t= '{$_POST['pt_company_saupja']}'\n\t\t\t\t\t, pt_company_addr\t\t= '{$_POST['pt_company_addr']}'\n\t\t\t\t\t, pt_company_type\t\t= '{$_POST['pt_company_type']}'\n\t\t\t\t\t, pt_company_item\t\t= '{$_POST['pt_company_item']}'\n\t\t\t\t\t, pt_bank_name\t\t\t= '{$_POST['pt_bank_name']}'\n\t\t\t\t\t, pt_bank_account\t\t= '{$_POST['pt_bank_account']}'\n\t\t\t\t\t, pt_bank_holder\t\t= '{$_POST['pt_bank_holder']}'\n\t\t\t\t\t, pt_bank_limit\t\t\t= '{$_POST['pt_bank_limit']}'\n\t\t\t\t\t, pt_flag\t\t\t\t= '{$_POST['pt_flag']}'\n\t\t\t\t\t, pt_point\t\t\t\t= '{$_POST['pt_point']}'\n\t\t\t\t\t, pt_benefit\t\t\t= '{$_POST['pt_benefit']}'\n\t\t\t\t\t, pt_level\t\t\t\t= '{$_POST['pt_level']}'\n\t\t\t\t\t, pt_limit\t\t\t\t= '{$_POST['pt_limit']}'\n\t\t\t\t\t, pt_commission_1\t\t= '{$_POST['pt_commission_1']}'\n\t\t\t\t\t, pt_commission_2\t\t= '{$_POST['pt_commission_2']}'\n\t\t\t\t\t, pt_commission_3\t\t= '{$_POST['pt_commission_3']}'\n\t\t\t\t\t, pt_commission_4\t\t= '{$_POST['pt_commission_4']}'\n\t\t\t\t\t, pt_commission_5\t\t= '{$_POST['pt_commission_5']}'\n\t\t\t\t\t, pt_incentive_1\t\t= '{$_POST['pt_incentive_1']}'\n\t\t\t\t\t, pt_incentive_2\t\t= '{$_POST['pt_incentive_2']}'\n\t\t\t\t\t, pt_incentive_3\t\t= '{$_POST['pt_incentive_3']}'\n\t\t\t\t\t, pt_incentive_4\t\t= '{$_POST['pt_incentive_4']}'\n\t\t\t\t\t, pt_incentive_5\t\t= '{$_POST['pt_incentive_5']}'\n\t\t\t\t\t, pt_memo\t\t\t\t= '{$_POST['pt_memo']}'\n\t\t\t\t\t, pt_1\t\t\t\t\t= '{$_POST['pt_1']}'\n\t\t\t\t\t, pt_2\t\t\t\t\t= '{$_POST['pt_2']}'\n\t\t\t\t\t, pt_3\t\t\t\t\t= '{$_POST['pt_3']}'\n\t\t\t\t\t, pt_4\t\t\t\t\t= '{$_POST['pt_4']}'\n\t\t\t\t\t, pt_5\t\t\t\t\t= '{$_POST['pt_5']}'\n\t\t\t\t\t, pt_6\t\t\t\t\t= '{$_POST['pt_6']}'\n\t\t\t\t\t, pt_7\t\t\t\t\t= '{$_POST['pt_7']}'\n\t\t\t\t\t, pt_8\t\t\t\t\t= '{$_POST['pt_8']}'\n\t\t\t\t\t, pt_9\t\t\t\t\t= '{$_POST['pt_9']}'\n\t\t\t\t\t, pt_10\t\t\t\t\t= '{$_POST['pt_10']}'\n\t\t\t\twhere pt_id\t\t\t\t\t= '{$pt_id}' "; sql_query($sql); if ($_POST['pt_register']) { // 승인정보가 있을 경우 sql_query(" update {$g5['member_table']} set as_partner = '{$_POST['pt_partner']}', as_marketer = '{$_POST['pt_marketer']}' where mb_id = '{$pt_id}' ", false); } else { // 없다면 sql_query(" update {$g5['member_table']} set as_partner = '0', as_marketer = '0' where mb_id = '{$pt_id}' ", false); } //파일등록 $file_upload_msg = apms_upload_file('partner', $pt_id); $go_url = $go_url . '&' . $qstr . '&pt_id=' . $pt_id; if ($file_upload_msg) { alert($file_upload_msg, $go_url); } else { goto_url($go_url); } } $token = get_token(); $mb['pt_name'] = get_text($mb['pt_name']); $mb['pt_email'] = get_text($mb['pt_email']); $mb['pt_hp'] = get_text($mb['pt_hp']); $mb['pt_company_name'] = get_text($mb['pt_company_name']); $mb['pt_company_president'] = get_text($mb['pt_company_president']); $mb['pt_company_saupja'] = get_text($mb['pt_company_saupja']); $mb['pt_company_addr'] = get_text($mb['pt_company_addr']);