alert(\"$msg\"); history.back(); "; } function Page_Msg($msg) { echo ""; } function Page_Url($url) { echo ""; } function Page_Msg_Url($msg, $url) { echo ""; } function replace_in_se($string){ if ($string){ $string = str_replace("sp_","",$string); $string = str_replace("xp_","",$string); $string = str_replace("","",$string); $string = str_replace("'","\'",$string); } return $string; } function replace_out_se($string){ if ($string){ $string = str_replace("\'","'",$string); $string = str_replace("\\\'","'",$string); $string=stripslashes($string); } return $string; } function replace_out($string){ if ($string){ $string = str_replace("\'","'",$string); $string = str_replace("\\\'","'",$string); $string=nl2br($string); $string=stripslashes($string); } return $string; } // 세션변수값 지정 function set_session($session_name, $value) { $_SESSION["$session_name"] = $value; } // 세션변수값 얻음 function get_session($session_name) { return $_SESSION[$session_name]; } //페이지 이동시 기본 변수 function getAdmParams($FPOST){ $ad_params = ""; return $ad_params; } //년도로 나이계산 function getAge($birth_year_month_day){ $birth_year = substr($birth_year_month_day, 0, 4); $current_year = date('Y'); $age = $current_year - $birth_year; return $age; } //숫자로 요일 계산 function getDayTxt($day_txt) { $dayOfWeek = ["일", "월", "화", "수", "목", "금", "토"]; $parts = explode("_", $day_txt); $days = []; foreach ($parts as $part) { $dayIndex = intval($part); if ($dayIndex >= 0 && $dayIndex <= 6) { // 인덱스 0부터 6까지가 일요일부터 토요일 $days[] = $dayOfWeek[$dayIndex]; } } if (count($days) > 0) { $daysList = implode(', ', $days); return $daysList; } } ////////////////////////////////////////////// // 공통코드 불러오는 함수 // getCodeCom('apply_cms_amt') // 2017-12-02 By gayoung ////////////////////////////////////////////// function getCodeCom($objCode){ $com_code['coupon_state'] = array('1' => '사용', '2' => '미사용'); $com_code['use_yn'] = array('Y' => 'Y', 'N' => 'N'); $com_code['useYN'] = array('Y' => '사용', 'N' => '미사용'); $com_code['out_YN'] = array('Y' => '출고', 'N' => '미출고'); return $com_code[$objCode]; } ////////////////////////////////////////////// // 라디오버튼 공통 함수 // radioBoxCommon('10', 'ra_age', 'apply_age') // 2017-12-22 By gayoung ////////////////////////////////////////////// function radioBoxCommon($selectVal, $objName, $arrCode){ $noArry = getCodeCom($arrCode); $html_txt = ""; $i = 0; foreach($noArry as $code=>$name){ $chkval = ""; if($selectVal != '' && $selectVal == $code ) $chkval = "checked"; $html_txt .= " "; $i++; } return $html_txt; } //타임스템프(밀리세컨드까지) function FN_get_timestamp(){ list($microtime, $tStamp) = explode(' ',microtime()); $timestamp = $tStamp . substr($microtime, 2, 3); return $timestamp; } //전화번호 하이픈 넣기 function format_phone($phone){ $phone = preg_replace("/[^0-9]/", "", $phone); $length = strlen($phone); switch($length){ case 11 : return preg_replace("/([0-9]{3})([0-9]{4})([0-9]{4})/", "$1-$2-$3", $phone); break; case 10: return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "$1-$2-$3", $phone); break; default : return $phone; break; } } //랜덤숫자문자 얻기 function RndomNum($cnt) { $ran= ""; for( $i=0; $i<$cnt; $i++) //7자리만 출력 { if( strlen($ran)<$cnt ) $ran .= rand( 0, 9 ); //숫자 } return $ran; } /* * 랜덤 문자열 생성(인수 : 길이, 타입) * 지정된 타입의 문자열로 지정된 길이의 랜덤 문자열을 반환한다. * 타입 0 : 영문 대소문자(A-Z,a-z), 숫자(0-9) * 타입 1 : 영문 대문자(A-Z), 숫자(0-9) * 타입 2 : 영문 소문자(a-z), 숫자(0-9) * 타입 3 : 영문 대문자(A-Z) * 타입 4 : 영문 소문자(a-z) * 타입 5 : 숫자(0-9) * 디폴트 : false 반환. */ function rand_str($length, $type) { switch($type){ case 0: $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'; break; case 1: $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; break; case 2: $chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; break; case 3: $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; break; case 4: $chars = 'abcdefghijklmnopqrstuvwxyz'; break; case 5: $chars = '1234567890'; break; default: return false; } $chars_length = (strlen($chars) - 1); $string = ''; for ($i = 0; $i < $length; $i = strlen($string)){ $string .= $chars[rand(0, $chars_length)]; } return $string; } Function get_noimg($file_path,$img,$noimg){ If (!$img) { $get_noimg = $noimg; } Else { if(file_exists($_SERVER["DOCUMENT_ROOT"].$file_path.$img)){ $get_noimg = $file_path.$img; }else{ $get_noimg = $noimg; } } return $get_noimg; } function get_arr($no,$bet){ $get_arr=$bet; if($no){ for($i=0; $i "서울", "부산광역시" => "부산", "대구광역시" => "대구", "인천광역시" => "인천", "광주광역시" => "광주", "대전광역시" => "대전", "울산광역시" => "울산", "세종특별자치시" => "세종", "경기도" => "경기", "강원도" => "강원", "충청북도" => "충북", "충청남도" => "충남", "전라북도" => "전북", "전라남도" => "전남", "경상북도" => "경북", "경상남도" => "경남", "제주특별자치도" => "제주" ]; $kakao = $map[$name] ?? $name; return $kakao; // 전체명 = $name, 축약명 = $kakao //return " and ( {$field} like '{$name}%' OR {$field} like '{$kakao}%' )"; } function getSidoGugun($addr) { $parts = explode(" ", trim($addr)); if (count($parts) >= 2) { return $parts[0] . " " . $parts[1]; } return $addr; // 주소 형식이 이상할 때는 원본 반환 } function p($arr){ echo "
";
	print_r($arr);
	echo "
