ÿØÿà 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"; $table="TB_HOTEL_DATE"; $price_ori = str_replace(",","",$price_ori);// 정상가 $price_cost = str_replace(",","",$price_cost);// 계약가 $price_sell = str_replace(",","",$price_sell);// 판매가 // 적립금 if(!$point_yn) $point_yn="N"; $point_buy1= str_replace(",","",$point_buy1); // 구매액(상품가격) 원당 $point_buy2= str_replace(",","",$point_buy2); // 원 적립 // 행사 업데이트 대상 항목 정리 if(is_array($chg_item_arr)) { foreach($chg_item_arr as $v){ $chg_item_arr2[$v] = "Y"; } } // 공통 쿼리 if($SqlType=="roomdate_ins" or $SqlType=="roomdate_updt") { // 대리점 $d_agent_ga = ""; if(is_array($agent_seq_ar)) { for($i=0 ; $i<count($agent_id_ar) ; $i++) { $agent_id = $agent_id_ar[$i]; $agent_price = str_replace(",","",$agent_price_ar[$i]); if($agent_id) { $d_agent_ga .= "||".$agent_id."^".$agent_price; } } } // 담당자 if ($admin_id) { $mem_data = get_member($admin_id); $admin_nm = $mem_data['mb_nm']; } // 옵션상품 $d_option_ga=""; for($i=0 ; $i<count($opid_ar) ; $i++){ if($opid_ar[$i]) $d_option_ga .="||".$opid_ar[$i]."^".$op_nm_ar[$i]."^".$op_price_sell_ar[$i]."^".$op_price_agent_ar[$i]."^".$op_price_cost_ar[$i]; } if($chg_item_arr2['price_sell']=="Y" or $SqlType=="roomdate_ins") { $sql_set = " ,price_ori='{$price_ori}' "; $sql_set .= " ,sale_rate='{$sale_rate}' "; //성인 $sql_set .= " ,price_cost='{$price_cost}' "; $sql_set .= " ,price_sell='{$price_sell}' "; } if($chg_item_arr2['admin_id']=="Y" or $SqlType=="roomdate_ins") { $sql_set .= " ,admin_id = '{$admin_id}' "."\n"; $sql_set .= " ,admin_nm = '{$admin_nm}' "."\n"; } if($chg_item_arr2['price_agent']=="Y" or $SqlType=="roomdate_ins") { $sql_set .= " ,d_agent_ga='{$d_agent_ga}' "; } if($chg_item_arr2['option']=="Y" or $SqlType=="roomdate_ins") { $sql_set .= " ,d_option_ga='{$d_option_ga}' "; } if($chg_item_arr2['total_seat']=="Y" or $SqlType=="roomdate_ins") { $sql_set .= " ,total_seat='{$total_seat}' "; // 블록수 } // 적립금 if($chg_item_arr2['point']=="Y" or $SqlType=="roomdate_ins") { $sql_set .= " , point_yn= '{$point_yn}' "."\n"; // $sql_set .= " , point_buy1= '{$point_buy1}' "."\n"; // 구매액(상품가격) $sql_set .= " , point_buy2= '{$point_buy2}' "."\n"; // 적립액 } $sql_set .= " ,ins_dt=now() "; } // 입실일 생성 if($SqlType=="roomdate_ins") { if ( !$hseq or !$ridx ) exit; $sql_set .= " ,adult_num='{$adult_num}' "; // 성인기본인원 $sql_set .= " ,adult_maxnum='{$adult_maxnum}' "; // 성인최대인원 $sql_set .= " ,person_max_price='{$person_max_price}' "; // 기준인원초과요금(인당) $sql_set .= " ,room_bedtype='{$room_bedtype}' "; // 베드타입 $sql_set .= " ,lodg_state_cd='{$lodg_state_cd}' "; // 예약가능상태 $sql_set .= " ,left_seat='{$left_seat}'"; // 사용 룸수 // 입실실 자동생성 if($con_input=="auto") { $room_date_s = $room_date_s1; $data_dt = date_to_date($room_date_s , $room_date_e); 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]){ // 체크된 요일 // 동일 입실일 존재 $r = db_fetch("select count(*) room_cnt from {$table} where h_seq='{$hseq}' and r_idx='{$ridx}' and room_date='{$row[date]}' "); // 입실일이 있을때 업데이트 if ($r['room_cnt']>0) { $sql = "update {$table} 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); } // 입실일이 없을때 인서트 else { $sql = "insert into {$table} 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} " ; 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]; // 동일 입실일 존재 $r = db_fetch("SELECT count(*) room_cnt FROM {$table} WHERE h_seq='{$hseq}' AND r_idx='{$ridx}' AND room_date='{$room_date}' "); // 입실일이 있을때 업데이트 if($r['room_cnt']>0){ $sql = "update {$table} 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} set "; $sql .= " h_seq='{$hseq}' "; $sql .= " ,r_idx='{$ridx}' "; $sql .= " ,r_cont='{$r_cont}' "; $sql .= " ,cont='{$cont}' "; $sql .= " ,room_date='{$room_date}' "; //$sql .= " ,left_seat='{$left_seat}'"; // 사용 룸수 $sql .= $sql_set ; db_query($sql); } } } // 호텔마스터정보 최저가/최고가 업데이트 db_query("call SP_HOTEL_PRICE_LOWHIGH('{$hseq}');"); error_msg("opener.hotelDateList();alert('생성완료하였습니다.');","script"); } // 입실일 저장 else if($SqlType=="roomdate_updt") { // 공통쿼리 if($chg_item_arr2['cont']=="Y") { $sql_set .= ",cont='{$cont}' "; } // 전체선택 if($all=="Y"){ $sql = "update {$table} set sel_agent='' {$sql_set} where h_seq='{$hseq}' and r_idx = '{$ridx}' "; db_query($sql); }else{ for($i=0 ; $i<count($hdidx_ar) ; $i++) { $hdidx = $hdidx_ar[$i]; if($hdidx) { $sql = "update {$table} set sel_agent='' {$sql_set} where hdidx='{$hdidx}' "; db_query($sql); } } } // 호텔마스터정보 최저가/최고가 업데이트 db_query("call SP_HOTEL_PRICE_LOWHIGH('{$hseq}');"); // 달력목록 reload error_msg("opener.hotelDateList();document.location.reload();","script"); } // 예약상태 수정 else if($SqlType=="hotel_dok_updt") { if(!$hseq) exit; // 전체선택 if($all=="Y"){ $sql = "update {$table} set lodg_state_cd='{$lodg_state_cd}' where h_seq='{$hseq}' and r_idx = '{$ridx}' "; db_query($sql); }else{ for($i=0 ; $i<count($hdidx_ar) ; $i++) { $hdidx = $hdidx_ar[$i]; if($hdidx) { $sql = "update {$table} set lodg_state_cd='{$lodg_state_cd}' where hdidx='{$hdidx}' "; db_query($sql); } } } error_msg("parent.hotelDateList();parent.to_dialog.close('{$tmp_layer_id}');","script"); } // 입실일 삭제 else if($SqlType=="hotel_date_del") { if(!$hdidx_ga and !$ridx and !$hseq) exit; $chk_seq=explode(",",$hdidx_ga); // 전체선택 if($all=="Y"){ $sql = "delete from {$table} where h_seq='{$hseq}' and r_idx = '{$ridx}' "; db_query($sql); }else{ for($i=0 ; $i<count($chk_seq) ; $i++) { $hdidx = $chk_seq[$i]; if($hdidx) { $sql = "delete from {$table} where hdidx='{$hdidx}' "; db_query($sql); } } } // 호텔마스터정보 최저가/최고가 업데이트 db_query("call SP_HOTEL_PRICE_LOWHIGH('{$hseq}');"); error_msg("hotelDateList();","script"); } ?>