$value) { global ${$key}; ${$key} = $value; } /* @extract($HTTP_GET_VARS); @extract($HTTP_POST_VARS); @extract($HTTP_SERVER_VARS); @extract($HTTP_ENV_VARS); */ $g_check_id = $_SESSION["morning_sess_id"]; $g_check_pass = $_SESSION["morning_sess_pass"]; $g_check_name = $_SESSION["morning_sess_name"]; $g_check_rank = $_SESSION["morning_sess_rank"]; $g_check_email = $_SESSION["morning_sess_email"]; $g_check_point = $_SESSION["morning_sess_point"]; $g_check_image = $_SESSION["morning_sess_image"]; $g_check_home = $_SESSION["morning_sess_home"]; $g_check_cart = $_SESSION["morning_sess_cart"]; $g_check_bpass = $_SESSION["morning_sess_bpass"]; $g_check_referer = $_SESSION["morning_sess_referer"]; $g_check_look = $_SESSION["morning_sess_look"]; $g_check_view = $_SESSION["morning_sess_view"]; $g_check_vote = $_SESSION["morning_sess_vote"]; $g_check_buyerurl = $_SESSION['morning_sess_buyerurl']; $cooki_estimate = $_SESSION['cooki_estimate']; $g_check_number = $_SESSION["morning_sess_number"]; $GLOBALS["_g_check_rank_"] = $g_check_rank; /* 장바구니를 쿠키형식으로 할때 활성화 시키고 바로 위에 $g_check_cart 요거 세션 설정 주석처리 if($_SESSION["morning_sess_cart"] && !$g_check_cart){ setcookie("g_check_cart", "$morning_sess_cart", time()+60*60*4, "/"); //쿠키로도 심어둠..(그냥) } */ if(!$g_check_referer) { // 로그인 접속 경로를 알기 위해서 $morning_sreferer = getenv("HTTP_REFERER"); $_SESSION['morning_sess_referer'] = $morning_sreferer; } if(!$g_check_look) { // 세션 오늘 보기 부분 만들기 $morning_slook = time()."_".rand(10000,99999); $_SESSION['morning_sess_look'] = $morning_slook; } if($g_check_id) $g_check_show = $g_check_id; //if($g_check_image) $g_check_show = $g_check_id; if(!$g_check_rank) $g_check_rank = "0"; ?> $vlaue){ if(strlen($key) > 30){ echo"인젝션접근 차단1"; exit; } if($key != "r_path"){ if(strlen($vlaue) > 200){ echo"인젝션접근 차단2"; exit; } } } //-------------------------------------------------------------------------------- // 인잭션공경 방어 //-------------------------------------------------------------------------------- function sql_clear($cval){ global $g_sqlclear_array; for($i=0;$i <= count($g_sqlclear_array);$i++){ if(strpos($cval,$g_sqlclear_array[$i])!==false){ error_msg("사용하시면 안되는 특수문자또는 단어가 포함되어 있습니다."); exit; } } } //-------------------------------------------------------------------------------- // 상대경로설정 //-------------------------------------------------------------------------------- if(!file_exists("config_basic.php")){ $DIR_ROOT = "../"; for($i=0;$i<5;$i++){ if(!file_exists($DIR_ROOT."config_basic.php")){$DIR_ROOT .= "../";} } } //-------------------------------------------------------------------------------- // 에러처리 기본함수 //-------------------------------------------------------------------------------- function error_msg($str, $url= "",$type="") { if ($url == "") { $url = "history.go(-1)"; } elseif ($url == "close") { $url = "window.close()"; } else { $url = "document.location.href = '$url'"; } if($type == "stop"){ echo ""; exit; }else{ if ($str != "") { echo ""; }else { echo ""; } } exit; } //-------------------------------------------------------------------------------- // 현재 경로 표시하기 위해서 //-------------------------------------------------------------------------------- if(!$url) $url = basename($g_now_file); if($url == "php.exe") $url = ""; //-------------------------------------------------------------------------------- // SQL Injection //-------------------------------------------------------------------------------- function escape_string($str) { global $mysqli; if(!$str) return; $str = nl2br($str); if(version_compare(phpversion(),"4.3.0")=="-1") { if($mysqli == "on"){ $str = mysqli_escape_string($str); }else{ $str = mysql_escape_string($str); } } else { //$str = mysql_escape_string($str); // 에러가 날경우 밑에것을 활성화 해주세요 $str = addslashes($str); } return $str; } $id = escape_string($id); $login_id = escape_string($login_id); $loss_id = escape_string($loss_id); $loss_name = escape_string($loss_name); $loss_email = escape_string($loss_email); $del_id = escape_string($del_id); $del_name = escape_string($del_name); $del_email = escape_string($del_email); $ps_db = escape_string($ps_db); $ps_boid = escape_string($ps_boid); $ps_bcid = escape_string($ps_bcid); $ps_ctid = escape_string($ps_ctid); $ps_goid = escape_string($ps_goid); $ps_orid = escape_string($ps_orid); $ps_sess = escape_string($ps_sess); $ps_poid = escape_string($ps_poid); $ps_search = escape_string($ps_search); $ps_sele = escape_string($ps_sele); $ps_ques = escape_string($ps_ques); $ps_subject = escape_string($ps_subject); $ps_company = escape_string($ps_company); $ps_brand = escape_string($ps_brand); $ps_code = escape_string($ps_code); $ps_min_money = escape_string($ps_min_money); $ps_max_money = escape_string($ps_max_money); $ps_line = escape_string($ps_line); //-------------------------------------------------------------------------------- // 테이블 명칭 선언 //-------------------------------------------------------------------------------- // 카테고리 테이블 $morning_category_table = "morning_category_table"; $morning_goods_table = "morning_goods_table"; $morning_gcomment_table = "morning_gcomment_table"; $morning_member_table = "morning_member_table"; $morning_point_table = "morning_point_table"; $morning_popup_table = "morning_popup_table"; $morning_poll_table = "morning_poll_table"; $morning_pcomment_table = "morning_pcomment_table"; // 상품 구입 관련 테이블 $morning_cart_table = "morning_cart_table"; $morning_purchase_table = "morning_purchase_table"; $morning_buyer_table = "morning_buyer_table"; // 카운터 관련 테이블 $morning_counter_table = "morning_counter_table"; $morning_refererde_table = "morning_refererde_table"; // 2004 버젼 뉴테이블 $morning_manager_table = "morning_manager_table"; $morning_banner_table = "morning_banner_table"; $morning_supply_table = "morning_supply_table "; $morning_look_table = "morning_look_table "; $morning_page_table = "morning_page_table "; $morning_login_table = "morning_login_table"; $morning_search_table = "morning_search_table"; // 가가몰 추가테이블 $morning_estimate_table = "morning_estimate_table"; $morning_besong_table = "morning_besong_table"; $morning_etc_table = "morning_etc_table"; $morning_etc_config_table = "morning_etc_config_table"; $morning_memo_table = "morning_memo_table"; $morning_friend_table = "morning_friend_table"; // 쿠폰 관련 추가 테이블 $morning_coupon_table = "morning_coupon_table"; $morning_couponmb_table = "morning_couponmb_table"; // 게시판 관리 테이블 $morning_badmin_table = "morning_badmin_table"; // 게시판 본체 테이블 if($ps_db) $board_code = $ps_db; $morning_bdivision_table = "morning_bdivision_$board_code"; $morning_bmain_table = "morning_bmain_$board_code"; $morning_bcomment_table = "morning_bcomment_$board_code"; $morning_bcategory_table = "morning_bcategory_$board_code"; $morning_tmp_upload = "morning_tmp_upload"; //가가멀티파일 $morning_giftcard_table = "morning_giftcard_table"; //기프트카드 $morning_calendar_table = "morning_calendar_table"; //캘린더 $morning_cheditor_table = "morning_cheditor_table"; //에디터 $morning_loginmove_table = "morning_loginmove_table"; //움직임기록 $morning_push_table = "morning_push_table"; //푸시푸시 $morning_bankservice_table = "morning_bankservice_table"; //뱅크나우 $morning_cart_option_table = "morning_cart_option_table"; //장바구니상품옵션 $morning_purchase_option_table = "morning_purchase_option_table"; //구입상품옵션 $morning_member_sleep_table = "morning_member_sleep_table"; //휴면회원 $morning_admin_ip = "morning_admin_ip"; $morning_partnercash_table = "morning_partnercash_table"; //파트너정산처리 //-------------------------------------------------------------------------------- // 파일 링크 설정 //-------------------------------------------------------------------------------- $config_basic = $g_dir_root."config_basic.php"; $config_db = $g_dir_root."config_db.php"; $config_key = $g_dir_root."config_key.php"; $language_korea = $g_dir_root."language_korea.php"; $language_english = $g_dir_root."language_english.php"; $language_japen = $g_dir_root."language_japen.php"; $language_china = $g_dir_root."language_china.php"; $license_file = $g_dir_root."license.txt"; $sms_file = $g_dir_root."sendsms.php"; $g_page_file = $g_dir_root."config_page.txt"; $g_session_dir = $g_dir_root."session"; if($db_charset == "utf8"){ $g_lib_file = $g_dir_root."func_lib_utf8.php"; $g_lib_file2 = $g_dir_root."func_editor_utf8.php"; $g_lib_file4 = $g_dir_root."func_sms_utf8.php"; }else{ $g_lib_file = $g_dir_root."func_lib.php"; $g_lib_file2 = $g_dir_root."func_editor.php"; $g_lib_file4 = $g_dir_root."func_sms.php"; } $g_lib_file3 = $g_dir_root."func_dbup.php"; $g_lib_file5 = $g_dir_root."func_excelreader.php"; $g_main_html = $DIR_ROOT."index.php"; $install_file = $DIR_ROOT."install.php"; $g_mall_skin_dir = $DIR_ROOT."skin"; $g_mall_image_dir = $DIR_ROOT."shop_image"; $g_member_image_dir = $DIR_ROOT."member_image"; $g_board_data_dir = $DIR_ROOT."board_data"; $g_board_skin_dir = $DIR_ROOT."board_skin"; $g_mv = $DIR_ROOT; //-------------------------------------------------------------------------------- // 환경 설정 파일 불러오기 //-------------------------------------------------------------------------------- if(!$config_basic){$config_basic = "config_basic.php";} if(!$config_db){$config_db = "config_db.php";} if(!$license_file){$license_file = "license.txt";} if(!file_exists("$config_basic")) { error_msg("config BASIC file open error");} if(!file_exists("$config_db")) { error_msg("config DB file open error","$install_file");} if(!file_exists("$license_file")) { error_msg("license file open error","http://hdesigner.net"); } //-------------------------------------------------------------------------------- // 언어 팩 불어오기 //-------------------------------------------------------------------------------- if($cf_language_method == "korea") { include "$language_korea"; } elseif($cf_language_method == "english") { include "$language_english"; } elseif($cf_language_method == "japen") { include "$language_japen"; } elseif($cf_language_method == "china") { include "$language_china"; } else { include "$language_korea"; } // ------------------------------------------------------------------ // array_replace (버전이 낮아서 없을때..) // ------------------------------------------------------------------ if(!function_exists("array_replace")){ function array_replace($arr1, $arr2) { foreach($arr2 as $key => $value){ if(is_array($value)) $arr1[$key] = array_merge($value); else $arr1[$key] = $value; } return $arr1; } } //-------------------------------------------------------------------------------- // sms 보내기 직접 //-------------------------------------------------------------------------------- function sms_send($send_tel,$send_str,$from_tel="",$rdate="",$rtime="") { global $sms_file,$connect,$cf_sms_tel,$cf_sms_useadmin,$cf_sms_system,$cf_sms_system_id,$cf_sms_system_pass,$cf_sms_system_url,$g_now_time,$g_check_rank,$cf_sms_use; if($cf_sms_use != "1" || !$cf_sms_system_id || !$cf_sms_system_pass){ error_msg("환경설정에서 sms설정을 마친후 사용해주세요."); exit; } if($from_tel){$cf_sms_tel = "$from_tel";} $send_tel_arr = explode(",",$send_tel); for($k=0;$k "$cf_sms_system_id", 'ps_member_pass' => "$cf_sms_system_pass", 'ps_msg' => "$send_str", 'ps_phone_to' => "$send_tel", 'ps_phone_from' => "$cf_sms_tel", 'ps_reservation_date' => "$ps_reservation_date", 'ps_memo' => "" ); $sms_return = hd_curl($post_data); */ } elseif($cf_sms_system == "2") { // 쏜다넷 (비밀번호부분을 보안키값으로 넣어야함) $receive_number = str_replace("-", "", $send_tel); $send_number = str_replace("-", "", $cf_sms_tel); $url = "http://biz.xonda.net/biz/biz_newV2/SMSASP_WEBV4_s.asp"; $biz_id = $cf_sms_system_id; $smskey = $cf_sms_system_pass; $return_url = "http://".$cf_sms_system_url; $sms_contents = $send_str; //create array of data to be posted $post_data['BIZ_ID'] = $biz_id; $post_data['SMSKEY'] = $smskey; $post_data['SEND_NUMBER'] = $send_number; $post_data['RECEIVE_NUMBER'] = $receive_number; $post_data['reserved_flag'] = 'false'; $post_data['reserved_year'] = ''; $post_data['reserved_month'] = ''; $post_data['reserved_day'] = ''; $post_data['reserved_hour'] = ''; $post_data['reserved_minute'] = ''; $post_data['usrdata1'] = ''; $post_data['usrdata2'] = ''; $post_data['usrdata3'] = ''; $post_data['SMS_CONTENTS'] = $sms_contents; $post_data['RETURN_URL'] = $return_url; foreach ( $post_data as $key => $value) { $post_items[] = $key . '=' . $value; } $post_string = implode ('&', $post_items); //create cURL connection $curl_connection = curl_init(); //set options curl_setopt($curl_connection, CURLOPT_URL, $url); curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl_connection, CURLOPT_REFERER, "http://".$cf_sms_system_url); curl_setopt($curl_connection, CURLOPT_POST, true); curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string); $result = curl_exec($curl_connection); curl_close($curl_connection); /* include_once ("$sms_file"); $send_tel = str_replace("-", "", $send_tel); $cf_sms_tel = str_replace("-", "", $cf_sms_tel); //$cf_mall_url = str_replace( "http://", "",$cf_mall_url); $http = new Http; $http->setURL("http://aspdll.xonda.net/smsws/xsmswebservice.asmx/SendSMS"); //정보 입력후 Test하시면 됩니다. $http->setParam("biz_id", "$cf_sms_system_id"); $http->setParam("password", "$cf_sms_system_pass"); $http->setParam("DNSName", "$cf_sms_system_url"); $http->setParam("send_number", "$cf_sms_tel"); $http->setParam("receive_number", "$send_tel"); $http->setParam("sms_contents", "$send_str"); $http->setParam("merge_name", ""); $http->setParam("reserved_Date", ""); $http->setParam("userData1", ""); $http->setParam("userData2", ""); $http->setParam("userData3", ""); $http->send("POST"); */ } elseif($cf_sms_system == "3") { // 카페24 if(strpos($send_tel,"-")!==false){ $rphone = explode("-",$send_tel); }else{ $rphone[0] = substr($send_tel,0,3); $rphone[1] = substr($send_tel,0,-4); $rphone[1] = substr($rphone[1],3); $rphone[2] = substr($send_tel,-4); } if(strpos($cf_sms_tel,"-")!==false){ $sphone = explode("-",$cf_sms_tel); }else{ $sphone[0] = substr($cf_sms_tel,0,3); $sphone[1] = substr($cf_sms_tel,0,-4); $sphone[1] = substr($sphone[1],3); $sphone[2] = substr($cf_sms_tel,-4); } $rphone = $rphone[0]."-".$rphone[1]."-".$rphone[2]; $sms_url = "http://".$cf_sms_system_url; // 전송요청 URL $sms['user_id'] = base64_encode("$cf_sms_system_id"); //SMS 아이디. $sms['secure'] = base64_encode("$cf_sms_system_pass") ;//인증키 $sms['msg'] = base64_encode(stripslashes($send_str)); $sms['rphone'] = base64_encode($rphone); $sms['sphone1'] = base64_encode($sphone[0]); $sms['sphone2'] = base64_encode($sphone[1]); $sms['sphone3'] = base64_encode($sphone[2]); $sms['rdate'] = base64_encode($rdate); $sms['rtime'] = base64_encode($rtime); $sms['mode'] = base64_encode("1"); // base64 사용시 반드시 모드값을 1로 주셔야 합니다. $sms['returnurl'] = base64_encode($returnurl); $sms['testflag'] = base64_encode($testflag); $sms['destination'] = base64_encode($destination); $returnurl = $returnurl; $sms['repeatFlag'] = base64_encode($repeatFlag); $sms['repeatNum'] = base64_encode($repeatNum); $sms['repeatTime'] = base64_encode($repeatTime); $nointeractive = $nointeractive; //사용할 경우 : 1, 성공시 대화상자(alert)를 생략 $host_info = explode("/", $sms_url); $host = $host_info[2]; $path = $host_info[3]."/".$host_info[4]; srand((double)microtime()*1000000); $boundary = "---------------------".substr(md5(rand(0,32000)),0,10); //print_r($sms); // 헤더 생성 $header = "POST /".$path ." HTTP/1.0\r\n"; $header .= "Host: ".$host."\r\n"; $header .= "Content-type: multipart/form-data, boundary=".$boundary."\r\n"; // 본문 생성 foreach($sms AS $index => $value){ $data .="--$boundary\r\n"; $data .= "Content-Disposition: form-data; name=\"".$index."\"\r\n"; $data .= "\r\n".$value."\r\n"; $data .="--$boundary\r\n"; } $header .= "Content-length: " . strlen($data) . "\r\n\r\n"; $fp = fsockopen($host, 80); if ($fp) { fputs($fp, $header.$data); $rsp = ''; while(!feof($fp)) { $rsp .= fgets($fp,8192); } fclose($fp); $msg = explode("\r\n\r\n",trim($rsp)); $rMsg = explode(",", $msg[1]); $Result= $rMsg[0]; //발송결과 $Count= $rMsg[1]; //잔여건수 /*발송결과 알림 if($Result=="success") { $alert = "성공"; $alert .= " 잔여건수는 ".$Count."건 입니다."; } else if($Result=="reserved") { $alert = "성공적으로 예약되었습니다."; $alert .= " 잔여건수는 ".$Count."건 입니다."; } else if($Result=="3205") { $alert = "잘못된 번호형식입니다."; } else if($Result=="0044") { $alert = "스팸문자는발송되지 않습니다."; } else { $alert = "[Error]".$Result; }*/ } } } } } //-------------------------------------------------------------------------------- // 환경 설정 파일 방해 문자 제거 //-------------------------------------------------------------------------------- function settings_del($str,$type="text") { $str = str_replace("\r\n", "▦", $str); $str = str_replace("\n", "▦", $str); $str = str_replace("&", "§", $str); $str = str_replace("\"", "¶", $str); $str = trim($str); return $str; } //-------------------------------------------------------------------------------- // 환경 설정 파일 복원 //-------------------------------------------------------------------------------- function settings_re($str,$type="text") { $str = stripslashes($str); $str = str_replace("▦", "\n", $str); $str = str_replace("§", "&", $str); $str = str_replace("¶", "\"", $str); $str = str_replace("", "", $str); return $str; } //-------------------------------------------------------------------------------- // MYSQL용 함수 //-------------------------------------------------------------------------------- // 데이터 베이스 연결 $g_connect_start = getmicrotime(); $connect = dbconn(); $GLOBALS["gconnect"] = $connect; $g_connect_end = getmicrotime(); function dbconn() { global $config_db,$install_file,$mysqli,$db_charset; if(!file_exists("$config_db")) { error_msg("$ERROR_FUNCTION_OPEN_DBFILE","$install_file");} $db_settings = parse_ini_file("$config_db"); @extract($db_settings); if($mysqli == "on"){ if(!$connect) $connect = @mysqli_connect($con_db_host,$con_db_id,$con_db_pass,$con_db_name) or die(" Mysql_Query : ".$query."
Mysql_Error : ".mysqli_error()."
Mysql Error Num : ".mysqli_errno()."
"); if($db_charset == "euckr"){ @mysqli_query($connect,"set names euckr"); }else{ @mysqli_query($connect,"set names utf8"); } }else{ if(!$connect) $connect = @mysql_connect($con_db_host,$con_db_id,$con_db_pass,true) or die(" Mysql_Query : ".$query."
Mysql_Error : ".mysql_error()."
Mysql Error Num : ".mysql_errno()."
"); @mysql_select_db($con_db_name, $connect) or die(" Mysql_Query : ".$query."
Mysql_Error : ".mysql_error()."
Mysql Error Num : ".mysql_errno()."
"); if($db_charset == "euckr"){ @mysql_query("set names euckr",$connect); }else{ @mysql_query("set names utf8",$connect); } } return $connect; } function morning_query($query) { global $connect,$mysqli; if($mysqli == "on"){ $result = @mysqli_query($connect,$query); }else{ $result = @mysql_query($query,$connect); } return $result; } morning_query("SET SESSION sql_mode = ''");//20210721 mysql strict_mode해제, 컬럼의 datatype오류 같은 엄격한 판정이 해제된다. 가가몰 자체 오류 발생이 많아서 처리 /* function func_mysql_errno($str) { die("ERROR: ".$str); }*/ function morning_query_error($query) { global $connect,$mysqli; $temp_bar = "
=============================================================================
"; if($mysqli == "on"){ $result = mysqli_query($connect,$query ) or die("DB ERROR
".$temp_bar." Mysql_Query : ".$query."
Mysql_Error : ".mysqli_error()."
Mysql Error Num : ".mysqli_errno()."
".$temp_bar); //$result = mysqli_query($connect,$query ) or some_func(mysqli_error($connect)); }else{ $result = mysql_query($query, $connect) or die("DB ERROR
".$temp_bar." Mysql_Query : ".$query."
Mysql_Error : ".mysql_error()."
Mysql Error Num : ".mysql_errno()."
".$temp_bar); } return $result; } function morning_result($result) { global $mysqli; if($mysqli == "on"){ @mysqli_result($result); }else{ @mysql_result($result); } } function morning_fetch_array($result) { global $mysqli; if($mysqli == "on"){ return @mysqli_fetch_array($result); }else{ return @mysql_fetch_array($result); } } function morning_free_result($result) { global $mysqli; if($mysqli == "on"){ return @mysqli_free_result($result); }else{ return @mysql_free_result($result); } } function morning_num_rows($result) { global $mysqli; if($mysqli == "on"){ return @mysqli_num_rows($result); }else{ return @mysql_num_rows($result); } } function morning_fetch_row($result) { global $mysqli; if($mysqli == "on"){ return @mysqli_fetch_row($result); }else{ return @mysql_fetch_row($result); } } function morning_close($connect) { global $mysqli; if($mysqli == "on"){ @mysqli_close($connect); }else{ @mysql_close($connect); } } function morning_counter($table_name, $where_str="", $field_name="*") { global $connect; $where_str = trim($where_str); if(strtolower(substr($where_str,0,5)) != "where" and $where_str) $where_str = "where ".$where_str; $query = " select count($field_name) from $table_name $where_str "; $result = morning_query_error($query); $fetch_row = morning_fetch_row($result); return $fetch_row[0]; } //-------------------------------------------------------------------------------- // 라이브러리파일 불러오기 //-------------------------------------------------------------------------------- include "$g_lib_file"; include "$g_lib_file2"; include "$g_lib_file3"; include "$g_lib_file4"; //include "$g_lib_file5"; $keycheck = $GLOBALS[_keycheck_]; $date_install = $GLOBALS[_date_install_]; // ---------------------------------------------------------- // 옵션문자대체 // ---------------------------------------------------------- function option_text_chang($str){ $str = str_replace("|","/",$str); $str = str_replace("^",",",$str); return $str; } //-------------------------------------------------------------------------------- // 선택 화면 만들기 (고정가격옵션) //-------------------------------------------------------------------------------- function make_select_de($name,$codename,$data){ global $cf_mall_form,$g_check_id; $data_bit = explode("/",$data); $str = "\n\n"; return $str; } //-------------------------------------------------------------------------------- // 환경 설정 파일 불러오기 //-------------------------------------------------------------------------------- $settings = parse_ini_file("$config_basic"); @extract($settings); $cf_mall_name = settings_re($cf_mall_name); $cf_mall_url = settings_re($cf_mall_url); $cf_mall_install_dir = settings_re($cf_mall_install_dir); $cf_mall_address = settings_re($cf_mall_address); $cf_mall_title = settings_re($cf_mall_title); $cf_company_num = settings_re($cf_company_num); $cf_sale_num = settings_re($cf_sale_num); $cf_business_name = settings_re($cf_business_name); $cf_business_conditions = settings_re($cf_business_conditions); $cf_business_item = settings_re($cf_business_item); $cf_ceo_name = settings_re($cf_ceo_name); $cf_charge_name = settings_re($cf_charge_name); $cf_ceo_phone = settings_re($cf_ceo_phone); $cf_ceo_fax = settings_re($cf_ceo_fax); $cf_discount_method = settings_re($cf_discount_method); $cf_client_phone1 = settings_re($cf_client_phone1); $cf_client_phone2 = settings_re($cf_client_phone2); $cf_client_phone3 = settings_re($cf_client_phone3); $cf_client_phone4 = settings_re($cf_client_phone4); $cf_client_phone5 = settings_re($cf_client_phone5); $cf_client_fax = settings_re($cf_client_fax); $cf_client_email = settings_re($cf_client_email); $cf_client_msn = settings_re($cf_client_msn); $cf_client_time = settings_re($cf_client_time); $cf_mall_form = settings_re($cf_mall_form); $cf_language_method = settings_re($cf_language_method); $cf_skin_name = settings_re($cf_skin_name); $cf_account_cut = settings_re($cf_account_cut); $cf_account_method = settings_re($cf_account_method); $cf_account_end = settings_re($cf_account_end); $cf_card_system = settings_re($cf_card_system); $cf_card_id = settings_re($cf_card_id); $cf_terminal_id = settings_re($cf_terminal_id); $cf_md_dir = settings_re($cf_md_dir); $cf_card_day = settings_re($cf_card_day); $cf_card_escrowuse = settings_re($cf_card_escrowuse); $cf_card_escrowuse_01 = settings_re($cf_card_escrowuse_01); $cf_card_escrowuse_02 = settings_re($cf_card_escrowuse_02); $cf_card_escrowuse_chk = settings_re($cf_card_escrowuse_chk); $cf_card_besong = settings_re($cf_card_besong); $cf_card_logourl = settings_re($cf_card_logourl); $cf_card_url = settings_re($cf_card_url); $cf_card_account_url = settings_re($cf_card_account_url); $cf_card_url = settings_re($cf_card_url); $cf_card_account_url = settings_re($cf_card_account_url); $cf_card_money = settings_re($cf_card_money); $cf_bank_account = settings_re($cf_bank_account); $cf_bank_address = settings_re($cf_bank_address); $cf_member_agreement = settings_re($cf_member_agreement); $cf_jumin_check = settings_re($cf_jumin_check); $cf_discount_method = settings_re($cf_discount_method); $cf_discount_price1 = settings_re($cf_discount_price1); $cf_discount_price2 = settings_re($cf_discount_price2); $cf_discount_price3 = settings_re($cf_discount_price3); $cf_discount_price4 = settings_re($cf_discount_price4); $cf_point_use = settings_re($cf_point_use); $cf_point_member = settings_re($cf_point_member); $cf_point_add = settings_re($cf_point_add); $cf_point_recommend = settings_re($cf_point_recommend); $cf_point_recommend_re = settings_re($cf_point_recommend_re); $cf_point_money = settings_re($cf_point_money); $cf_delivery_free = settings_re($cf_delivery_free); $cf_delivery_money = settings_re($cf_delivery_money); $cf_delivery_method = settings_re($cf_delivery_method); $cf_wrapping_method = settings_re($cf_wrapping_method); $cf_mail_method = settings_re($cf_mail_method); $cf_mail_member = settings_re($cf_mail_member); $cf_mail_order = settings_re($cf_mail_order); $cf_sms_receipt = settings_re($cf_sms_receipt); $cf_sms_delivery = settings_re($cf_sms_delivery); $cf_mail_name = settings_re($cf_mail_name); $cf_stock_use = settings_re($cf_stock_use); $cf_stock_method = settings_re($cf_stock_method); $cf_stock_time = settings_re($cf_stock_time); $cf_use_user_confirm = settings_re($cf_use_user_confirm); $cf_use_wishlist = settings_re($cf_use_wishlist); $cf_limit_list = settings_re($cf_limit_list); $cf_right_layer = settings_re($cf_right_layer); $cf_left_layer = settings_re($cf_left_layer); $cf_buy_09_list = settings_re($cf_buy_09_list); $cf_mouse_bt = settings_re($cf_mouse_bt); $cf_mouse_dreg = settings_re($cf_mouse_dreg); $cf_menu_brand = settings_re($cf_menu_brand); $cf_menu_bank = settings_re($cf_menu_bank); $cf_body_br = settings_re($cf_body_br); $cf_site_link = settings_re($cf_site_link); $cf_site_keyworld = settings_re($cf_site_keyworld); $cf_name_system_method = settings_re($cf_name_system_method); $cf_name_system = settings_re($cf_name_system); $cf_name_system_id = settings_re($cf_name_system_id); $cf_name_system_key = settings_re($cf_name_system_key); $cf_sms_use = settings_re($cf_sms_use); $cf_sms_useadmin = settings_re($cf_sms_useadmin); $cf_sms_member = settings_re($cf_sms_member); $cf_sms_order = settings_re($cf_sms_order); $cf_sms_receipt = settings_re($cf_sms_receipt); $cf_sms_delivery = settings_re($cf_sms_delivery); $cf_sms_tel = settings_re($cf_sms_tel); $cf_sms_system = settings_re($cf_sms_system); $cf_sms_system_id = settings_re($cf_sms_system_id); $cf_sms_system_pass = settings_re($cf_sms_system_pass); $cf_sms_system_url = settings_re($cf_sms_system_url); $cf_sms_message1 = settings_re($cf_sms_message1); $cf_sms_message2 = settings_re($cf_sms_message2); $cf_sms_message3 = settings_re($cf_sms_message3); $cf_sms_message4 = settings_re($cf_sms_message4); $cf_use_session = settings_re($cf_use_session); $cf_use_session_del = settings_re($cf_use_session_del); $cf_use_deldb = settings_re($cf_use_deldb); $cf_goods_dview01 = settings_re($cf_goods_dview01,"html"); $cf_goods_dview02 = settings_re($cf_goods_dview02,"html"); $cf_goods_dview03 = settings_re($cf_goods_dview03,"html"); $cf_goods_dview04 = settings_re($cf_goods_dview04,"html"); $cf_use_vat = settings_re($cf_use_vat); $cf_use_receipt = settings_re($cf_use_receipt); $cf_member_up_01 = settings_re($cf_member_up_01); $cf_member_up_02 = settings_re($cf_member_up_02); $cf_member_up_03 = settings_re($cf_member_up_03); $cf_member_up_use = settings_re($cf_member_up_use); $cf_use_coupon = settings_re($cf_use_coupon); $cf_security_ssl = settings_re($cf_security_ssl); $cf_security_ap = settings_re($cf_security_ap); $cf_point_login = settings_re($cf_point_login); $cf_homepage_close = settings_re($cf_homepage_close); $cf_ip_close = settings_re($cf_ip_close); $cf_gosi_subject = settings_re($cf_gosi_subject,"html"); $cf_gosi_body = settings_re($cf_gosi_body,"html"); if($_SERVER['HTTPS'] == "on" ){ $cf_mall_url = str_replace("http://", "",$cf_mall_url); $cf_mall_url = str_replace("https://", "",$cf_mall_url); $cf_mall_url = "https://".$cf_mall_url; }else{ $cf_mall_url = str_replace("http://", "",$cf_mall_url); $cf_mall_url = str_replace("https://", "",$cf_mall_url); $cf_mall_url = "http://".$cf_mall_url; } // 은행 계좌명 구별하기 $cf_bank_bit = explode("\n",$cf_bank_account); // 인터넷뱅킹 주소 구별하기 $cf_bankaddress_bit = explode("\n",$cf_bank_address); // 경쟁사이트 주소 구별하기 $cf_sitelink_bit = explode("\n",$cf_site_link); // 키워드광고사 주소 구별하기 $cf_sitekeyworld_bit = explode("\n",$cf_site_keyworld); // 상품정보고시 $cf_gosi_subject_bit = explode("†",$cf_gosi_subject); $cf_gosi_body_bit = explode("†",$cf_gosi_body); //아이피차단 $cf_ip_close_bit = explode("\n",$cf_ip_close); if($cf_ip_close){ for($i=0;$i","-","=",";","\"","\'","'"); //sql인젝션 공격단어 $gift_state_array = array("주문접수","결제완료"); //기프트카드 // 게시판 초기 입력 값 관련 항목들 $g_board_header_text = "
"; $g_board_tailer_text = "
"; $g_filter_text = "개새끼,씨발,호로새끼,씹새,씨발놈,븅신,정품,시알리스,비아그라,환각제,씨알,오죠,미국,조루,성기능,발기부전,필리핀,최음제,발기부전,치료제,레비트라,바다이야기,흥분제,후불제,복용법,신천지,조루,성기능,시알리스,엑스트라,황금성,성인오락,온라인삼국지,슬롯,파라다이스,비아그라,무료머니"; $g_board_comment_text = "글은 마음의창이라고 합니다. 마음을 나누워 주세요. 세상이 행복해 지도록!"; if($ps_mango == "ok") echo $ps_mango." ===== ".$cct; //-------------------------------------------------------------------------------- // 가가몰에 맞는 포멧 .. 영어가 아닌경우 소수점 삭제 표시 //-------------------------------------------------------------------------------- function morning_int_format($num) { global $cf_language_method; if($cf_language_method == "english") { $new_num = $num; } else { $new_num = intval($num); } return $new_num; } //-------------------------------------------------------------------------------- // 갯수가 구매가능 한지 알아 보기 위해 구입가능 하면 1 //-------------------------------------------------------------------------------- function goods_stock_check($ps_goid, $goods_num) { global $connect,$morning_goods_table; $list = @hd_fetch(hd_query("select * from $morning_goods_table where uid = '$ps_goid'")); if($list[goods_stock] >= $goods_num) { return 1; } else { return 0; } } //-------------------------------------------------------------------------------- // 가격 자리수 찾아서 보여주기 //-------------------------------------------------------------------------------- function make_price_format($str,$check_format="1"){ global $cf_language_method; if(!$str) $str = 0; if($cf_language_method == "english") { if($check_format == "1") { $str = @number_format($str,2); } else { $str = sprintf("%.2f",$str); } } else { if($check_format == "1") { $str = round($str); $str = @number_format($str); } else { $str = intval($str); } } return $str; } //-------------------------------------------------------------------------------- // 관리자모드 카테고리 셀렉트 //-------------------------------------------------------------------------------- function category_admin_list($ps_ctid,$type="",$url="admin_goods.php") { global $morning_category_table; $cate_arr = get_cate_arr(); $cateId_arr = get_cateid(); $list = get_display($cate_arr,$cateId_arr); foreach($list as $key => $value){ $display_level = ""; if($value[1] == 0) { $display_level = ""; } else { for ($j=0; $j<$value[1]; $j++) { $display_level .= "____"; } } if($value[3] == $ps_ctid) $select_check = "selected"; else $select_check = ""; if($type == "move"){ $display_category .= "\n"; }else{ $display_category .= "\n"; } } return $display_category; } //-------------------------------------------------------------------------------- // 카테고리 수정 //-------------------------------------------------------------------------------- function category_admin_list2($ps_ctid) { global $morning_category_table; // 카테고리 불러다가 .. 선택 박스 만들기 $query = "select * from $morning_category_table where category_id > 1 order by category_id"; $result = hd_query($query); while($list = hd_fetch($result)) { $display_level = ""; if($list[category_depth] == 0) { $display_level = ""; } else { for ($j=0; $j<$list[category_depth]; $j++) { $display_level .= "____"; } } if($list[category_id] == $ps_ctid) $select_check = "selected"; else $select_check = ""; $display_category .= "\n"; } return $display_category; } //-------------------------------------------------------------------------------- // 쿠폰번호자동생성 //-------------------------------------------------------------------------------- function coupon_code_make(){ global $connect,$g_now_time,$morning_coupon_table,$coupon_make,$coupon_auto; //유효한 이전 쿠폰번호 가져오기 $serch_sql = " where uend_date > $g_now_time and coupon_code_use = '1'"; $query = "select * from $morning_coupon_table $serch_sql"; $result = hd_query($query); while($list = hd_fetch($result)){ $old_coupon .= trim($list[coupon_code]); } $chk_row2 = explode("/",$old_coupon); //이미등록된 쿠폰꺼.. //쿠폰번호 자동생성 if($coupon_make > 0 && $coupon_auto){ for($i=0;$coupon_make > $i;$i++){ $alpa = chr(rand(65,90)); $alpa .= chr(rand(65,90)); $alpa .= chr(rand(65,90)); $alpa .= chr(rand(65,90)); $num_rand1 =rand(0,9); $num_rand1 .=rand(0,9); $num_rand1 .=rand(0,9); $num_rand1 .=rand(0,9); $num_rand2 =rand(0,9); $num_rand2 .=rand(0,9); $num_rand2 .=rand(0,9); $num_rand2 .=rand(0,9); $num_rand3 =rand(0,9); $num_rand3 .=rand(0,9); $num_rand3 .=rand(0,9); $num_rand3 .=rand(0,9); $coupon_code_chk = $alpa."-".$num_rand1."-".$num_rand2."-".$num_rand3; $chk_row = explode("/",$coupon_code); if(in_array($coupon_code_chk,$chk_row)){$coupon_code_chk.=rand(0,9);}//같은쿠폰이 있을때 번호늘이기 if(in_array($coupon_code_chk,$chk_row2)){$coupon_code_chk.=rand(0,9);}//이미등록된것도 비교하기 $coupon_code .= $coupon_code_chk."/"; } } return $coupon_code; } //-------------------------------------------------------------------------------- // 게시판 무한첨부 2010-11-05 //-------------------------------------------------------------------------------- function bbs_addfile($g_board_data_dir){ global $cf_board,$g_file_okext,$bbsaddfile_del,$bbsaddfile_text,$_FILES; for($i=0;$i 0 && $bbsaddfile_text[$i])) { file_unlink("$bbsaddfile_text[$i]"); $_bbsaddfile_text = ""; } if($_bbsaddfile){ if($bbsaddfile_text[$i]) { file_unlink("$bbsaddfile_text[$i]"); } $_bbsaddfile_text = upload_file($_bbsaddfile, $_bbsaddfile_name, $_bbsaddfile_size, $g_board_data_dir, $g_file_okext, $cf_board[file_size]); }else{ if($bbsaddfile_del[$i]) { file_unlink("$bbsaddfile_text[$i]"); $_bbsaddfile_text = ""; }else{ $_bbsaddfile_text = $bbsaddfile_text[$i]; } } $board_addfile .= $_bbsaddfile_text."†"; } return $board_addfile; } function bbs_addfile_del($str){ $arr = explode("†",$str); for($i=0;$i","?>",$str); $str = str_replace("= $total_page) $end_page = $total_page; $url_arr = explode("#",$url); $url = $url_arr[0]; // 이전10개 이동버튼 if ($start_page > 1) { $link_str .= "".$post_start_on.""; }else{ $link_str .= "".$post_start.""; } if ($total_page > 1) { for ($i=$start_page;$i<=$end_page;$i++) { if ($current_page != $i) { $link_str .= "$i"; } else { $link_str .= "$i"; } } } // 다음10개 이동버튼 if ($total_page > $end_page) { $link_str .= "".$next_start_on.""; }else{ $link_str .= "".$next_start.""; } $link_str .= ""; if($total_page > 1){$link_str = $link_str;}else{$link_str = "";} return $link_str; } //-------------------------------------------------------------------------------- // 파일 읽어오기 .. //-------------------------------------------------------------------------------- function get_read_file($fc_filename) { if(!file_exists($fc_filename)) return ''; $fp = fopen($fc_filename,"r"); $fp_str = fread($fp, filesize($fc_filename)); fclose($fp); return $fp_str; } //-------------------------------------------------------------------------------- // 기본 메일 보내기 //-------------------------------------------------------------------------------- function basic_sendmail($to_email,$from_email,$form_name,$subject,$morningbody,$type="") { global $cf_mail_method,$db_charset; $cf_mail_method = "3"; if($cf_mail_method == "2") { nmail($to_email,$from_email,$form_name,$subject,$morningbody,html); }else if($cf_mail_method == "3") { if($db_charset == "utf8"){ $fromName = scv_kr($form_name); }else{ $fromName = $form_name; } $fromEmail = $from_email; $toEmail = $to_email; if(iconv("utf-8","euc-kr",$subject)) { //$subject = iconv("utf-8","euc-kr",$subject); $subject = "=?EUC-KR?B?".base64_encode(iconv("UTF-8","EUC-KR",$subject))."?="; } $contents = $morningbody; $isDebug=0; $fromName = "온라이프"; if(iconv("utf-8","euc-kr",$fromName)) { $fromName = iconv("utf-8","euc-kr",$fromName); } $smtp_host = gethostbyname("ssl://smtp.gmail.com"); //smtp 호스트 $smtp_id = "pibssmtp@gmail.com"; //smtp 계정아이디 (아이디가 이메일인 경우 이메일주소) $smtp_pw = "gljfemjnvxbxvujg"; //smtp 비밀번호 $port = 465; //포트번호 $type = "text/html"; $charSet = "UTF-8"; /* $smtp_host = "ssl://smtp.gmail.com"; //smtp 호스트 $smtp_id = "lucasdna1019@gmail.com"; //smtp 계정아이디 (아이디가 이메일인 경우 이메일주소) $smtp_pw = "dk152436"; //smtp 비밀번호 $port = 465; //포트번호 $type = "text/html"; $charSet = "utf-8"; */ $fromEmail = $smtp_id; //Open Socket $fp = @fsockopen($smtp_host, $port, $errno, $errstr, 1); if($fp){ //Connection and Greetting $returnMessage = fgets($fp, 128); if($isDebug) print "CONNECTING MSG:".$returnMessage."\n"; fputs($fp, "HELO YA\r\n"); $returnMessage = fgets($fp, 128); if($isDebug) print "GREETING MSG:".$returnMessage."\n"; // 이부분에 다음과 같이 로긴과정만 들어가면됩니다. fputs($fp, "auth login\r\n"); fgets($fp,128); fputs($fp, base64_encode($smtp_id)."\r\n"); fgets($fp,128); fputs($fp, base64_encode($smtp_pw)."\r\n"); fgets($fp,128); fputs($fp, "MAIL FROM: <".$fromEmail.">\r\n"); $returnvalue[0] = fgets($fp, 128); fputs($fp, "rcpt to: <".$toEmail.">\r\n"); $returnvalue[1] = fgets($fp, 128); if($isDebug){ print "returnvalue:"; print_r($returnvalue); } //Data fputs($fp, "data\r\n"); $returnMessage = fgets($fp, 128); if($isDebug) print "data:".$returnMessage; fputs($fp, "Return-Path: ".$fromEmail."\r\n"); fputs($fp, "From: ".$fromName." <".$fromEmail.">\r\n"); fputs($fp, "To: <".$toEmail.">\r\n"); fputs($fp, "Subject: ".$subject."\r\n"); fputs($fp, "Content-Type: ".$type."; charset=\"".$charSet."\"\r\n"); //fputs($fp, "Content-Transfer-Encoding: base64\r\n"); fputs($fp, "\r\n"); //$contents= chunk_split(base64_encode($contents)); $contents= (($contents)); fputs($fp, $contents); fputs($fp, "\r\n"); fputs($fp, "\r\n.\r\n"); $returnvalue[2] = fgets($fp, 128); //Close Connection fputs($fp, "quit\r\n"); fclose($fp); //Message /* 20210720 smtp발송시 오류발생 주석처리 if (ereg("^250", $returnvalue[0])&&ereg("^250", $returnvalue[1])&&ereg("^250", $returnvalue[2])){ $sendmail_flag = true; }else { $sendmail_flag = false; print "NO :".$errno.", STR : ".$errstr; }*/ } } } //-------------------------------------------------------------------------------- // 메일 보내기 직접 //-------------------------------------------------------------------------------- function nmail($to_email, $from_email, $from_name, $subject, $morningbody, $type) { $header = "From: $from_name <$from_email>\n"; //$header .= "X-Sender: <$from_email>\n"; //$header .= "X-Mailer: PHP ".phpversion()."\n"; $header .= "X-Priority: 1\n"; //$header .= "Return-Path: <$from_email>\n"; $header .= "Content-Type: text/$type; charset=EUC-KR\n"; $header .= "\n\n"; $morningbody = stripslashes($morningbody); @$fp = popen('/usr/sbin/sendmail -t -f '.$from_email.' '.$to_email,"w"); if(!$fp) return 0; fputs($fp,"From:".$from_name."<".$from_email.">"."\n"); //fputs($fp, "To: $to_email\n"); fputs($fp, "Subject: ".$subject."\n"); fputs($fp, $header."\n"); fputs($fp, $morningbody); fputs($fp, "\n\n\n"); pclose($fp); return 1; } //-------------------------------------------------------------------------------- // 카테고리 네비게이션 //-------------------------------------------------------------------------------- function category_navigation($str) { global $connect,$morning_category_table,$ps_ctid; $tmp_level = category_level($str); $original_len = strlen($str); // 네비게이션이 필요한 경우 if($tmp_level > 1) { for($i=1 ; $i<$tmp_level ; $i++) { // 그 레벨의 가장 큰 번호의 카테고리 부터 차례 대로 불러오기 $next_num = ($i*2); $parent_str = substr($str, 0, $next_num); $now_str = substr($parent_str."00000000", 0, $original_len); //echo " $tmp_level === $next_num =========== $parent_str ======== $now_str ===
"; $query = " select * from $morning_category_table where category_id = '$now_str' "; $list = hd_fetch(hd_query($query)); $select_category_name = hd_fetch(hd_query("select category_name,category_id from $morning_category_table where category_id = '$list[category_id]'")); $select_temp = ""; $select_temp = $select_text_temp; //text 형태 //$navi_str .= "$select_temp  >  "; $navi_str .= "$select_temp"; } } return $navi_str; } //-------------------------------------------------------------------------------- // 모바일 네비게이션 //-------------------------------------------------------------------------------- function category_navigation_mobile($str) { global $connect,$morning_category_table; $tmp_level = category_level($str); $original_len = strlen($str); // 네비게이션이 필요한 경우 if($tmp_level > 1) { for($i=1 ; $i<$tmp_level ; $i++) { // 그 레벨의 가장 큰 번호의 카테고리 부터 차례 대로 불러오기 $next_num = ($i*2); $parent_str = substr($str, 0, $next_num); $now_str = substr($parent_str."00000000", 0, $original_len); //echo " $tmp_level === $next_num =========== $parent_str ======== $now_str ===
"; $query = " select * from $morning_category_table where category_id = '$now_str' "; $result = hd_query($query); $list = hd_fetch($result); $navi_str .= "$list[category_name] > "; } } return $navi_str; } // ---------------------------------------------------------- // 하위카테고리 네비게이션 (배열방식) // ---------------------------------------------------------- function get_navigation($str) { global $connect,$morning_category_table,$morning_goods_table,$cf_tree_navi,$g_check_rank,$ps_brand,$category_num,$search_save_chk,$ps_search,$ps_search2,$ps_supply; if($category_num) $str = $category_num; //검색일경우 검색카테고리 사용 $tmp_level = category_level($str); $now_level = $tmp_level; $original_len = strlen($str); $next_num = (($tmp_level)*2); $parent_str = substr($str, 0, $next_num); if($tmp_level < 5) { $now_level++; $now_sub_level = $now_level; $now_sub_level++; //하위가 없는지 있는지 확인 $ca_sql = "where substring(category_id,1,$next_num) = '$parent_str' and category_depth = $now_level and approval_date > 0"; $chk_num = morning_counter("$morning_category_table","$ca_sql"); if(!$chk_num){ $next_num = $next_num - 2; $parent_str = substr($str, 0, $next_num); $now_level = $now_level -1; $ca_sql = "where substring(category_id,1,$next_num) = '$parent_str' and category_depth = $now_level and approval_date > 0"; }//하위확인끝 // 검색일때.. if($ps_brand){ $only_brand .= "and ( replace(goods_brand, ' ', '') like '%".str_replace(" ","",$ps_brand)."%')"; }else{ if($search_save_chk){ // 검색내 검색 ///////////////////////////////////////////////////////////// $search_row = explode("|",$ps_search_save); for($i=0;$i 0 and goods_grant <= $g_check_rank $only_brand"); //링크 if($list[category_type] == "2" && $list[board_name_code]){ if($list[board_category] > 0){ $list[link] = "m_board.php?ps_db=$list[board_name_code]&ps_category=$list[board_category]"; }else{ $list[link] = "m_board.php?ps_db=$list[board_name_code]"; } } if(!$list[link]) $list[link] = "m_mall_list.php?ps_ctid=$list[category_id]"; $arr[$i][category_name] = $list[category_name]; $arr[$i][category_id] = $list[category_id]; $arr[$i][category_count] = $goods_count; $arr[$i][link] = $list[link]; $i++; } } //-- 1단계카테고리에 하위가 없으면 null -- if($tmp_level=="1" && !$chk_num && !$ps_search){ $arr = ""; } return $arr; } //-------------------------------------------------------------------------------- // 카테고리 레벨 //-------------------------------------------------------------------------------- function category_level($str) { $level_status = 0; $str_len = strlen($str); for ($i=0; $i<$str_len; $i=$i+2) { $temp_status = substr($str,$i,2); if ($temp_status == "00") {break;} $str_level++; } return $str_level; } //-------------------------------------------------------------------------------- // 카테고리 위치 찾기 //-------------------------------------------------------------------------------- function category_status($str) { $str_status = $str; $str_len = strlen($str_status); for ($i=$str_len; $i>1; $i=$i-2) { $j = $i-2; $temp_status = substr($str_status,$j,2); if($temp_status != "00") {break;} $str_status = substr($str_status,0,$j); } return $str_status; } //-------------------------------------------------------------------------------- // 하위 분류 레벨 구하기 //-------------------------------------------------------------------------------- function category_next($str) { global $connect,$morning_category_table; $parent_str = category_status($str); $len = strlen($parent_str); $original_len = strlen($str); $next_len = $len + 1; //echo " $str ==== $parent_str ==== $len ===== $original_len ==
"; // 4단계 지원 에 따른 4단계 이하만 .. 만들수 있도록 if ($len < 8) { // 그 레벨의 가장 큰 번호를 구한다. $query = " select max(substring(category_id,$next_len,2)) from $morning_category_table where substring(category_id,1,$len) = '$parent_str' "; $max_num = hd_fetch(hd_query($query)); $num = $max_num[0]; //echo "1: $len , $num
"; if ($num == "99") { // 99 개 중에 빠진 거 있나 찾아서 해결 하기. 찾다가 없으면 어쩔수 없구.. // 이렇게 무식한 방법 말구 뭐 있을까 ?? $num = 0; for($i=99 ; $i > 0 ; $i--) { $temp_num = sprintf("%02d",$i); $query = " select * from $morning_category_table where substring(category_id,1,$len) = '$parent_str' and substring(category_id,$next_len,2) = '$temp_num'"; $list = hd_fetch(hd_query($query)); if(!$list[category_id]) { $num = $i; //$count++; } } // echo "2: $num
"; if ($num == "0") { $error_num = "2"; } } else { $num++; } $num = sprintf("%02d",$num); $next_num = substr($parent_str.$num."00000000", 0, $original_len); } else { $error_num = "1"; } if($error_num) return $error_num; return $next_num; } //-------------------------------------------------------------------------------- // 선택 화면 만들기 (추가가격옵션) //-------------------------------------------------------------------------------- function make_select($name,$codename,$data){ global $cf_mall_form,$g_check_id; $data_bit = explode("/",$data); $data_bit = array_diff($data_bit, array('')); if($codename == "goods_option1" || $codename == "goods_option2" || $codename == "goods_option3"){ $str = "\n\n"; } $str .= "\n"; //if(@eregi(",",$data_bit[1])) $str .= "\n"; for($i=0 ; $i$data_sbit[0] $temp_stock\n"; }else{ if(isblank($data_sbit[1]) or $data_sbit[1] == "0") { $str .= "\n"; } else { $str .= "\n"; } } } else { $str .= "\n"; } } $str .="\n"; return $str; } //-------------------------------------------------------------------------------- // 선택 화면 만들기 //-------------------------------------------------------------------------------- function make_select2($name,$codename,$data){ $data_bit = explode("/",$data); $data_bit = array_diff($data_bit, array('')); $str = "\n\n"; return $str; } // ---------------------------------------------------------- // 옵션재고변경 (2.1방식) // ---------------------------------------------------------- function set_option_stock_modify($ps_goid="",$num="1",$option_name="",$status="down"){ global $connect,$morning_goods_table,$ERROR_MALL_GOODS_OPTION_NUM; $list = hd_fetch(hd_query("select * from $morning_goods_table where uid = '$ps_goid'")); $goods_option_bit = explode("/",$list[goods_option8_content]); for($i=0 ; $i"; } return $str; } //-------------------------------------------------------------------------------- // DOT 이미지 .. 생성 //-------------------------------------------------------------------------------- function make_dot($image_link,$height="1"){ $str = "
\n"; return $str; } //-------------------------------------------------------------------------------- // 페이지별 불러오기 // $use_navi 이 1이면 네비게이션 보임 // $use_table 이 1이면 테이블 있는 페이지 //-------------------------------------------------------------------------------- function show_page_view($ps_pname="page_company",$use_navi="0",$use_table="0"){ global $connect,$morning_page_table,$g_check_rank,$g_check_id,$ERROR_MALL_GRANT_PAGE,$ERROR_MALL_GRANT_PAGE_MEMBER; $pa_list = hd_fetch(hd_query("select * from $morning_page_table where page_name = '$ps_pname'")); // 페이지 출입제한 if($g_check_rank < $pa_list[page_grant]) { if(!$g_check_id) { error_msg("$ERROR_MALL_GRANT_PAGE","m_login.php?url=m_page.php&ps_pname=$ps_pname&ps_page=$ps_pname"); } else { error_msg("$ERROR_MALL_GRANT_PAGE_MEMBER",""); } } //모바일 if($_SESSION["mobile_sess"] == "on" && strlen($pa_list[page_body_mobile]) > 5){ $pa_list[page_body] = $pa_list[page_body_mobile]; } if($pa_list[use_html]) { $page_body = $pa_list[page_body]; } else { $page_body = autolink(make_br(del_teg($pa_list[page_body]))); } if($use_navi) { $status_text = make_navigation("$pa_list[page_subject]","m_page.php?ps_pname=$ps_pname"); $page_body = str_replace("{navi_text}","",$page_body); } if($pa_list[uid] and $use_table) { $str = "
$page_body
"; } elseif($pa_list[uid] and !$use_table) { $str = "$page_body"; } else { return 0; } return $str; } //-------------------------------------------------------------------------------- // 네비게이션 만들기 // 네비게이션 이미지화및 색 변경때 이부분을 수정 하시면 됩니다. //-------------------------------------------------------------------------------- function make_navigation($navi_text,$now_url="",$ps_ctid="0",$category="0"){ global $g_main_html,$ps_ctid,$morning_category_table,$g_page_name,$_SESSION; $str = "
  • HOME
  • "; if($g_page_name == "m_mall_list.php" || $g_page_name == "m_mall_detail.php"){ if($category == "1") { $str .= category_navigation($ps_ctid); } $select_category_name = hd_fetch(hd_query("select category_name,category_id from $morning_category_table where category_id = '$ps_ctid'")); $select_temp = ""; //$str .= $select_temp; //select형태일때.. $str .= $select_text_temp; //text형태일때.. }else{ $str .= "
  • ".$navi_text."
  • "; } //-- 디자인코딩 -- $str = "
      $str
    "; //--// 디자인코딩 -- //모바일일때.. if($_SESSION["mobile_sess"] == "on"){ $str = make_navigation_mobile($navi_text,$now_url,$ps_ctid,$category); $str="
    $navi_text
    "; } return $str; } //-------------------------------------------------------------------------------- // 모바일용 네이게이션 //-------------------------------------------------------------------------------- function make_navigation_mobile($navi_text,$now_url,$ps_ctid="0",$category="0"){ global $g_main_html; $str = "HOME > "; if($category == "1") { $str .= category_navigation_mobile($ps_ctid); } $str .= "$navi_text"; return $str; } //-------------------------------------------------------------------------------- // 게시판 내용 간단 하게 보여주기 //-------------------------------------------------------------------------------- function show_board_list($ps_db="notice",$board_name="morning_bmain_notice",$list_num="5",$lan_cut="30",$mini_image=">",$where_sql="",$order_sql="order by headnum asc"){ global $connect; $query = "select * from $board_name $where_sql $order_sql limit 0, $list_num"; $mi_result = hd_query("$query"); while($mi_list = hd_fetch($mi_result)) { $mi_list[board_subject] = cut_str($mi_list[board_subject],"$lan_cut",".."); $str .= $mini_image." $mi_list[board_subject]
    "; } return $str; } //-------------------------------------------------------------------------------- // 게시판 내용 간단 하게 보여주기 2 -- 백그라운드 이미지 -- 첨부파일까지 .. //-------------------------------------------------------------------------------- function show_board_list2($ps_db="notice",$board_name="morning_bmain_notice",$list_num="5",$lan_cut="30",$where_sql="",$order_sql="order by headnum asc",$list_height="24",$back_image="background=.image/back_006.gif",$mini_image=">",$new_image="new"){ global $connect; $query = "select * from $board_name $where_sql $order_sql limit 0, $list_num"; $mi_result = hd_query("$query"); $str = ""; while($mi_list = hd_fetch($mi_result)) { $mi_list[board_subject] = cut_str($mi_list[board_subject],"$lan_cut",".."); // 글내용을 넣고 싶으면 밑에것을 풀면 됩니다. // $show_body = "
    ".cut_str($mi_list[board_body],"200",".."); if($mini_image == "1" and $mi_list[board_fname1]) { $mini_image = ""; } elseif($mini_image == "2" and $mi_list[board_fname2]) { $mini_image = ""; } $str .= ""; } $str .= "
    "; $str .= $mini_image." $mi_list[board_subject] $show_body"; $str .= "
    "; return $str; } //-------------------------------------------------------------------------------- // 게시판 내용 간단 하게 보여주기 2 -- 백그라운드 이미지 -- 첨부파일까지 .. //-------------------------------------------------------------------------------- function show_board_list3($fc_db,$fc_dir,$fc_skin,$fc_num,$fc_scut,$fc_ccut,$fc_width,$fc_height,$fc_date,$fc_wsql,$fc_osql,$fc_mallskin="",$css_font="",$limit="0") { global $connect,$ERROR_BOARD_NOTICE_SKIN,$g_skin_link,$g_now_time,$cf_board,$morning_badmin_table; if(!$fc_db) { $fc_db ="notice";} if(!$fc_skin) { $fc_skin="./news_skin/basic_skin/news_list.html";} if(!$fc_num) { $fc_num="5";} if(!$fc_scut) { $fc_scut="30";} if(!$fc_ccut) { $fc_ccut="200";} if(!$fc_width) { $fc_width="100";} if(!$fc_height) { $fc_height="100";} if(!$fc_date) { $fc_date="Y/m/d";} if(!$fc_wsql) { $fc_wsql = " where headnum > 1000 ";} if(!$fc_osql) { $fc_osql = " order by headnum desc ";} $str = get_read_file($fc_skin); if(!$str) { error_msg("$ERROR_BOARD_NOTICE_SKIN"); } $tmpstr = explode("{LOOP}",$str); $header = $tmpstr[0]; $tmpstr2 = explode("{/LOOP}",$tmpstr[1]); $old_loop = $tmpstr2[0]; $loop = $tmpstr2[0]; $bottom = $tmpstr2[1]; //통합게시판 최근불러오기 (답글은 지원하지 않음) //if(@eregi(",",$fc_db)){ if(preg_match("/,/",$fc_db)){ $fc_db_arr = explode(",",$fc_db); $db_where = ""; for($k=0;$k $alist[board_name_code], "board_title" => $alist[board_title] ); } $fbbs_row_total = 0; $search_sql = "where headnum > 0 and depth < 1 order by headnum limit 10"; for($k=0;$k < count($bbs_arr);$k++){ $db_table_name = $bbs_arr[$k][board_name_code]; $board_title = $bbs_arr[$k][board_title]; $fc_db = $db_table_name; $result = hd_query("select * from morning_bmain_$db_table_name $search_sql"); while($mi_list = hd_fetch($result)){ $mi_list[board_subject] = stripslashes(cut_str(del_teg($mi_list[board_subject]),$fc_scut)); $mi_list[board_body] = cut_str(del_teg(strip_tags($mi_list[board_body])),$fc_ccut); $mdate = date($fc_date, $mi_list[register_date]); $re = ""; for($i=0;$i<$mi_list[depth];$i++){ $re .= " "; } if($mi_list[depth] > 0){$re = $re."[답변] ";} $inner_cn = morning_counter("morning_bcomment_".$fc_db,"buid = '$mi_list[uid]'"); if($inner_cn){$comment_num = "[".$inner_cn."]";}else{$comment_num = "";} //오늘 등록된 글 $back1time = $mi_list[register_date]+60*60*24; if($g_now_time < $back1time){ $newicon="[NEW]";}else{ $newicon=""; } //오늘 등록된 컴멘트 $querycom = "select * from morning_bcomment_$fc_db where buid='$mi_list[uid]' order by register_date desc"; $listcom = hd_fetch(hd_query($querycom)); $back1time = $listcom[register_date]+60*60*24; if($g_now_time < $back1time){ $newicon="[NEW]";} //카테고리정보 $queryb = "select * from morning_bcategory_".$fc_db; $resultb = hd_query($queryb); while($ca_listb = hd_fetch($resultb)) { $show_category_array[$ca_listb[uid]] = "$ca_listb[category_name]"; } unset($show_category_list); if($mi_list[board_category] and $show_category_array[$mi_list[board_category]]) { $show_category_list = "[".$show_category_array[$mi_list[board_category]]."]"; } $link_list = $fc_dir."m_view.php?ps_db=$fc_db&ps_boid=$mi_list[uid]"; //이미지처리 $image1 = ""; $image2 = ""; $mi_list[board_fname1] = file_name_kor($mi_list[board_fname1]); $mi_list[board_fname2] = file_name_kor($mi_list[board_fname2]); if($mi_list[board_fname1]){ $file_ex = substr(strrchr($mi_list[board_fname1],"."),1); $file_ex = strtolower($file_ex); if($file_ex == "jpg" or $file_ex == "gif" or $file_ex == "jpeg" or $file_ex == "png" or $file_ex == "bmp") $image1 = ""; else $image1=""; } if($mi_list[board_fname2]){ $file_ex = substr(strrchr($mi_list[board_fname2],"."),1); $file_ex = strtolower($file_ex); if($file_ex == "jpg" or $file_ex == "gif" or $file_ex == "jpeg" or $file_ex == "png" or $file_ex == "bmp") $image2 = ""; else $image2=""; } //에디터 썸네일 if(!$mi_list[board_fname1] && $mi_list[cheditor_file]){ $temp_edimg = explode("‡",$mi_list[cheditor_file]); $edimg = explode("†",$temp_edimg[0]); if(trim($edimg[3])){ $image1 = ""; } } $fbbs_row[$fbbs_row_total] = array( "register_date"=>$mi_list[register_date], "db_name"=>$db_table_name, "board_title"=>$board_title, "uid"=>$mi_list[uid], "board_id"=>$mi_list[board_id], "board_name"=>$mi_list[board_name], "board_subject"=>$mi_list[board_subject], "board_body" => $mi_list[board_body], "use_secret" =>$mi_list[use_secret], "depth" => $mi_list[depth], "board_hit" => $mi_list[board_hit], "image1" => $image1, "image2" => $image2, "comment_num" => $comment_num, "show_category_list" => $show_category_list, "link_list" => $link_list, "mdate" => $mdate ); $fbbs_row_total++; } } if($fbbs_row){rsort($fbbs_row);} //날짜순으로 정렬 for($i=0;$i<$fc_num;$i++){ $db_name = $fbbs_row[$i][db_name]; $uid = $fbbs_row[$i][uid]; $board_id = $fbbs_row[$i][board_id]; $board_name = $fbbs_row[$i][board_name]; $board_subject = $fbbs_row[$i][board_subject]; $board_body = $fbbs_row[$i][board_body]; $use_secret = $fbbs_row[$i][use_secret]; $register_date = $fbbs_row[$i][register_date]; $depth = $fbbs_row[$i][depth]; $board_hit = $fbbs_row[$i][board_hit]; $board_title = $fbbs_row[$i][board_title]; $comment_num = $fbbs_row[$i][comment_num]; $image1 = $fbbs_row[$i][image1]; $image2 = $fbbs_row[$i][image2]; $show_category_list = $fbbs_row[$i][show_category_list]; $link_list = $fbbs_row[$i][link_list]; $mdate = $fbbs_row[$i][mdate]; $loop = str_replace("{NAME}",$board_name,$loop); $loop = str_replace("{MALLSKIN}",$fc_mallskin,$loop); $loop = str_replace("{CATEGORY}",$show_category_list,$loop); $loop = str_replace("{NEW}",$newicon,$loop); $loop = str_replace("{SUBJECT}","".$board_subject."",$loop); $loop = str_replace("{CONTENT}","".$board_body."",$loop); $loop = str_replace("{COMMENT}",$comment_num,$loop); $loop = str_replace("{DATE}",$mdate,$loop); $loop = str_replace("{IMAGE1}","".$image1."",$loop); $loop = str_replace("{IMAGE2}","".$image2."",$loop); $sum_loop .= $loop."\n"; $loop = $old_loop; } return $header.$sum_loop.$bottom; exit; } $mi_result = hd_query("select * from morning_bmain_$fc_db $fc_wsql $fc_osql limit $limit, $fc_num"); // 헤더용이 별도 일경우 //if(@eregi("\{NEWS_",$header)) { if(preg_match("/\{NEWS_/",$header)){ $mi_list = hd_fetch($mi_result); $file_ex = substr(strrchr($mi_list[board_fname1],"."),1); $file_ex = strtolower($file_ex); if($file_ex == "jpg" or $file_ex == "gif" or $file_ex == "jpeg" or $file_ex == "png" or $file_ex == "bmp") $image1 = ""; else $image1=""; $file_ex = substr(strrchr($mi_list[board_fname2],"."),1); $file_ex = strtolower($file_ex); if($file_ex == "jpg" or $file_ex == "gif" or $file_ex == "jpeg" or $file_ex == "png" or $file_ex == "bmp") $image2 = ""; else $image2=""; $mi_list[board_subject] = stripslashes(cut_str(del_teg($mi_list[board_subject]),$fc_scut)); $mi_list[board_body] = stripslashes(cut_str(del_teg($mi_list[board_body]),$fc_ccut)); $mdate = date($fc_date, $mi_list[register_date]); $link_list = $fc_dir."m_view.php?ps_db=$fc_db&ps_boid=$mi_list[uid]"; $header = str_replace("{NEWS_NAME}",$mi_list[board_name],$header); $header = str_replace("{NEWS_SUBJECT}","".$mi_list[board_subject]."",$header); $header = str_replace("{CONTENT}","".$mi_list[board_body]."",$header); $header = str_replace("{DATE}",$mdate,$header); $header = str_replace("{IMAGE1}","".$image1."",$header); $header = str_replace("{IMAGE2}","".$image2."",$header); } while($mi_list = hd_fetch($mi_result)) { $mi_list[board_fname1] = file_name_kor($mi_list[board_fname1]); $mi_list[board_fname2] = file_name_kor($mi_list[board_fname2]); if($mi_list[board_fname1]){ $file_ex = substr(strrchr($mi_list[board_fname1],"."),1); $file_ex = strtolower($file_ex); if($file_ex == "jpg" or $file_ex == "gif" or $file_ex == "jpeg" or $file_ex == "png" or $file_ex == "bmp") $image1 = ""; else $image1=""; } if($mi_list[board_fname2]){ $file_ex = substr(strrchr($mi_list[board_fname2],"."),1); $file_ex = strtolower($file_ex); if($file_ex == "jpg" or $file_ex == "gif" or $file_ex == "jpeg" or $file_ex == "png" or $file_ex == "bmp") $image2 = ""; else $image2=""; } //에디터 썸네일 if(!$mi_list[board_fname1] && $mi_list[cheditor_file]){ $temp_edimg = explode("‡",$mi_list[cheditor_file]); $edimg = explode("†",$temp_edimg[0]); if(trim($edimg[3])){ $image1 = ""; } } $mi_list[board_subject] = stripslashes(cut_str(del_teg($mi_list[board_subject]),$fc_scut)); $mi_list[board_body] = cut_str(del_teg(strip_tags($mi_list[board_body])),$fc_ccut); $mdate = date($fc_date, $mi_list[register_date]); $re = ""; for($i=0;$i<$mi_list[depth];$i++){ $re .= " "; } if($mi_list[depth] > 0){$re = $re."[답변] ";} $inner_cn = morning_counter("morning_bcomment_".$fc_db,"buid = '$mi_list[uid]'"); if($inner_cn){$comment_num = "[".$inner_cn."]";}else{$comment_num = "";} //오늘 등록된 글 $back1time = $mi_list[register_date]+60*60*24; if($g_now_time < $back1time){ $newicon="[NEW]";}else{ $newicon=""; } //오늘 등록된 컴멘트 $querycom = "select * from morning_bcomment_$fc_db where buid='$mi_list[uid]' order by register_date desc"; $listcom = hd_fetch(hd_query($querycom)); $back1time = $listcom[register_date]+60*60*24; if($g_now_time < $back1time){ $newicon="[NEW]";} //카테고리정보 $queryb = "select * from morning_bcategory_".$fc_db; $resultb = hd_query($queryb); while($ca_listb = hd_fetch($resultb)) { $show_category_array[$ca_listb[uid]] = "$ca_listb[category_name]"; } unset($show_category_list); if($mi_list[board_category] and $show_category_array[$mi_list[board_category]]) { $show_category_list = "[".$show_category_array[$mi_list[board_category]]."]"; } $link_list = $fc_dir."m_view.php?ps_db=$fc_db&ps_boid=$mi_list[uid]"; $loop = str_replace("{NAME}",$mi_list[board_name],$loop); $loop = str_replace("{MALLSKIN}",$fc_mallskin,$loop); $loop = str_replace("{CATEGORY}",$show_category_list,$loop); $loop = str_replace("{RE}",$re,$loop); $loop = str_replace("{NEW}",$newicon,$loop); $loop = str_replace("{SUBJECT}","".$mi_list[board_subject]."",$loop); $loop = str_replace("{CONTENT}","".$mi_list[board_body]."",$loop); $loop = str_replace("{COMMENT}",$comment_num,$loop); $loop = str_replace("{DATE}",$mdate,$loop); $loop = str_replace("{IMAGE1}","".$image1."",$loop); $loop = str_replace("{IMAGE2}","".$image2."",$loop); $sum_loop .= $loop."\n"; $loop = $old_loop; } return $header.$sum_loop.$bottom; } //-------------------------------------------------------------------------------- // 배너처리 //-------------------------------------------------------------------------------- function get_banner_list($status="index_left",$num="1",$limit_width="0",$limit_height="0",$limit_rows="1",$cellpadding="0",$cellspacing="0",$st_height="0") { global $connect,$morning_banner_table,$g_now_time; if($limit_rows < 1) $limit_rows = "1"; $co = 0; $width_per = (int)(100 / $limit_rows); $search_sql = " where banner_point = '$status' and start_date < '$g_now_time' and end_date > '$g_now_time' "; $result = hd_query("select * from $morning_banner_table $search_sql order by view_num desc limit 0,$num "); $show_banner = "\n"; while($list = hd_fetch($result)) { $ii++; $list[register_date] = date("Y-m-d",$list[register_date]); $list[start_date] = date("Y-m-d",$list[start_date]); $list[end_date] = date("Y-m-d",$list[end_date]); if($limit_width < $list[banner_width] and $limit_width) { $list[banner_width] = $limit_width;} if($limit_height < $list[banner_height] and $limit_height) { $list[banner_height] = $limit_height;} if(!$list[banner_target]) $list[banner_target] = "_self"; if($list[banner_file1]) { if($list[banner_url]) { $show_file = ""; } else { $show_file = ""; } } elseif($list[banner_link1]) { if($list[banner_url]) { $show_file = ""; } else { $show_file = ""; } } else { $show_file = ""; } if($st_height){ $padding = "style='padding-bottom:$st_height"."px'"; }else{ $padding = "style='padding:$cellspacing"."px'"; } // 배너 테이블에 넣기 if($show_file) { $co++; $mod_co = $co%$limit_rows; if($mod_co == "1"){ $show_banner .= "\n"; } $show_banner .= "\n"; if($mod_co == "0") { $show_banner .= "\n"; } } } while($mod_co > 0) { $co++; $mod_co = $co%$limit_rows; if($mod_co == "1") $show_banner .= "\n"; $show_banner .= "\n"; if($mod_co == "0") $show_banner .= "\n"; } $show_banner .= "
    $show_file
     
    \n"; if($ii > 0){ return $show_banner; } } //-------------------------------------------------------------------------------- // 이미지 로드 //-------------------------------------------------------------------------------- function LoadImage($fName) { $file_ext = strtolower(substr(strrchr($fName,"."), 1)); switch ($file_ext) { case "jpg": case "jpeg": $img = @ImageCreateFromJPEG ($fName); break; case "gif": $img = @ImageCreateFromGIF ($fName); break; case "png": $img = @ImageCreateFromPNG ($fName); break; } if (!$img) { $img = ImageCreate (150, 30); $bgc = ImageColorAllocate ($img, 255, 255, 255); $tc = ImageColorAllocate ($img, 0, 0, 0); ImageFilledRectangle ($img, 0, 0, 150, 30, $bgc); ImageString ($img, 1, 5, 5, "Error loading $fName", $tc); } return $img; } //-------------------------------------------------------------------------------- // 기본 썸네일 만들기 //-------------------------------------------------------------------------------- function thumbnail($file, $max_width, $max_height) { $img_info = getImageSize($file); if($img_info[2] == 1) { $src_img = ImageCreateFromGif($file); }elseif($img_info[2] == 2){ $src_img = ImageCreateFromJPEG($file); }elseif($img_info[2] == 3){ $src_img = ImageCreateFromPNG($file); }else{ return 0; } $img_width = $img_info[0]; $img_height = $img_info[1]; if($img_width > $max_width || $img_height > $max_height) { if($img_width == $img_height) { $dst_width = $max_width; $dst_height = $max_height; }elseif($img_width > $img_height){ $dst_width = $max_width; $dst_height = ceil(($max_width / $img_width) * $img_height); }else{ $dst_height = $max_height; $dst_width = ceil(($max_height / $img_height) * $img_width); } }else{ $dst_width = $img_width; $dst_height = $img_height; } if($dst_width < $max_width) $srcx = ceil(($max_width - $dst_width)/2); else $srcx = 0; if($dst_height < $max_height) $srcy = ceil(($max_height - $dst_height)/2); else $srcy = 0; if($img_info[2] == 1) { $dst_img = imagecreate($max_width, $max_height); }else if($img_info[2] == 2){ $dst_img = imagecreatetruecolor($max_width, $max_height); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $max_width, $max_height, ImageSX($src_img), ImageSY($src_img)); imagejpeg($dst_img, $file, 100); return $dst_img; }else{ $dst_img = imagecreatetruecolor($max_width, $max_height); } $bgc = ImageColorAllocate($dst_img, 255, 255, 255); //색상 ImageFilledRectangle($dst_img, 0, 0, $max_width, $max_height, $bgc); ImageCopyResampled($dst_img, $src_img, $srcx, $srcy, 0, 0, $dst_width, $dst_height, ImageSX($src_img),ImageSY($src_img)); return $dst_img; } //-------------------------------------------------------------------------------- // 이미지 썸네일 만들기 //-------------------------------------------------------------------------------- function thumbnail_1 ($filepath,$width="",$height="") { /* 이미지 가로 세로 자르기 위해서 if($check_cut == "0" and $width and $height) { $file_base = basename($filepath); $dst_img = thumb_cut ("$filepath","$width","$height"); make_imagefile ($dst_img,"temp_$file_base","100"); $filepath = "temp_".$file_base; } */ $size=getimagesize($filepath); //원본 이미지사이즈를 구함 if(!$height) { $height=($size[1]*$width)/$size[0]; if($size[0] < $width) { $width = $size[0]; $height = $size[1]; } } if(!$width) { $width=($size[0]*$height)/$size[1]; if($size[1] < $height) { $width = $size[0]; $height = $size[1]; } } $shr_rateX = $width / $size[0]; $shr_rateY = $height / $size[1]; $base = ($shr_rateX <= $shr_rateY) ? "y" : "x"; $src_im=LoadImage($filepath); if($base == "y") { $new_width=round(($size[0] * $height)/$size[1]); // (가로크기 * 새로운 세로 크기) / 세로크기 $offsetX = round(($new_width - $width) / 2); //각각 좌우로 잘라낼 길이 $offsetY = 0; } if($base == "x") { $size=getimagesize($filepath); //원본 이미지 사이즈 구함 $new_height=round(($size[1] * $width)/$size[0]); // (세로크기 * 새로운 가로크기) / 가로크기 $offsetX = 0; $offsetY = round(($new_height - $height) / 2); // 각각 상하로 잘라낼 길이 } //$dst_img=ImageCreate($width,$height); //결과물 이미지 생성 $dst_img=ImageCreateTrueColor($width,$height); //결과물 이미지 생성 imagecopyresampled($dst_img,$src_im,0,0,$offsetX,$offsetY,$width,$height,ImageSX($src_im)-$offsetX,ImageSY($src_im)-$offsetY); //만들기 //ImageCopyResized($dst_img,$src_im,0,0,$offsetX,$offsetY,$width,$height,ImageSX($src_im)-$offsetX,ImageSY($src_im)-$offsetY); //만들기 @file_unlink("temp_$file_base"); return $dst_img; } //-------------------------------------------------------------------------------- // 배송추적 //-------------------------------------------------------------------------------- function besong_ch($name,$delivery_num="") { global $connect,$g_besong_chu,$cf_delivery_url,$cf_delivery_url_company; if(!$name){$name="$cf_delivery_url_company";} if($name == "1"){ $besong_chu = "http://d2d.ilogen.com/d2d/delivery/invoice_search_popup.jsp?invoiceNum=$delivery_num&viewType=type1";} if($name == "2"){ $besong_chu = "http://www.kgbls.co.kr/tracing.asp?number=$delivery_num";} if($name == "3"){ $besong_chu = "http://nexs.cjgls.com/web/service02_01.jsp?slipno=$delivery_num";} //if($name == "4"){ $besong_chu = "https://tracker.delivery/#/kr.hanjin/$delivery_num";} if($name == "4"){ $besong_chu = "https://hanex.hanjin.co.kr/kor/CMS/DeliveryMgr/WaybillResult.do?mCode=MN038&wblnum=$delivery_num&schLang=KR&wblnumText=$delivery_num";} if($name == "5"){ $besong_chu = "https://service.epost.go.kr/trace.RetrieveDomRigiTraceList.comm?ems_gubun=E&sid1=".str_replace("-","",$delivery_num)."&POST_CODE=&mgbn=trace&traceselect=1&target_command=&JspURI=&postNum=".str_replace("-","",$delivery_num);} if($name == "6"){ $besong_chu = "https://www.doortodoor.co.kr/parcel/doortodoor.do?fsp_action=PARC_ACT_002&fsp_cmd=retrieveInvNoACT&invc_no=".str_replace("-","",$delivery_num);} if($name == "7"){ $besong_chu = "http://www.etranet.co.kr/branch/chase/listbody.html?a_gb=center&fr_slipno=$delivery_num&a_cd=4&a_item=0";} if($name == "8"){ $besong_chu = "https://www.dongbups.com/newHtml/delivery/dvsearch.jsp?mode=SEARCH&sellNum=Y&search_type=1&search_item_no=$delivery_num";} if($name == "9"){ $besong_chu = "https://www.doortodoor.co.kr/parcel/doortodoor.do?fsp_action=PARC_ACT_002&fsp_cmd=retrieveInvNoACT&invc_no=$delivery_num";} if($name == "10"){ $besong_chu = "http://www.loexe.co.kr/customer/cus_trace_02.asp?searchMethod=I&invc_no=$delivery_num";} if($name == "11"){ $besong_chu = "http://www.yellowcap.co.kr/custom/inquiry_result.asp?INVOICE_NO=$delivery_num";} if($name == "12"){ $besong_chu = "http://www.ajuthankyou.com:8080/jsp/expr1/web_view_link_sheetno3.jsp?gubun=1&sheetno=$delivery_num";} if($name == "13"){ $besong_chu = "https://www.lotteglogis.com/home/reservation/tracking/linkView?InvNo=$delivery_num";} if($name == "14"){ $besong_chu = "http://ptop.sedex.co.kr:8080/jsp/tr/detailSheet.jsp?iSheetNo=$delivery_num";} if($name == "15"){ $besong_chu = "http://hanarologis.com/branch/chase/listbody.html?a_gb=center&a_cd=4&a_item=0&fr_slipno=$delivery_num";} if($name == "16"){ $besong_chu = "http://www.cyber1001.co.kr/kor/taekbae/HTrace.jsp?transNo=$delivery_num";} if($name == "17"){ $besong_chu = "http://home.daesinlogistics.co.kr/daesin/jsp/d_freight_chase/d_general_process2.jsp?billno1=".substr($delivery_num,0,4)."&billno2=".substr($delivery_num,4,3)."&billno3=".substr($delivery_num,7,6)."";} if($name == "18"){ $besong_chu = "http://kdexp.com/basicNewDelivery.kd?barcode=$delivery_num";} if($name == "19"){ $besong_chu = "http://service.epost.go.kr/trace.RetrieveEmsTraceTibco.postal?ems_gubun=E&POST_CODE=$delivery_num";} if($name == "20"){ $besong_chu = "https://www.cvsnet.co.kr/reservation-inquiry/delivery/index.do?dlvry_type=domestic&invoice_no=$delivery_num&srch_type=01";} if($name == "21"){ $besong_chu = "http://kglogis.co.kr/contents/waybill.jsp?item_no=$delivery_num&waybill_num=$delivery_num";} if($name == "22"){ $besong_chu = "http://www.kunyoung.com/goods/goods_01.php?mulno=$delivery_num";} if($name == "23"){ $besong_chu = "https://www.idreamlogis.com/delivery/delivery_result.jsp?item_no=$delivery_num";} if($name == "24"){ $besong_chu = "https://www.cupost.co.kr/postbox/delivery/localResult.cupost?invoice_no=$delivery_num";} if($name < 1){ $besong_chu = "$cf_delivery_url";} return $besong_chu; } //-------------------------------------------------------------------------------- // 이름 팝업 //-------------------------------------------------------------------------------- function name_popup($ly_name,$member_id,$ly_width="0",$ly_height="0",$mail_name="",$mail_email="") { global $connect,$morning_member_table,$url,$ps_page,$g_skin_link,$ps_db,$ps_category,$ps_boid,$g_check_rank,$cf_mall_install_dir; $dir = "/".$cf_mall_install_dir; if(!$cf_mall_install_dir) $dir = ""; $querym = "select * from $morning_member_table where member_id ='$member_id'"; $listm = hd_fetch(hd_query($querym)); if($mail_name && $mail_email){ $show_email = mango_encode($mail_email); $ps_rname = $mail_name; }else{ $show_email = mango_encode($listm[member_email]); $ps_rname = $list[member_name]; } $ps_rname = avoid_crack($ps_rname); $ly_view = " "; return $ly_view; } // 파이널버전 추가 2.1.1 // ---------------------------------------------------------- // 포인트비율적용 // ---------------------------------------------------------- function get_point($list,$sale_price="0"){ global $connect,$cf_point_percent_chk,$cf_point_percent,$cf_account_method,$g_check_id,$g_check_rank,$morning_cart_table; $show_point = $list[goods_point]; //포인트 비율적용 if($list[goods_point] <= 0 && $cf_point_percent_chk && $cf_point_percent > 0 && $cf_account_method > "3"){ $show_point = $sale_price * $cf_point_percent*0.01; } if($list[goods_point] == "1") $show_point = 0; return $show_point; } //-------------------------------------------------------------------------------- // 회원등급별가격설정 //-------------------------------------------------------------------------------- function price_info($list,$ps_basic_price="",$ps_add_price="",$cart_num="1"){ global $connect,$cf_point_percent_chk,$cf_point_percent,$cf_account_method,$g_check_id,$g_check_rank,$morning_cart_table; if($list[goods_point] and $cf_account_method > "3") { $show_point = $list[goods_point]*$cart_num; }else { $show_point = ""; } //////////////////////////////////////////////////////////////// //회원별차등가격 $sale_price = $list[goods_sale_price]; if($list[goods_sale_price1] > 0 && 3 <= $g_check_rank){ $sale_price = $list[goods_sale_price1]; } if($list[goods_sale_price2] > 0 && 4 <= $g_check_rank){ $sale_price = $list[goods_sale_price2]; } if($list[goods_sale_price3] > 0 && 4 < $g_check_rank){ $sale_price = $list[goods_sale_price3]; } $sale_price_origin = $sale_price; //옵션빼고 본상품가격 //옵션가격 총합계금액을 뽑기 (장바구니 cart_price 에 담음) if($ps_basic_price > 0){ $sale_price = $ps_basic_price*$cart_num; //본품옵션이 있을경우 }else{ $sale_price = $sale_price*$cart_num; //본품옵션이 없을경우 } if($ps_add_price > 0) $sale_price = $sale_price+$ps_add_price; //추가가격옵션 //포인트 비율적용 $show_point = get_point($list,$sale_price); if($list[goods_market_price] > 0 && $sale_price_origin > 0){ $per = round(100-($sale_price/$list[goods_market_price])*100); $per_text = $per."%할인"; } $row = array ( price => "$sale_price", price_origin => "$sale_price_origin", point => "$show_point", per => "$per", per_text => "$per_text" ); return $row; } //-------------------------------------------------------------------------------- // 상품리스트출력 //-------------------------------------------------------------------------------- function goods_list($list,$_width="",$_height="",$_namecut="40",$_advancecut="200"){ global $connect,$g_skin_link,$cf_point_percent_chk,$cf_point_percent,$cf_account_method,$cf_mall_form,$g_check_id,$g_check_rank,$cf_stock_use; unset($show_file1); unset($show_addoption1); unset($show_addoption2); unset($show_addoption3); unset($show_addoption4); unset($show_stock); unset($free_delivery); unset($bank_use); unset($sale_price); unset($price_text); unset($point_text); $no_image = "no_image_200.gif"; //가격,적립금정보 가져오기 $p_row = price_info($list); //썸네일이미지 if($_width){$text_width = "width=\"$_width\"";} if($_height){$text_height = "height=\"$_height\"";} $show_file1 = ""; $show_file2 = ""; $show_file3 = ""; $goods_file1 = file_name_kor($list[goods_file1]); $goods_file2 = file_name_kor($list[goods_file2]); $goods_file3 = file_name_kor($list[goods_file3]); if($list[goods_addoption1]) { $show_addoption1 = " "; } //옵션아이콘1 if($list[goods_addoption2]) { $show_addoption2 = " "; } //옵션아이콘2 if($list[goods_addoption3]) { $show_addoption3 = " "; } //옵션아이콘3 if($list[goods_addoption4]) { $show_addoption4 = " "; } //옵션아이콘4 if($list[goods_addoption5]) { $show_addoption5 = " "; } //옵션아이콘5 if($list[goods_addoption6]) { $show_addoption6 = " "; } //옵션아이콘6 if($list[goods_addoption7]) { $show_addoption7 = " "; } //옵션아이콘7 if($list[goods_addoption8]) { $show_addoption8 = " "; } //옵션아이콘8 if($list[goods_stock] < 1 && $cf_stock_use == "1"){ $show_stock = " ";}//재고없음아이콘 if($list[goods_free_delivery]){ $free_delivery = " "; }//무료배송아이콘 if($list[goods_bankuse]){ $bank_use = " "; }//현금전용아이콘 $goods_name = stripslashes(cut_str($list[goods_name],$_namecut));//상품명자르기 $goods_advance = stripslashes(cut_str($list[goods_advance],$_advancecut));//간략설명자르기 if($list[goods_market_price] > 0){$market_price_text = make_price_format($list[goods_market_price])."원";} if($p_row[price] > 0){$price_text = make_price_format($p_row[price])."원";}else{$price_text="가격문의";} if($p_row[point] > 0){$point_text = make_price_format($p_row[point])."점";} if(($cf_mall_form == "1" && !$g_check_id) or $list[goods_grant] > $g_check_rank){ $price_text="회원전용"; } //후기수량 $review_num = morning_counter("morning_gcomment_table"," where guid = '$list[uid]'","uid"); $row = array ( uid => "$list[uid]", goods_category => "$list[goods_category]", market_price => "$list[goods_market_price]", market_price_text => "$market_price_text", price => "$p_row[price]", price_text => "$price_text", point => "$p_row[point]", point_text => "$point_text", goods_name => "$goods_name", goods_brand => "$list[goods_brand]", goods_company => "$list[goods_company]", goods_advance => "$goods_advance", show_file1 => "$show_file1", show_file2 => "$show_file2", show_file3 => "$show_file3", goods_file1 => "$goods_file1", goods_file2 => "$goods_file2", goods_file3 => "$goods_file3", icon_option1 => "$show_addoption1", icon_option2 => "$show_addoption2", icon_option3 => "$show_addoption3", icon_option4 => "$show_addoption4", icon_option5 => "$show_addoption5", icon_option6 => "$show_addoption6", icon_option7 => "$show_addoption7", icon_option8 => "$show_addoption8", icon_delivery => "$free_delivery", icon_bank => "$bank_use", icon_stock => "$show_stock", view_09 => "$p_row[view_09]", per => "$p_row[per]", per_text => "$p_row[per_text]", gosi_body => "$list[gosi_body]", gosi_subject => "$list[gosi_subject]", goods_option8_name => "$list[goods_option8_name]", goods_option8_content => "$list[goods_option8_content]", goods_option1_name => "$list[goods_option1_name]", goods_option1_content => "$list[goods_option1_content]", goods_option2_name => "$list[goods_option2_name]", goods_option2_content => "$list[goods_option2_content]", goods_option3_name => "$list[goods_option3_name]", goods_option3_content => "$list[goods_option3_content]", goods_option4_name => "$list[goods_option4_name]", goods_option4_content => "$list[goods_option4_content]", goods_option5_name => "$list[goods_option5_name]", goods_option5_content => "$list[goods_option5_content]", goods_option6_name => "$list[goods_option6_name]", goods_option6_content => "$list[goods_option6_content]", goods_option7_name => "$list[goods_option7_name]", goods_option7_content => "$list[goods_option7_content]", goods_per_person => "$list[goods_per_person]", goods_cooking_time => "$list[goods_cooking_time]", goods_total_round => "$list[goods_total_round]", goods_total_amount => "$list[goods_total_amount]", review_num => $review_num ); return $row; } function goods_option_checker($mg_list){ if( ($mg_list[goods_option8_name] && $mg_list[goods_option8_content] && strlen($mg_list[goods_option8_content]) > 4) or (trim($mg_list[goods_option1_name]) && $mg_list[goods_option1_content] && strlen($mg_list[goods_option1_content]) > 4) or (trim($mg_list[goods_option2_name]) && $mg_list[goods_option2_content] && strlen($mg_list[goods_option2_content]) > 4) or (trim($mg_list[goods_option3_name]) && $mg_list[goods_option3_content] && strlen($mg_list[goods_option3_content]) > 4) or (trim($mg_list[goods_option4_name]) && $mg_list[goods_option4_content] && strlen($mg_list[goods_option4_content]) > 4) or (trim($mg_list[goods_option5_name]) && $mg_list[goods_option5_content] && strlen($mg_list[goods_option5_content]) > 4) or (trim($mg_list[goods_option6_name]) && $mg_list[goods_option6_content] && strlen($mg_list[goods_option6_content]) > 4) or (trim($mg_list[goods_option7_name])) ){ return 1; }else{ return 0; } } //-------------------------------------------------------------------------------- // 주문상품리스트출력 //-------------------------------------------------------------------------------- function purchase_list($sess){ global $connect,$morning_purchase_table,$g_all_slink_dir,$g_all_link_dir,$morning_purchase_option_table,$morning_gcomment_table,$morning_category_table; $result = hd_query("select * from $morning_purchase_table where purchase_sess = '$sess' order by register_date asc"); while($pu_list = hd_fetch($result)) { //후기유무 $gcomment = hd_fetch(hd_query("select uid from $morning_gcomment_table where purchase_uid='$pu_list[uid]'")); //옵션상품 $op_query = hd_query("select * from $morning_purchase_option_table where cart_uid = '$pu_list[cart_uid]' and purchase_sess = '$sess' order by option_uid desc"); //상품정보 $goods_query = hd_query("select * from morning_goods_table where uid = ".$pu_list[purchase_goods_id] ); $goods_list = hd_fetch($goods_query); $chknum = 0; $option_text = " "; while($op_list = hd_fetch($op_query)){ $option_num = ""; $chknum++; $option_text .= " "; if($op_list[option_uid] == "8"){ $option_num = $op_list[option_num]; } } $option_text .= "
    ".$op_list[option_name]." ".number_format($op_list[option_price])."원 ".number_format($op_list[option_num])."개 ".number_format($op_list[option_price]*$op_list[option_num])."원
    "; //구버전때문에.. ㅠㅠ if($chknum < 1){ $option_text .= "$pu_list[purchase_num] 개"; } if(!$option_num){ $option_num = $pu_list[purchase_num]; } $num++; unset($opt); //옵션정리하기 if(show_select_option($pu_list[purchase_option1])){ $opt .= "
    ".show_select_option($pu_list[purchase_option1])."
    "; } if(show_select_option($pu_list[purchase_option2])){ $opt .= "
    ".show_select_option($pu_list[purchase_option2])."
    "; } if(show_select_option($pu_list[purchase_option3])){ $opt .= "
    ".show_select_option($pu_list[purchase_option3])."
    "; } if(show_select_option($pu_list[purchase_option4])){ $opt .= "
    ".show_select_option($pu_list[purchase_option4])."
    "; } if(show_select_option($pu_list[purchase_option5])){ $opt .= "
    ".show_select_option($pu_list[purchase_option5])."
    "; } if(show_select_option($pu_list[purchase_option6])){ $opt .= "
    ".show_select_option($pu_list[purchase_option6])."
    "; } if($pu_list[purchase_option7]){ $opt .= "
    ".$pu_list[purchase_option7]."
    "; } if(show_select_option($pu_list[purchase_option8])){ $opt .= "
    ".show_select_option($pu_list[purchase_option8])."
    "; } $option_text = "
    ".$opt."
    ".$option_text; //거래처메일 if($pu_list[purchase_supply_email]) $save_supply_email[] .= $pu_list[purchase_supply_email]; //에스크로 관련 장바구니 정보빼오기 $es_cart_num++; $g_now_date2 = date("Ymd",$g_now_time); $es_cart .= "seq=".$es_cart_num."ordr_numb=".$g_now_date2."$es_cart_num"."good_name=".$pu_list[purchase_subject]."good_cntx=".$pu_list[purchase_num]."good_amtx=".round($pu_list[purchase_price]).""; //상품이름 결제사에 1개 표기용 $show_goods = $pu_list[purchase_subject]; //1개이상일때.. $purchase_num = "".$pu_list[purchase_num]."개"; if($pu_list[purchase_num] > 1){ $purchase_num = "".$pu_list[purchase_num]."개"; } $pu_list[purchase_image_file1] = str_replace(" ","%20",$pu_list[purchase_image_file1]); if($pu_list[purchase_free_delivery]) $purchase_free_delivery = " "; else $purchase_free_delivery = ""; $ca_list = hd_fetch(hd_query("select category_name from $morning_category_table where category_id = '$pu_list[purchase_category]'")); //배열기록하기 $row[uid][] .= $pu_list[uid]; //고유값 $row[category_name][] .= $ca_list[category_name]; //카테고리이름 $row[pu_price][] .= make_price_format($pu_list[purchase_price])."원"; //판매가 $row[pu_point][] .= "
    ".make_price_format($pu_list[purchase_point])."점"; //적립금 $row[pu_price_total][] .= make_price_format($pu_list[purchase_price]*$pu_list[purchase_num])."원"; //판매가*수량 $row[pu_point_total][] .= "
    ".make_price_format($pu_list[purchase_point]*$pu_list[purchase_num])."점"; //적립금*수량 $row[pu_num][] .= $purchase_num; //판매수량 $row[pu_op_num][] .= $option_num; //판매수량 (옵션) $row[pu_option][] .= $option_text; //선택옵션 $row[pu_free_delivery][] .= $purchase_free_delivery; //무료배송 if($pu_list[purchase_delivery_price] > 0){ $row[pu_delivery_price_text][] .= "단독 배송상품:".make_price_format($pu_list[purchase_delivery_price])."원"; //단독배송 }else{ $row[pu_delivery_price_text][] .= ""; //단독배송 } if($pu_list[purchase_upon_delivery] > 0){ $row[pu_upon_delivery][] .= "(착불전용)"; //착불배송 }else{ $row[pu_upon_delivery][] .= ""; //착불배송 } $row[pu_subject][] .= $pu_list[purchase_subject]; //상품명 $row[pu_code][] .= "(".$pu_list[purchase_code].")"; //상품코드 $row[goods_total_round][] = $goods_list[goods_total_round]; $row[goods_total_amount][] = $goods_list[goods_total_amount]; $row[goods_sale_price][] = $goods_list[goods_sale_price]; if(goods_img_urlchk($pu_list[purchase_image_file1])){ $row[pu_image][] .= ""; //상품이미지 }else{ $row[pu_image][] .= ""; //상품이미지 } $row[pu_gcomment_uid][] .= $gcomment[uid]; //후기 $row[pu_goods_id][] .= $pu_list[purchase_goods_id]; $total_price += $pu_list[purchase_price]*$pu_list[purchase_num]; //총판매가 $total_point += $pu_list[purchase_point]*$pu_list[purchase_num]; //총적립금 $total_num += $pu_list[purchase_num]; //총구입수량 $goods_09 += $pu_list[purchase_class]; //공동구매상품인지 } $row[num] = $num; $row[total_price] = $total_price; $row[total_point] = $total_point; $row[total_num] = $total_num; $row[show_goods] = $show_goods; $row[es_cart] = $es_cart; $row[es_cart_num] = $es_cart_num; $row[purchase_class] = $goods_09; return $row; } //-------------------------------------------------------------------------------- // 게시물리스트출력 //-------------------------------------------------------------------------------- function bbs_list($list,$_width="",$_height="",$_namecut="40",$_advancecut="0",$total_show="",$gallery="off"){ global $connect,$g_skin_link,$cf_point_percent_chk,$cf_point_percent,$cf_account_method,$morning_bcomment_table,$morning_goods_table,$g_check_rank,$cf_memberid_row,$g_check_id,$morning_member_table,$ps_db,$ps_page,$ps_sele,$ps_ques,$ps_line,$ps_choi,$ps_divi,$g_now_time,$cf_board,$show_category_array,$g_file_okimage; $list[board_name] = avoid_crack(strip_tags($list[board_name])); //에디터 썸네일 if($gallery == "on"){ if(!$list[board_fname1] && $list[cheditor_file]){ $temp_edimg = explode("‡",$list[cheditor_file]); $edimg = explode("†",$temp_edimg[0]); if(trim($edimg[3])){ $list[board_fname1] = "cheditor/attach/".$edimg[3]; } } } if($_width) $width_txt = "width='$_width'"; if($_height) $height_txt = "height='$_height'"; $no_image = "no_image_200.gif"; /*--------------------- 에디터이미지 ---------------------*/ $show_file1 = ""; $cheditor_file_arr = explode("†",$list[cheditor_file]); $cheditor_file = str_replace($_SERVER['DOCUMENT_ROOT'],"",$cheditor_file_arr[1]); if(!$list[board_fname1] && $cheditor_file){ $show_file1 = ""; //$show_file1 = "$list[uid],"ps_category"=>$list[board_category],"ps_db"=>$ps_db,"ps_mode"=>""))."\">".$show_file1.""; } //썸네일이미지 if(!$ps_db) $ps_db = str_replace("morning_bcomment_","",$morning_bcomment_table); $file_ex = substr(strrchr($list[board_fname1],"."),1); if(in_array($file_ex,$g_file_okimage)) $show_file1 = ""; if($list[board_fname2]) $show_file2 = ""; $v_addfile_row = explode("†",$list[board_addfile]); if(!$list[board_fname1] && $v_addfile_row[0]){ $show_file1 = ""; } if(!$show_file1){ $show_file1 = ""; } if($_width > 0){ //$show_file1 = "$list[uid],"ps_category"=>$list[board_category],"ps_db"=>$ps_db,"ps_mode"=>""))."\">".$show_file1.""; } /*---------------------첨부파일1 ---------------------*/ if($list[board_fname1]) { $file_ex = substr(strrchr($list[board_fname1],"."),1); $temp_filename = getbasename($list[board_fname1]); $temp_filename = cut_str($temp_filename, 50); if(in_array($file_ex,$g_file_okimage)) { // 이미지 .. 일경우 $size = @getimagesize("$list[board_fname1]"); if ($size[0] > 700) { $width = 700; } else { $width = $size[0]; } if($width > 0 && $size[0] > 0 && $size[1] > 0){ $height = intval($size[1] * ($width / $size[0])); } if ($size[0] > 780) { $bimage_width = 800; $bimage_height = 600; } else { $bimage_width = $size[0] + 40; $bimage_height = $size[1] + 40; } if(!$size[0]) { $width = 400; $bimage_width = "800"; } if(!$size[1]) { $height = 400; $bimage_height = "600"; } //모바일에서 이미지width 초기화 if($_SESSION["mobile_sess"] == "on"){ $show_image_file1 = "

    "; $show_down_file1 = ""; }else{ $show_image_file1 = "

    "; $show_down_file1 = ""; } } else { $show_image_file1 = ""; $show_down_file1 = "Download #1 : ".$temp_filename." (".$list[down_num1].") Size : ".get_filesize_size($list[board_fsize1]).""; } } /*---------------------첨부파일2 ---------------------*/ if($list[board_fname2]) { $file_ex = substr(strrchr($list[board_fname2],"."),1); $temp_filename = getbasename($list[board_fname2]); $temp_filename = cut_str($temp_filename, 50); if(in_array($file_ex,$g_file_okimage)) { // 이미지 .. 일경우 $size = @getimagesize("$list[board_fname2]"); if ($size[0] > 700) { $width = 700; } else { $width = $size[0]; } if($width > 0 && $size[0] > 0 && $size[1] > 0){ $height = intval($size[1] * ($width / $size[0])); } if ($size[0] > 780) { $bimage_width = 800; $bimage_height = 600; } else { $bimage_width = $size[0] + 40; $bimage_height = $size[1] + 40; } if(!$size[0]) { $width = 400; $bimage_width = "800"; } if(!$size[1]) { $height = 400; $bimage_height = "600"; } //모바일에서 이미지width 초기화 if($_SESSION["mobile_sess"] == "on"){ $show_image_file2 = "

    "; $show_down_file2 = ""; }else{ $show_image_file2 = "

    "; $show_down_file2 = ""; } } else { $show_image_file2 = ""; $show_down_file2 = "Download #2 : ".$temp_filename." (".$list[down_num2].") Size : ".get_filesize_size($list[board_fsize2]).""; } } /*---------------------무한첨부 ---------------------*/ $v_addfile_row = explode("†",$list[board_addfile]); for($i=0;$i 700) { $width = 700;} else { $width = $size[0]; } if($_SESSION["mobile_sess"] == "on"){ $width = "100%"; } $addfile_image[] .= "

    "; } if($v_addfile_row[$i]){ $addfile_down[] .= "Download : ".$temp_filename.""; } } $addfile_image_text = ""; for($i=0;$i"; $goods_img = "".$goods_img.""; } $register_date = date("Y-m-d",$list[register_date]); if($g_check_rank > 8 || ($cf_memberid_row[0] && in_array($g_check_id,$cf_memberid_row))) $show_check_uid = ""; else $show_check_uid = ""; $depth = $list[depth]; if($depth) { $show_icon = " "; $show_boid = $total_show; } else { $show_icon = ""; $show_boid = $total_show; } if($list[board_category]) { $view_icon .= ""; } //게시물 교차색상 $turn_co = $total_show % 2; if($turn_co == 1){ $show_bgcolor = "bgcolor = '#F7F7F7'"; }else{ $show_bgcolor = "bgcolor = '#FFFFFF'"; } if($list[headnum] < 1000) { $show_boid = ""; $show_bgcolor = "bgcolor = '#FFFFC8'"; } else { if($cf_board[use_category] == "1") { if($list[board_category] and $show_category_array[$list[board_category]]) { $show_category_list = "[".$show_category_array[$list[board_category]]."]  "; }else { $show_category_list = ""; } } } // 이름 이미지화 if($list[board_id]) { $me_list = hd_fetch(hd_query("select * from $morning_member_table where member_id = '$list[board_id]'")); if($me_list[member_image]) { $list[board_name] = ""; } } $show_name = name_secret($list[board_name]); $inner_cn = morning_counter("$morning_bcomment_table","buid = '$list[uid]'");// 지정 길이 이상 제목 삭제 if($inner_cn){$comment_num = "[".$inner_cn."]";}else{$comment_num = "";} if($_namecut) { $list[board_subject] = cut_str(strip_tags($list[board_subject]),$_namecut,".."); } if($_advancecut) { $list[board_body] = cut_str(strip_tags($list[board_body]),$_advancecut,".."); } // 비밀글 아이콘 붙이기 if($list[use_secret] == "1") { $show_secret = ""; }else { $show_secret = ""; } //오늘 등록된 글 $back1time = $list[register_date]+60*60*24; if($g_now_time < $back1time){ $newicon="";}else{ $newicon=""; } //오늘 등록된 컴멘트 $querycom = "select * from $morning_bcomment_table where buid='$list[uid]' order by register_date desc"; $listcom = hd_fetch(hd_query($querycom)); $back1time = $listcom[register_date]+60*60*24; if($g_now_time < $back1time){ $newicon="";} if($list[use_html]) { $show_subject = (avoid_crack($list[board_subject])); $show_body = (avoid_crack($list[board_body])); } else { $show_subject = (make_br(del_teg($list[board_subject]))); $show_body = (autolink(make_br(del_teg($list[board_body])))); } $show_subject = stripslashes($list[board_subject]); $show_body = stripslashes($list[board_body]); $list[board_vote] = icon_star($list[board_vote]); //모바일에서 이미지width 초기화 if($_SESSION["mobile_sess"] == "on"){ $show_body = width_height_del($show_body); } $row = array ( uid => "$list[uid]", headnum => "$list[headnum]", depth => "$list[depth]", goods_id => "$list[goods_id]", board_id => "$list[board_id]", board_id2 => "$list[board_id2]", board_pass => "$list[board_pass]", board_name => "$show_name", board_homepage => "$list[board_homepage]", board_email => "$list[board_email]", board_subject => "$show_subject", use_html => "$list[use_html]", use_secret => "$list[use_secret]", use_mail => "$list[use_mail]", board_category => "$list[board_category]", board_link1 => "$list[board_link1]", board_link2 => "$list[board_link2]", board_fname1 => "$list[board_fname1]", board_fname2 => "$list[board_fname2]", board_fsize1 => "$list[board_fsize1]", board_fsize2 => "$list[board_fsize2]", down_num1 => "$list[down_num1]", down_num2 => "$list[down_num2]", board_hit => "$list[board_hit]", board_vote => "$list[board_vote]", board_ip => "$list[board_ip]", modify_id => "$list[modify_id]", modify_ip => "$list[modify_ip]", modify_date => "$list[modify_date]", register_date => "$list[register_date]", approval_date => "$list[approval_date]", total_comment => "$list[total_comment]", etc => "$list[etc]", show_category_list => $show_category_list, board_body => $show_body, show_secret => $show_secret, newicon => $newicon, show_bgcolor => $show_bgcolor, show_icon => $show_icon, show_boid => $show_boid, show_file1 => $show_file1, show_file2 => $show_file2, show_image_file1 => $show_image_file1, show_image_file2 => $show_image_file2, addfile_image => $addfile_image_text, show_down_file1 => $show_down_file1, show_down_file2 => $show_down_file2, show_link1 => $show_link1, show_link2 => $show_link2, goods_img => $goods_img, register_date => $register_date, show_check_uid => $show_check_uid, comment_num => $comment_num ); return $row; } //-------------------------------------------------------------------------------- // 재고량표시 (주문후 주문내역보기시) //-------------------------------------------------------------------------------- function option_stock_chk($pu_list){ global $connect,$morning_goods_table; //품절표시 $add_list = hd_fetch(hd_query("select * from $morning_goods_table where uid = '$pu_list[purchase_goods_id]'")); if($pu_list[purchase_option1]){ $cart_option1_temp = explode(",",$pu_list[purchase_option1]); $goods_option1_content_temp = explode("/",$add_list[goods_option1_content]); for($i=0;$i 0 then a.cart_price * a.cart_num else 0 end) as only_delivery_price from $morning_cart_table as a left join $morning_goods_table as b on a.cart_goods_id = b.uid where a.cart_sess = '$g_check_cart' and a.buy_chk = '1' group by a.cart_sess "); $ct_row = hd_fetch($cquery); $basic_deliery = $cf_delivery_money; if($ct_row[total_price]-$ct_row[only_delivery_price] >= $cf_delivery_free) { $basic_deliery = "0"; } //-- 배송방법 선택 -- /* if($delivery_method){ $delivery_item = explode(",",$delivery_method); if($delivery_item[2] <= $ct_row[total_price]){ $basic_deliery = 0; }else{ $basic_deliery = $delivery_item[1]; } }*/ //-- 기본배송비 -- if($ct_row[free_delivery] > 0){$basic_deliery = "0";} //기본배송료 if($ct_row[total_price] < 1) { $basic_deliery = "0"; } //--// 기본배송비 -- //-- 거래업체배송비 -- $result = hd_query(" select sum(a.cart_price) as total_price, sum(a.cart_free_delivery) as cart_free_delivery, sum(c.goods_kg * b.option_num) as total_kg, (b.option_num), (a.cart_supply_id) from $morning_cart_table as a left join $morning_cart_option_table as b on a.uid = b.cart_uid left join $morning_goods_table as c on a.cart_goods_id = c.uid where a.cart_sess = '$g_check_cart' and c.goods_free_delivery < 1 and c.goods_upon_delivery < 1 and b.option_uid = 8 and a.buy_chk = '1' and c.goods_delivery_price < 1 group by cart_supply_id "); $supply_num = 0; $delivery_info = ""; while($list = hd_fetch($result)){ $list_su = hd_fetch(hd_query(" select * from $morning_supply_table where supply_id = '$list[cart_supply_id]' ")); if($list[cart_supply_id]){ //-- 무개별 추가배송비 -- if($cf_delivery_money_kg > 0 and $cf_delivery_money_add > 0 && $cf_delivery_money_add_chk > 0){ $kg_temp = intval($list[total_kg] / $cf_delivery_money_kg,0); $kg_deliery = $cf_delivery_money_add * $kg_temp; } //--// 무개별 추가배송비 -- if($list[total_price] >= $list_su[supply_delivery_no]){ $list_su[supply_delivery] = 0; } $sp_delivery = $sp_delivery + $list_su[supply_delivery] + $kg_deliery; //거래업체 배송료(거래업체상품일때..) $text_delivery .= " ".$list[cart_supply_id]."업체배송료 : ".number_format($list_su[supply_delivery]+$kg_deliery)."원 (".($list[total_kg]*1)."kg) +"; $delivery_info .= "$list[cart_supply_id]:".($list_su[supply_delivery]+$kg_deliery)."/"; } if(!$list[cart_supply_id]){ //-- 무개별 추가배송비 -- if($cf_delivery_money_kg > 0 and $cf_delivery_money_add > 0 && $cf_delivery_money_add_chk > 0){ $kg_temp = intval($list[total_kg] / $cf_delivery_money_kg,0); $kg_deliery = $cf_delivery_money_add * $kg_temp; } //--// 무개별 추가배송비 -- $sp_delivery = $sp_delivery + $basic_deliery + $kg_deliery ; //환경설정의 관리자 배송료(거래업체상품이아닐때..) $text_delivery .= " 본사배송료 : ".number_format($cf_delivery_money+$kg_deliery )."원 (".($list[total_kg]*1)."kg) +"; $delivery_info .= "본사배송료:".($cf_delivery_money+$kg_deliery)."/"; } $supply_num++; } if(!$supply_num) $supply_num = 1; $text_delivery = substr($text_delivery,0,-2); $basic_deliery = $sp_delivery; //거래업체 배송일경우 기본배송비 교체 //--// 기본배송비 -- //-- 단독배송비 (거래업체별로 뽑지 않음. 무료배송없음. 그냥 단독으로만~) -- $only_result = hd_query(" select sum(c.goods_delivery_price * b.option_num) as total_price from $morning_cart_table as a left join $morning_cart_option_table as b on a.uid = b.cart_uid left join $morning_goods_table as c on a.cart_goods_id = c.uid where a.cart_sess = '$g_check_cart' and c.goods_free_delivery < 1 and b.option_uid = 8 and a.buy_chk = '1' and c.goods_delivery_price > 0 group by a.cart_sess "); $only_row = hd_fetch($only_result); $basic_deliery = $basic_deliery + $only_row[total_price]; //--// 단독배송비 -- $row = array ( total_price => "$ct_row[total_price]", total_point => "$ct_row[total_point]", total_num => $ct_row[total_num]*1, basic_deliery => "$basic_deliery", wrapping_price => "$wrapping_price", total_kg => "$total_kg", free_delivery => "$ct_row[free_delivery]", text_delivery => "$text_delivery", delivery_info => $delivery_info, //주문서에 기록할 배송비내역 supply_num => $supply_num //거래처수 (도선료때문에..) ); return $row; } //-------------------------------------------------------------------------------- // PG사 파라미터 //-------------------------------------------------------------------------------- function pg_parameter($sess,$company){ global $connect,$morning_buyer_table,$morning_purchase_table,$cf_card_day,$cf_card_logourl,$cf_card_id,$cf_mall_name,$cf_terminal_id,$cf_card_escrowuse,$cf_card_besong,$cf_card_day,$buyer_payment,$g_now_time,$g_skin_link,$cf_terminal_id,$g_user_ip,$g_page_name,$g_all_slink_dir,$cf_mall_url,$cf_business_name,$mobile_chk,$DOCUMENT_ROOT,$cf_mall_install_dir,$db_charset; $result = hd_query(" select * from $morning_buyer_table as a , $morning_purchase_table as b where a.buyer_sess = b.purchase_sess and a.buyer_sess = '$sess' order by b.uid "); while($bu_list = hd_fetch($result)){ $k++; $bu_list[purchase_subject] = addslashes($bu_list[purchase_subject]); $bu_list[purchase_subject] = str_replace("\'","'",$bu_list[purchase_subject]); $bu_list[purchase_subject] = str_replace("\"",""",$bu_list[purchase_subject]); //에스크로 관련 장바구니 정보빼오기 $es_cart .= "seq=".$k."ordr_numb=".date("Ymd",$g_now_time).$k."good_name=".($bu_list[purchase_subject])."good_cntx=".$bu_list[purchase_num]."good_amtx=".round($bu_list[purchase_price]).""; $order_sess = $bu_list[buyer_sess]; //주문번호 $pament = $bu_list[buyer_payment]; //결제방법 $state = $bu_list[buyer_state]; //주문상태 $goodsname = addslashes(strip_tags($bu_list[purchase_subject])); //상품이름 $goodsimage = $bu_list[purchase_image_file1];//상품이미지 $oname = $bu_list[buyer_name1]; //주문자명 $oemail = $bu_list[buyer_email]; //주문자메일 $otel = $bu_list[buyer_tel1]; //주문자 전화번호 $omobile = $bu_list[buyer_tel2]; //주문자 휴대번호 $ozip = $bu_list[buyer_zip1]; //수취인 우편번호 $oaddress = $bu_list[buyer_address1]; //수취인 주소 $dname = $bu_list[buyer_name3]; //수취인 이름 $dtel = $bu_list[buyer_tel3]; //수취인 전화번호 $dmobile = $bu_list[buyer_tel4]; //수취인 휴대번호 $demail = $bu_list[buyer_email]; //수취인이메일 $dzip = $bu_list[buyer_zip2]; //수취인 우편번호 $daddress = $bu_list[buyer_address2]; //수취인 주소 $price_arr = get_buyer_price($sess); //결제금액 $price = $price_arr[0]; //결제금액 $price_notex = $price_arr[2]; //비과세금액 $price_tax = make_price_format(($price_arr[1]/1.1),0); //과세대상금액 $vat = make_price_format(($price_arr[1]-$price_tax),0); //부가세 } $es_cart_num = $k;//상품총수 $es_cart = $es_cart;//장바구니 상품정보 (PG사마다 다름) /*--------------------- kcp ---------------------*/ if($company == "kcp" && $mobile_chk != "on"){ ?>
    지불 방법
    주문 번호
    상품명