"; } //OS접속 정보 function getDeviceInfo() { $userAgent = $_SERVER['HTTP_USER_AGENT']; $os = "Unknown OS"; $deviceType = "Unknown Device"; // 운영 체제 정보 추출 if (preg_match('/Win/i', $userAgent)) { $os = "Windows"; } elseif (preg_match('/Mac/i', $userAgent)) { $os = "MacOS"; } elseif (preg_match('/Linux/i', $userAgent)) { $os = "Linux"; } elseif (preg_match('/Android/i', $userAgent)) { $os = "Android"; } elseif (preg_match('/iPhone|iPad|iPod/i', $userAgent)) { $os = "iOS"; } // 기기 유형 추출 if (preg_match('/Mobi|Android/i', $userAgent)) { $deviceType = "Mobile"; } elseif (preg_match('/Tablet/i', $userAgent)) { $deviceType = "Tablet"; } else { $deviceType = "Desktop"; } return ['os' => $os, 'deviceType' => $deviceType]; } ?>getMessage(); return; } } function QRY_CNT($tbl,$searchand){ $pdo = dbconn(); $sql = "SELECT COUNT(*) AS CNT FROM $tbl WHERE 1=1 $searchand"; $stmt = $pdo->prepare($sql); $stmt->execute(); $cnt_row = $stmt->fetch(PDO::FETCH_ASSOC); //레코드 수 카운팅 $cnt = $cnt_row['CNT']; return $cnt; } function QRY_CNT_ECHO($tbl,$searchand){ $pdo = dbconn(); $sql = "SELECT COUNT(*) AS CNT FROM $tbl WHERE 1=1 $searchand"; echo $sql; $stmt = $pdo->prepare($sql); $stmt->execute(); $cnt_row = $stmt->fetch(PDO::FETCH_ASSOC); //레코드 수 카운팅 $cnt = $cnt_row['CNT']; return $cnt; } function QRY_MAX($tbl,$searchand,$item){ $pdo = dbconn(); $sql = "SELECT MAX($item) AS MAX FROM $tbl WHERE 1=1 $searchand"; $stmt = $pdo->prepare($sql); $stmt->execute(); $cnt_row = $stmt->fetch(PDO::FETCH_ASSOC); //레코드 수 카운팅 $cnt = $cnt_row['MAX']; return $cnt; } function QRY_VIEW($tbl,$searchand){ $pdo = dbconn(); $sql = "select * from $tbl where 1 = 1 $searchand"; $stmt = $pdo->prepare($sql); $stmt->execute(); $row = $stmt->fetch(); return $row; } function QRY_VIEW_ECHO($tbl,$searchand){ $pdo = dbconn(); $sql = "select * from $tbl where 1 = 1 $searchand"; echo $sql; } function getQueryItem($table, $where, $getId){ $pdo = dbconn(); $sql = "select $getId as want from $table where 1 = 1 $where limit 0, 1"; $stmt = $pdo->prepare($sql); $stmt->execute(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); $cnt = $stmt->rowCount(); $rowVal = ""; if($cnt > 0){ $rowVal = $row["want"]; } return $rowVal; } function getQueryItemECHO($table, $where, $getId){ $pdo = dbconn(); $sql = "select $getId as want from $table where 1 = 1 $where limit 0, 1"; echo $sql; $stmt = $pdo->prepare($sql); $stmt->execute(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); $cnt = $stmt->rowCount(); $rowVal = ""; if($cnt > 0){ $rowVal = $row["want"]; } return $rowVal; } function comQueryResult($sql){ $pdo = dbconn(); $stmt = $pdo->prepare($sql); $stmt->execute(); $rsData = $stmt->fetchAll(); return $rsData; } function comArrayList($sql){ $pdo = dbconn(); try { $stmt = $pdo->prepare($sql); $stmt->execute(); $cnt = $stmt->rowCount(); $arrRow = $stmt->fetchall(PDO::FETCH_OBJ); //Object type return array($cnt, $arrRow); } catch (Exception $e) { //$this->SaveSqlLog('Error Data Select', $e->getMessage()); } } function QRY_TXT($sql) { $pdo = dbconn(); $stmt = $pdo->prepare($sql); $stmt->execute(); return $stmt->fetchAll(PDO::FETCH_OBJ); // ✅ 객체 형태로 반환 } function Get_Cols($tbl_name, $where, $fields = "*") //컬럼여러개 가능 { $pdo = dbconn(); $sql = "SELECT {$fields} FROM {$tbl_name} WHERE 1=1 {$where} LIMIT 1"; $stmt = $pdo->prepare($sql); $stmt->execute(); return $stmt->fetch(PDO::FETCH_OBJ); // 단일 행 반환 $item-> 이렇게 가능 } function Get_Cols_ECHO($tbl_name, $where, $fields = "*") //컬럼여러개 가능 { $pdo = dbconn(); $sql = "SELECT {$fields} FROM {$tbl_name} WHERE 1=1 {$where} LIMIT 1"; echo $sql; $stmt = $pdo->prepare($sql); $stmt->execute(); return $stmt->fetch(PDO::FETCH_OBJ); // 단일 행 반환 $item-> 이렇게 가능 } // 거래처 가격그룹 기준 납품단가 조회 // - 그룹단가가 없거나 0이면 goods 기본 supply_price 사용 function Get_SupplyPrice($goods_idx, $mem_idx = 0) { $goods_idx = (int)$goods_idx; $mem_idx = (int)$mem_idx; if ($goods_idx <= 0) { return 0; } $base_price = (int)getQueryItem("goods", " AND goods_idx = '{$goods_idx}' ", "IFNULL(supply_price, 0)"); if ($mem_idx <= 0) { return $base_price; } $price_group = trim((string)getQueryItem("member", " AND mem_idx = '{$mem_idx}' ", "price_group")); if ($price_group === '') { return $base_price; } $escaped_group = addslashes($price_group); $group_price = (int)getQueryItem( "goods_supply", " AND goods_idx = '{$goods_idx}' AND pirce_group_idx = '{$escaped_group}' AND IFNULL(supply_price, 0) > 0 ORDER BY supply_date DESC, gs_idx DESC ", "supply_price" ); if ($group_price > 0) { return $group_price; } return $base_price; } function QRY_TMP_IDX($tableName){ $threis = getQueryItem("tempIdx", " and tableName='".$tableName."'", "tempIdx"); if(!$threis){ //primary 컬럼 구하기 $conn = dbconn(); $stmt = $conn->prepare("SHOW KEYS FROM $tableName WHERE Key_name = 'PRIMARY'"); $stmt->execute(); $primary_key_info = $stmt->fetch(PDO::FETCH_ASSOC); if ($primary_key_info) { $primary_key_column = $primary_key_info["Column_name"]; } $max_idx = QRY_MAX($tableName," ",$primary_key_column); $sql = "INSERT INTO tempIdx SET tempIdx = '$max_idx' , tableName = '$tableName'"; comQueryResult($sql); } $max = QRY_MAX("tempIdx"," and tableName='".$tableName."'","tempIdx"); $max++; $sql = "UPDATE tempIdx SET tempIdx = $max WHERE tableName = '$tableName'"; comQueryResult($sql); return $max; } /********************************************** 호출방법 :: $order_query = selectRow("all",$page," sc_ord asc"); *******************************************/ function selectRow($cnt,$page,$ord){ $startno = ($page-1) * $cnt; if($cnt!="all"){ $limit = "LIMIT $startno,$cnt "; } $sql = " order by $ord $limit"; return $sql; } function QRY_TOTALPAGE($cnt,$recordcnt){ $total_page = (int)($cnt%$recordcnt); if ($total_page != 0){ $totalpage = (int)($cnt/$recordcnt)+1; } else { $totalpage = (int)($cnt/$recordcnt); } return $totalpage; } function GetUpdate($table, $where, $col){ $pdo = dbconn(); $sql = "UPDATE $table SET $col WHERE 1=1 $where"; $stmt = $pdo->prepare($sql); $stmt->execute(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); $cnt = $stmt->rowCount(); $rowVal = ""; if($cnt > 0){ $rowVal = $row[$getId]; } return $rowVal; } function GetUpdateECHO($table, $where, $col){ $pdo = dbconn(); $sql = "UPDATE $table SET $col WHERE 1=1 $where"; echo $sql; } function GetInsert($table, $col, $val){ $pdo = dbconn(); $sql = "INSERT INTO $table ($col) VALUES($val)"; $stmt = $pdo->prepare($sql); $stmt->execute(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); $cnt = $stmt->rowCount(); $rowVal = ""; if($cnt > 0){ $rowVal = $row[$getId]; } return $rowVal; } function GetInsertSet($table, $col){ $pdo = dbconn(); $sql = "INSERT INTO $table SET $col"; $stmt = $pdo->prepare($sql); $stmt->execute(); $row = $stmt->fetch(\PDO::FETCH_ASSOC); $cnt = $stmt->rowCount(); $rowVal = ""; if($cnt > 0){ $rowVal = $row[$getId]; } return $rowVal; } function GetDelete($table, $where) { $pdo = dbconn(); // DB 연결 함수 (프로젝트 내부 정의돼 있어야 함) $sql = "DELETE FROM $table WHERE 1=1 $where"; $stmt = $pdo->prepare($sql); $result = $stmt->execute(); return $result; // 성공 시 true, 실패 시 false } /* 배송그룹 코드로 활성 배송설정을 조회한다. $input_delivery_code: 화면/요청으로 넘어온 배송그룹 코드 $fallback_delivery_code: input 코드가 없을 때 사용할 기본 배송그룹 코드 return array( 'delivery_code' => 최종 적용 코드, 'delivery_setting' => delivery_setting row(array) 또는 null ) */ function resolveActiveDeliverySetting($input_delivery_code = '', $fallback_delivery_code = '') { $input_delivery_code = trim((string)$input_delivery_code); $fallback_delivery_code = trim((string)$fallback_delivery_code); $delivery_code = ($input_delivery_code !== '') ? $input_delivery_code : $fallback_delivery_code; if ($delivery_code === '') { return array( 'delivery_code' => '', 'delivery_setting' => null ); } if (strtolower($delivery_code) === 'direct') { return array( 'delivery_code' => 'direct', 'delivery_name' => '직접배송', 'delivery_setting' => array( 'deliv_code' => 'direct', 'deliv_name' => '직접배송', 'standard_type' => '', 'remit_price' => 0, 'remit_ea' => 0, 'deliv_price' => 0 ) ); } $pdo = dbconn(); $sql = "SELECT deliv_code, deliv_name, standard_type, remit_price, remit_ea, deliv_price FROM delivery_setting WHERE deliv_code = :delivery_code AND LOWER(IFNULL(deliv_use_yn, 'y')) = 'y' LIMIT 1"; $stmt = $pdo->prepare($sql); $stmt->bindValue(':delivery_code', $delivery_code, PDO::PARAM_STR); $stmt->execute(); $delivery_setting = $stmt->fetch(PDO::FETCH_ASSOC); if (empty($delivery_setting)) { return array( 'delivery_code' => '', 'delivery_name' => '', 'delivery_setting' => null ); } return array( 'delivery_code' => $delivery_setting['deliv_code'] ?? '', 'delivery_name' => $delivery_setting['deliv_name'] ?? '', 'delivery_setting' => $delivery_setting ); } /* 택배그룹/설정 조회 + 배송비 계산을 함께 처리한다. $input_delivery_code: 화면/요청으로 넘어온 배송그룹 코드 $fallback_delivery_code: input 코드가 없을 때 사용할 기본 배송그룹 코드 $total_price: 주문 총 금액 $total_order_ea: 주문 총 수량 */ function calcDeliveryPriceBySetting($input_delivery_code = '', $fallback_delivery_code = '', $total_price = 0, $total_order_ea = 0) { $delivery_info = resolveActiveDeliverySetting($input_delivery_code, $fallback_delivery_code); $delivery_setting = $delivery_info['delivery_setting'] ?? null; $delivery_code = $delivery_info['delivery_code'] ?? ''; $delivery_name = $delivery_info['delivery_name'] ?? ''; $delivery_price = 0; if (empty($delivery_setting)) { return array( 'delivery_code' => '', 'delivery_name' => '', 'delivery_price' => 0, 'delivery_setting' => null ); } if (is_object($delivery_setting)) { $delivery_setting = (array)$delivery_setting; } $standard_type = strtolower(trim((string)($delivery_setting['standard_type'] ?? ''))); if ($standard_type === '') { $standard_type = ((int)($delivery_setting['remit_price'] ?? 0) > 0) ? 'price' : 'ea'; } $base_deliv_price = (int)($delivery_setting['deliv_price'] ?? 0); $remit_price = (int)($delivery_setting['remit_price'] ?? 0); $remit_ea = (int)($delivery_setting['remit_ea'] ?? 0); if ($standard_type === 'price') { $delivery_price = ((int)$total_price < $remit_price) ? $base_deliv_price : 0; } else if ($standard_type === 'ea') { $delivery_price = ((int)$total_order_ea < $remit_ea) ? $base_deliv_price : 0; } return array( 'delivery_code' => $delivery_code, 'delivery_name' => $delivery_name, 'delivery_price' => (int)$delivery_price, 'delivery_setting' => $delivery_setting ); } /* 상품 기준 택배비 계산 적용 우선순위 1. 판매브랜드 면제 2. 상품별 개별설정 3. 물류대행 기본값 */ function calcDeliveryPriceByGoodsItems($items, $input_delivery_code = '', $fallback_delivery_code = '', $brand_group = '') { $empty_result = array( 'delivery_code' => '', 'delivery_codes' => array(), 'delivery_name' => '', 'delivery_price' => 0, 'groups' => array(), 'item_delivery_codes' => array(), 'item_delivery_prices' => array(), 'free_brand' => false ); if (!is_array($items) || count($items) === 0) { return $empty_result; } $pdo = dbconn(); $brand_group = (int)$brand_group; if ($brand_group > 0) { $stmt = $pdo->prepare("SELECT 1 FROM delivery_free_brand WHERE brand_group = :brand_group LIMIT 1"); $stmt->bindValue(':brand_group', $brand_group, PDO::PARAM_INT); $stmt->execute(); if ($stmt->fetchColumn()) { $empty_result['free_brand'] = true; return $empty_result; } } $normalized_items = array(); $goods_ids = array(); foreach ($items as $item) { $row = is_object($item) ? (array)$item : $item; if (!is_array($row)) { continue; } $goods_idx = (int)($row['goods_idx'] ?? 0); if ($goods_idx <= 0) { continue; } $normalized_items[] = $row; $goods_ids[$goods_idx] = $goods_idx; } if (empty($goods_ids)) { return $empty_result; } $placeholders = implode(',', array_fill(0, count($goods_ids), '?')); $sql = "SELECT G.goods_idx, G.logistics_cate, G.goods_unit, F.box_remit_ea, F.box_deliv_price, F.unit_remit_ea, F.unit_deliv_price FROM goods G LEFT JOIN delivery_goods_fee F ON F.goods_idx = G.goods_idx WHERE G.goods_idx IN ({$placeholders})"; $stmt = $pdo->prepare($sql); $stmt->execute(array_values($goods_ids)); $goods_map = array(); $logistics_ids = array(); foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $goods_row) { $goods_idx = (int)$goods_row['goods_idx']; $goods_map[$goods_idx] = $goods_row; $logistics_cate = (int)($goods_row['logistics_cate'] ?? 0); if ($logistics_cate > 0) { $logistics_ids[$logistics_cate] = $logistics_cate; } } $logistics_map = array(); if (!empty($logistics_ids)) { $logistics_placeholders = implode(',', array_fill(0, count($logistics_ids), '?')); $stmt = $pdo->prepare("SELECT * FROM delivery_logistics_fee WHERE logistics_cate IN ({$logistics_placeholders})"); $stmt->execute(array_values($logistics_ids)); foreach ($stmt->fetchAll(PDO::FETCH_ASSOC) as $setting) { $logistics_map[(int)$setting['logistics_cate']] = $setting; } } $group_totals = array(); foreach ($normalized_items as $row) { $goods_idx = (int)$row['goods_idx']; if (!isset($goods_map[$goods_idx])) { continue; } $goods = $goods_map[$goods_idx]; $logistics_cate = (int)($goods['logistics_cate'] ?? 0); $logistics_setting = $logistics_map[$logistics_cate] ?? array(); $box_ea = 0; foreach (array('box_ea', 'cart_box_ea', 'delive_box_ea', 'deliv_box_ea') as $key) { if (isset($row[$key])) { $box_ea = max(0, (int)$row[$key]); break; } } $unit_ea = 0; foreach (array('unit_ea', 'cart_unit_ea', 'delive_unit_ea', 'deliv_unit_ea') as $key) { if (isset($row[$key])) { $unit_ea = max(0, (int)$row[$key]); break; } } if ($box_ea === 0 && $unit_ea === 0) { $order_ea = 0; foreach (array('ordr_ea', 'cart_goods_ea', 'qty', 'deliv_ea') as $key) { if (isset($row[$key])) { $order_ea = max(0, (int)$row[$key]); break; } } $goods_units = array_values(array_filter(array_map('trim', explode(',', (string)($goods['goods_unit'] ?? ''))), 'strlen')); if (in_array('1', $goods_units, true) && !in_array('2', $goods_units, true)) { $box_ea = $order_ea; } else { $unit_ea = $order_ea; } } foreach (array('box' => $box_ea, 'unit' => $unit_ea) as $unit => $order_ea) { if ($order_ea <= 0) { continue; } $qty_field = $unit . '_remit_ea'; $price_field = $unit . '_deliv_price'; $is_goods_setting = $goods[$qty_field] !== null && $goods[$price_field] !== null; $setting = $is_goods_setting ? $goods : $logistics_setting; $remit_ea = isset($setting[$qty_field]) ? (int)$setting[$qty_field] : 0; $deliv_price = isset($setting[$price_field]) ? (int)$setting[$price_field] : 0; if ($remit_ea <= 0) { continue; } $group_key = $is_goods_setting ? 'goods:' . $goods_idx . ':' . $unit : 'logistics:' . $logistics_cate . ':' . $unit; if (!isset($group_totals[$group_key])) { $group_totals[$group_key] = array( 'source' => $is_goods_setting ? 'goods' : 'logistics', 'source_idx' => $is_goods_setting ? $goods_idx : $logistics_cate, 'unit' => $unit, 'total_order_ea' => 0, 'remit_ea' => $remit_ea, 'base_delivery_price' => max(0, $deliv_price), 'goods_ids' => array() ); } $group_totals[$group_key]['total_order_ea'] += $order_ea; if (!in_array($goods_idx, $group_totals[$group_key]['goods_ids'], true)) { $group_totals[$group_key]['goods_ids'][] = $goods_idx; } } } $total_delivery_price = 0; $group_results = array(); $item_delivery_prices = array(); foreach ($group_totals as $group_key => $group) { $delivery_price = $group['total_order_ea'] < $group['remit_ea'] ? $group['base_delivery_price'] : 0; $total_delivery_price += $delivery_price; $group['delivery_price'] = $delivery_price; if ($delivery_price > 0 && !empty($group['goods_ids'])) { $goods_idx = (int)$group['goods_ids'][0]; $item_delivery_prices[$goods_idx] = ($item_delivery_prices[$goods_idx] ?? 0) + $delivery_price; } $group_results[$group_key] = $group; } $empty_result['delivery_price'] = (int)$total_delivery_price; $empty_result['groups'] = $group_results; $empty_result['item_delivery_prices'] = $item_delivery_prices; return $empty_result; } /* code 공통코드 싱글 선택 라디오버튼 생성 함수 $selectVal : 실제 선택 된 값 $checkName : 라디오버튼 name (아이디값은 name1, name2 로 생성) $code_gubun : code_gubun 컬럼의 구분값 Author : 2023-03-18 By KGY 사용예시 >>>>>>>>>>>>>>>>>>>>>>>>>> (S)
Fatal error: Uncaught Error: Call to undefined function radioSingleList() in /home/365kr/html/application/libs/sql.php:599 Stack trace: #0 /home/365kr/html/index.php(15): require_once() #1 {main} thrown in /home/365kr/html/application/libs/sql.php on line 599